File tree Expand file tree Collapse file tree 3 files changed +49
-7
lines changed
client/src/components/apps Expand file tree Collapse file tree 3 files changed +49
-7
lines changed Original file line number Diff line number Diff line change 1919
2020 <v-tabs-items v-model =" tab" >
2121 <v-tab-item transition =" false" class =" background" >
22- <logs :pipeline =" pipeline" :phase =" phase" :app =" app" />
22+ <logs :pipeline =" pipeline" :phase =" phase" :app =" app" :deploymentstrategy = " appData.spec.deploymentstrategy " />
2323 </v-tab-item >
2424 <v-tab-item transition =" false" class =" background" >
2525 <events :pipeline =" pipeline" :phase =" phase" :app =" app" />
3232</template >
3333
3434<script >
35+ import axios from " axios" ;
3536export default {
3637 data () {
3738 return {
@@ -58,8 +59,41 @@ export default {
5859 href: ` #/pipeline/${ this .pipeline } /${ this .phase } /${ this .app } /detail` ,
5960 }
6061 ],
62+ pipelineData: {},
63+ appData: {},
6164 }
6265 },
66+ mounted () {
67+ this .loadPipeline ();
68+ this .loadApp ();
69+ this .socketJoin ();
70+ },
71+ beforeDestroy () {
72+ this .socketLeave ();
73+ },
74+ methods: {
75+ socketLeave () {
76+ this .$socket .client .emit (" leave" , {
77+ room: ` ${ this .pipeline } -${ this .phase } -${ this .app } ` ,
78+ });
79+ },
80+ socketJoin () {
81+ this .$socket .client .emit (" join" , {
82+ room: ` ${ this .pipeline } -${ this .phase } -${ this .app } ` ,
83+ });
84+ },
85+ loadPipeline () {
86+ axios .get (' /api/pipelines/' + this .pipeline ).then (response => {
87+ this .pipelineData = response .data ;
88+ });
89+ },
90+ loadApp () {
91+ axios .get (' /api/pipelines/' + this .pipeline + ' /' + this .phase + ' /' + this .app ).then (response => {
92+ this .appData = response .data ;
93+ });
94+ },
95+ },
96+
6397 components: {
6498 events : () => import (' ./events.vue' ),
6599 logs : () => import (' ./logstab.vue' ),
Original file line number Diff line number Diff line change 22 <div style =" height : 95% ;" >
33 <v-tabs class =" console-bar" >
44 <template >
5- <v-tab @click =" getLogHistory('web')" >web </v-tab >
6- <v-tab @click =" getLogHistory('builder')" >build</v-tab >
7- <v-tab @click =" getLogHistory('fetcher')" >fetch</v-tab >
5+ <v-tab @click =" getLogHistory('web')" >run </v-tab >
6+ <v-tab v-if = " deploymentstrategy == 'git' " @click =" getLogHistory('builder')" >build</v-tab >
7+ <v-tab v-if = " deploymentstrategy == 'git' " @click =" getLogHistory('fetcher')" >fetch</v-tab >
88 </template >
99 </v-tabs >
1010 <div class =" console" id =" console" >
@@ -44,7 +44,11 @@ export default {
4444 app: {
4545 type: String ,
4646 default: " new"
47- }
47+ },
48+ deploymentstrategy: {
49+ type: String ,
50+ default: " docker"
51+ },
4852 },
4953 data : () => ({
5054 loglines: [
Original file line number Diff line number Diff line change 1818 </v-row >
1919 <v-row style =" height : 1100px " >
2020 <v-col cols =" 12" sm =" 12" md =" 12" >
21- <logs :pipeline =pipeline :phase =phase :app =app ></logs >
21+ <logs :pipeline =pipeline :phase =phase :app =app :deploymentstrategy = deploymentstrategy ></logs >
2222 </v-col >
2323 </v-row >
2424
@@ -39,7 +39,11 @@ export default {
3939 app: {
4040 type: String ,
4141 default: " new"
42- }
42+ },
43+ deploymentstrategy: {
44+ type: String ,
45+ default: " docker"
46+ },
4347 },
4448 data : () => ({
4549 }),
You can’t perform that action at this time.
0 commit comments