Skip to content

Commit 14bfd80

Browse files
authored
Merge pull request #251 from kubero-dev/feature/improve-log-tabs
Show build and fetch log tab only on git deployments
2 parents bc0a4b7 + bf2d01c commit 14bfd80

File tree

3 files changed

+49
-7
lines changed

3 files changed

+49
-7
lines changed

client/src/components/apps/detail.vue

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
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"/>
@@ -32,6 +32,7 @@
3232
</template>
3333

3434
<script>
35+
import axios from "axios";
3536
export 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'),

client/src/components/apps/logs.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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: [

client/src/components/apps/logstab.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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
}),

0 commit comments

Comments
 (0)