|
|
@@ -2,6 +2,7 @@
|
|
|
<el-container>
|
|
|
<el-header height="220">
|
|
|
<h3>SpringCloud 服务</h3>
|
|
|
+ <el-button icon="el-icon-refresh" class="btn-reset" @click="onRefresh">刷新</el-button>
|
|
|
</el-header>
|
|
|
<el-main>
|
|
|
<el-table
|
|
|
@@ -15,24 +16,16 @@
|
|
|
type="index"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="instanceId"
|
|
|
- label="实例 ID"
|
|
|
+ prop="serviceName"
|
|
|
+ label="服务名"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="appName"
|
|
|
- label="应用"
|
|
|
+ prop="healthyCount"
|
|
|
+ label="健康实例"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="hostPort"
|
|
|
- label="节点地址"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="lastUpdateTime"
|
|
|
- label="最近更新"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="lastDirtyTime"
|
|
|
- label="最近脏数据"
|
|
|
+ prop="unhealthyCount"
|
|
|
+ label="不健康实例"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
@@ -42,13 +35,8 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- @click="handleEdit(scope.$index, scope.row)"
|
|
|
- >编辑</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
- >删除</el-button>
|
|
|
+ @click="handleEdit(scope.row)"
|
|
|
+ >详情</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -56,19 +44,38 @@
|
|
|
|
|
|
<el-dialog
|
|
|
append-to-body
|
|
|
- :visible.sync="showServiceDialog"
|
|
|
+ :title="dialogTitle"
|
|
|
+ :visible.sync="showInstanceDialog"
|
|
|
+ :before-close="handleClose"
|
|
|
width="70%"
|
|
|
center
|
|
|
>
|
|
|
+ <template>
|
|
|
+ <el-table
|
|
|
+ :data="serviceList"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ fixed="left"
|
|
|
+ label="No"
|
|
|
+ type="index"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="instanceAddr"
|
|
|
+ label="实例地址"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getSpringCloudList } from '@/api/tnb'
|
|
|
+import { getSpringCloudInstances, getSpringCloudServices } from '@/api/tnb'
|
|
|
|
|
|
export default {
|
|
|
- name: 'AdminSpringCloudService',
|
|
|
+ name: 'AdminSpringCloud',
|
|
|
data() {
|
|
|
return {
|
|
|
queryInfo: {
|
|
|
@@ -84,7 +91,8 @@ export default {
|
|
|
nextId: 0,
|
|
|
serviceList: [],
|
|
|
// **********************************************************************
|
|
|
- showServiceDialog: false,
|
|
|
+ dialogTitle: null,
|
|
|
+ showInstanceDialog: false,
|
|
|
form: {
|
|
|
videoId: null,
|
|
|
scope: 1
|
|
|
@@ -97,7 +105,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
- getSpringCloudList().then(resp => {
|
|
|
+ this.dataList = []
|
|
|
+ getSpringCloudServices().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
this.dataList = resp.data
|
|
|
} else {
|
|
|
@@ -114,30 +123,23 @@ export default {
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
},
|
|
|
- handleEdit(index, row) {
|
|
|
- this.$message.info('handleEdit')
|
|
|
- },
|
|
|
- handleDelete(index, row) {
|
|
|
- this.$confirm('确定要删除 ' + row.title + '?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$message.info('handleDelete')
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消'
|
|
|
- })
|
|
|
+ handleEdit(row) {
|
|
|
+ const queryParams = {}
|
|
|
+ queryParams.serviceName = row.serviceName
|
|
|
+ getSpringCloudInstances(queryParams).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.serviceList = resp.data
|
|
|
+ this.dialogTitle = row.serviceName
|
|
|
+ this.showInstanceDialog = true
|
|
|
+ console.log(this.serviceList)
|
|
|
+ } else {
|
|
|
+ this.$message.warning(resp.msg)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
- onUpdateScope() {
|
|
|
- this.showServiceDialog = false
|
|
|
- },
|
|
|
- onSelectChange() {
|
|
|
- this.$message.info(this.queryInfo)
|
|
|
- },
|
|
|
handleClose() {
|
|
|
+ this.showInstanceDialog = false
|
|
|
+ this.serviceList = []
|
|
|
}
|
|
|
}
|
|
|
}
|