|
103 | 103 | <el-dropdown-item @click.native="changeInstanceStatus(row, 'UNKNOWN')">UNKNOWN</el-dropdown-item>
|
104 | 104 | </el-dropdown-menu>
|
105 | 105 | </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> |
106 | 116 | </template>
|
107 | 117 | </el-table-column>
|
108 | 118 | </el-table>
|
|
147 | 157 | </div>
|
148 | 158 | </el-dialog>
|
149 | 159 |
|
| 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 | + |
150 | 172 | <el-dialog :visible.sync="dialogPvVisible" title="Reading statistics">
|
151 | 173 | <el-table :data="pvData" border fit highlight-current-row style="width: 100%">
|
152 | 174 | <el-table-column prop="key" label="Channel" />
|
|
161 | 183 |
|
162 | 184 | <script>
|
163 | 185 | import { fetchList, deleteInstance, createInstance, updateInstance, tryChangeInstanceStatus } from '@/api/gray-instance'
|
| 186 | +import { getServiceAllInfos, getAllDefinitions } from '@/api/gray-client' |
164 | 187 | import waves from '@/directive/waves' // waves directive
|
165 | 188 | import { parseTime } from '@/utils'
|
166 | 189 | import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
@@ -223,6 +246,13 @@ export default {
|
223 | 246 | grayLock: 0,
|
224 | 247 | des: ''
|
225 | 248 | },
|
| 249 | + grayInfo: { |
| 250 | + instanceId: '', |
| 251 | + type: '', |
| 252 | + content: '', |
| 253 | + dialogVisible: false, |
| 254 | + loading: false |
| 255 | + }, |
226 | 256 | dialogFormVisible: false,
|
227 | 257 | dialogStatus: '',
|
228 | 258 | textMap: {
|
@@ -407,6 +437,26 @@ export default {
|
407 | 437 | })
|
408 | 438 | })
|
409 | 439 | },
|
| 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 | + }, |
410 | 460 | handleDownload() {
|
411 | 461 | this.downloadLoading = true
|
412 | 462 | import('@/vendor/Export2Excel').then(excel => {
|
|
0 commit comments