Skip to content

Commit d004e6b

Browse files
committed
fix(container): 修复pod日志、容器跳转问题
1 parent 5af794f commit d004e6b

File tree

3 files changed

+75
-51
lines changed

3 files changed

+75
-51
lines changed

web/dashboard/src/business/workloads/pods/detail/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<h2 style="margin-top: 40px">{{$t('business.workload.container')}}</h2>
8888
<el-row style="margin-top: 20px" class="row-box">
8989
<el-card class="el-card">
90-
<ko-detail-containers :yamlInfo="form" />
90+
<ko-detail-containers :yamlInfo="form" :cluster="clusterName" />
9191
</el-card>
9292
</el-row>
9393
</div>

web/dashboard/src/components/detail/detail-containers-info.vue

Lines changed: 69 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -131,62 +131,73 @@
131131
<div v-for="(item, index) in container.healthCheck" :key="index">
132132
<h5 style="display: inline-block;margin-left: 10px;">{{item._type}}</h5>
133133
<div v-if="item._model.exec">
134-
<el-col :span="4">
135-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
136-
<span>exec</span>
137-
</el-form-item>
138-
</el-col>
139-
<el-col v-if="item._model.exec.command" :span="20">
140-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.command')">
141-
<el-tag type="success" style="margin-right: 10px;" v-for="(item, index) in item._model.exec.command" :key="index">{{item}}</el-tag>
142-
</el-form-item>
143-
</el-col>
134+
<el-row :gutter="20">
135+
<el-col :span="4">
136+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
137+
<span>exec</span>
138+
</el-form-item>
139+
</el-col>
140+
<el-col v-if="item._model.exec.command" :span="20">
141+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.command')">
142+
<div v-for="(item, index) in item._model.exec.command" :key="index">
143+
<el-tag v-if="item.length < 200" type="success">{{item}}</el-tag>
144+
<div v-else style="background-color: #1F261E;line-height: 20px;"><span class="spanStyle">{{item}}</span></div>
145+
</div>
146+
</el-form-item>
147+
</el-col>
148+
</el-row>
144149
</div>
145150
<div v-if="item._model.tcpSocket">
146-
<el-col :span="4">
147-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
148-
<span>tcpSocket</span>
149-
</el-form-item>
150-
</el-col>
151-
<el-col v-if="item._model.exec.port" :span="8">
152-
<el-form-item style="margin-left: 20px;" :label="$t('business.network.port')">
153-
<span>{{item._model.exec.port}}</span>
154-
</el-form-item>
155-
</el-col>
151+
<el-row :gutter="20">
152+
<el-col :span="4">
153+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
154+
<span>tcpSocket</span>
155+
</el-form-item>
156+
</el-col>
157+
<el-col v-if="item._model.exec.port" :span="8">
158+
<el-form-item style="margin-left: 20px;" :label="$t('business.network.port')">
159+
<span>{{item._model.exec.port}}</span>
160+
</el-form-item>
161+
</el-col>
162+
</el-row>
156163
</div>
157164
<div v-if="item._model.httpGet">
158-
<el-col :span="4">
159-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
160-
<span>httpGet</span>
161-
</el-form-item>
162-
</el-col>
163-
<el-col v-if="item._model.httpGet.path" :span="8">
164-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_path')">
165-
<span>{{item._model.httpGet.path}}</span>
166-
</el-form-item>
167-
</el-col>
168-
<el-col v-if="item._model.httpGet.port" :span="8">
169-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_port')">
170-
<span>{{item._model.httpGet.port}}</span>
171-
</el-form-item>
172-
</el-col>
165+
<el-row :gutter="20">
166+
<el-col :span="4">
167+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
168+
<span>httpGet</span>
169+
</el-form-item>
170+
</el-col>
171+
<el-col v-if="item._model.httpGet.path" :span="8">
172+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_path')">
173+
<span>{{item._model.httpGet.path}}</span>
174+
</el-form-item>
175+
</el-col>
176+
<el-col v-if="item._model.httpGet.port" :span="8">
177+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_port')">
178+
<span>{{item._model.httpGet.port}}</span>
179+
</el-form-item>
180+
</el-col>
181+
</el-row>
173182
</div>
174183
<div v-if="item._model.httpsGet">
175-
<el-col :span="4">
176-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
177-
<span>httpsGet</span>
178-
</el-form-item>
179-
</el-col>
180-
<el-col v-if="item._model.httpsGet.path" :span="8">
181-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_path')">
182-
<span>{{item._model.httpsGet.path}}</span>
183-
</el-form-item>
184-
</el-col>
185-
<el-col v-if="item._model.httpsGet.port" :span="8">
186-
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_port')">
187-
<span>{{item._model.httpsGet.port}}</span>
188-
</el-form-item>
189-
</el-col>
184+
<el-row :gutter="20">
185+
<el-col :span="4">
186+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.type')">
187+
<span>httpsGet</span>
188+
</el-form-item>
189+
</el-col>
190+
<el-col v-if="item._model.httpsGet.path" :span="8">
191+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_path')">
192+
<span>{{item._model.httpsGet.path}}</span>
193+
</el-form-item>
194+
</el-col>
195+
<el-col v-if="item._model.httpsGet.port" :span="8">
196+
<el-form-item style="margin-left: 20px;" :label="$t('business.workload.check_port')">
197+
<span>{{item._model.httpsGet.port}}</span>
198+
</el-form-item>
199+
</el-col>
200+
</el-row>
190201
</div>
191202
<el-row :gutter="20">
192203
<el-col v-if="item._model.failureThreshold" :span="4">
@@ -323,4 +334,12 @@ export default {
323334
</script>
324335

325336
<style scoped>
337+
.spanStyle {
338+
display: block;
339+
padding-left: 10px;
340+
margin-top: 5px;
341+
font-size: 12px;
342+
color:#67c23a;
343+
white-space: pre;
344+
}
326345
</style>

web/dashboard/src/components/detail/detail-containers.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ export default {
7373
name: "KoDetailContainers",
7474
components: { ComplexTable, KoDetailContainersInfo },
7575
props: {
76+
cluster: String,
7677
yamlInfo: Object,
7778
},
7879
watch: {
7980
yamlInfo: {
8081
handler(yamlInfo) {
8182
if (yamlInfo.spec.containers) {
8283
this.form = yamlInfo
84+
this.namespace = this.form.metadata.namespace
85+
this.name = this.form.metadata.name
8386
this.data = []
8487
if (yamlInfo.status.containerStatuses) {
8588
for (const c of yamlInfo.status.containerStatuses) {
@@ -107,6 +110,8 @@ export default {
107110
data() {
108111
return {
109112
form: {},
113+
namespace: "",
114+
name: "",
110115
data: [],
111116
containerInfo: {
112117
type: "",

0 commit comments

Comments
 (0)