Skip to content

Commit 87ce936

Browse files
committed
界面添加service context-path, client gray infos
1 parent e825210 commit 87ce936

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

spring-cloud-gray-webui/src/views/gray-instance/complex-table.vue

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@
103103
<el-dropdown-item @click.native="changeInstanceStatus(row, 'UNKNOWN')">UNKNOWN</el-dropdown-item>
104104
</el-dropdown-menu>
105105
</el-dropdown>
106+
<el-dropdown trigger="click">
107+
<el-button size="mini" type="info" style="width:80px">
108+
灰度信息
109+
<i class="el-icon-arrow-down" />
110+
</el-button>
111+
<el-dropdown-menu slot="dropdown">
112+
<el-dropdown-item @click.native="showGrayInfos(row, 'SERVICES')">服务/实例</el-dropdown-item>
113+
<el-dropdown-item @click.native="showGrayInfos(row, 'TRACKS')">追踪</el-dropdown-item>
114+
</el-dropdown-menu>
115+
</el-dropdown>
106116
</template>
107117
</el-table-column>
108118
</el-table>
@@ -147,6 +157,18 @@
147157
</div>
148158
</el-dialog>
149159

160+
<el-dialog :title="grayInfo.type" :visible.sync="grayInfo.dialogVisible" :loading="grayInfo.loading">
161+
{{ grayInfo.content }}
162+
<div slot="footer" class="dialog-footer">
163+
<el-button @click="grayInfo.dialogVisible = false">
164+
Cancel
165+
</el-button>
166+
<el-button type="primary" @click="refershGrayInfos()">
167+
Refersh
168+
</el-button>
169+
</div>
170+
</el-dialog>
171+
150172
<el-dialog :visible.sync="dialogPvVisible" title="Reading statistics">
151173
<el-table :data="pvData" border fit highlight-current-row style="width: 100%">
152174
<el-table-column prop="key" label="Channel" />
@@ -161,6 +183,7 @@
161183

162184
<script>
163185
import { fetchList, deleteInstance, createInstance, updateInstance, tryChangeInstanceStatus } from '@/api/gray-instance'
186+
import { getServiceAllInfos, getAllDefinitions } from '@/api/gray-client'
164187
import waves from '@/directive/waves' // waves directive
165188
import { parseTime } from '@/utils'
166189
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
@@ -223,6 +246,13 @@ export default {
223246
grayLock: 0,
224247
des: ''
225248
},
249+
grayInfo: {
250+
instanceId: '',
251+
type: '',
252+
content: '',
253+
dialogVisible: false,
254+
loading: false
255+
},
226256
dialogFormVisible: false,
227257
dialogStatus: '',
228258
textMap: {
@@ -407,6 +437,26 @@ export default {
407437
})
408438
})
409439
},
440+
showGrayInfos(row, type) {
441+
this.grayInfo.instanceId = row.instanceId
442+
this.grayInfo.type = type
443+
this.grayInfo.dialogVisible = true
444+
this.refershGrayInfos()
445+
},
446+
refershGrayInfos() {
447+
this.grayInfo.loading = true
448+
if (this.grayInfo.type === 'SERVICES') {
449+
getServiceAllInfos(this.listQuery.serviceId, this.grayInfo.instanceId).then(res => {
450+
this.grayInfo.content = res.data
451+
this.grayInfo.loading = false
452+
})
453+
} else if (this.grayInfo.type === 'TRACKS') {
454+
getAllDefinitions(this.listQuery.serviceId, this.grayInfo.instanceId).then(res => {
455+
this.grayInfo.content = res.data
456+
this.grayInfo.loading = false
457+
})
458+
}
459+
},
410460
handleDownload() {
411461
this.downloadLoading = true
412462
import('@/vendor/Export2Excel').then(excel => {

spring-cloud-gray-webui/src/views/gray-instance/discovery-instances.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@
6767
<el-dropdown-item @click.native="changeInstanceStatus(row, 'UNKNOWN')">UNKNOWN</el-dropdown-item>
6868
</el-dropdown-menu>
6969
</el-dropdown>
70+
<el-dropdown trigger="click">
71+
<el-button size="mini" type="info" style="width:80px">
72+
灰度信息
73+
<i class="el-icon-arrow-down" />
74+
</el-button>
75+
<el-dropdown-menu slot="dropdown">
76+
<el-dropdown-item @click.native="showGrayInfos(row, 'SERVICES')">服务/实例</el-dropdown-item>
77+
<el-dropdown-item @click.native="showGrayInfos(row, 'TRACKS')">追踪</el-dropdown-item>
78+
</el-dropdown-menu>
79+
</el-dropdown>
7080
</template>
7181
</el-table-column>
7282
</el-table>

spring-cloud-gray-webui/src/views/gray-service/list.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
<span>{{ scope.row.serviceName }}</span>
3434
</template>
3535
</el-table-column>
36+
<el-table-column label="Context Path" align="center">
37+
<template slot-scope="scope">
38+
<span>{{ scope.row.contextPath }}</span>
39+
</template>
40+
</el-table-column>
3641
<el-table-column label="实例数" align="center">
3742
<template slot-scope="scope">
3843
<span>{{ scope.row.instanceNumber }}</span>
@@ -100,6 +105,9 @@
100105
<el-form-item label="Service Name" prop="serviceName">
101106
<el-input v-model="temp.serviceName" />
102107
</el-form-item>
108+
<el-form-item label="Context Path" prop="contextPath">
109+
<el-input v-model="temp.contextPath" />
110+
</el-form-item>
103111
<el-form-item label="Describe" prop="describe">
104112
<el-input v-model="temp.describe" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="Please input" />
105113
</el-form-item>
@@ -153,6 +161,7 @@ export default {
153161
temp: {
154162
serviceName: '',
155163
serviceId: '',
164+
contextPath: '',
156165
describe: ''
157166
},
158167
dialogFormVisible: false,
@@ -208,6 +217,7 @@ export default {
208217
this.temp = {
209218
serviceId: '',
210219
serviceName: '',
220+
contextPath: '',
211221
describe: ''
212222
}
213223
},

0 commit comments

Comments
 (0)