Przeglądaj źródła

AppStat.vue 页面添加一个"刷新"按钮

reghao 2 miesięcy temu
rodzic
commit
ed00faaa8a
2 zmienionych plików z 13 dodań i 13 usunięć
  1. 1 1
      src/api/devops.js
  2. 12 12
      src/views/devops/app/AppStat.vue

+ 1 - 1
src/api/devops.js

@@ -345,7 +345,7 @@ export function getAppStatList(queryInfo) {
   return get(devopsApi.getAppStatList, queryInfo)
 }
 
-export function getAppStatDeatil(appId) {
+export function getAppStatDetail(appId) {
   return get(devopsApi.getAppStatList + '/detail?appId=' + appId)
 }
 

+ 12 - 12
src/views/devops/app/AppStat.vue

@@ -100,6 +100,7 @@
       center
     >
       <template>
+        <el-button type="text" style="margin: 5px" @click="onRefresh">刷新</el-button>
         <el-table
           :data="appStatList"
           border
@@ -185,7 +186,7 @@
 <script>
 import {
   getAppStat,
-  getAppStatDeatil,
+  getAppStatDetail,
   getAppStatList,
   getEnvList,
   restartAppStat,
@@ -210,18 +211,10 @@ export default {
       totalSize: 0,
       dataList: [],
       // **********************************************************************
-      videoProp: null,
-      showVideoResourceDialog: false,
-      showEditScopeDialog: false,
       statDialogTitle: '',
       showStatDialog: false,
       appStatList: [],
-      form: {
-        videoId: null,
-        scope: 1
-      },
-      videoResources: [],
-      publishVideoDiaglog: false
+      statAppId: ''
     }
   },
   created() {
@@ -281,11 +274,18 @@ export default {
         this.$message.error(error.message)
       })
     },
+    onRefresh() {
+      this.getAppStatDetailWrapper(this.statAppId)
+    },
     handleDetail(index, row) {
-      getAppStatDeatil(row.appId).then(resp => {
+      this.statAppId = row.appId
+      this.getAppStatDetailWrapper(this.statAppId)
+    },
+    getAppStatDetailWrapper(appId) {
+      getAppStatDetail(appId).then(resp => {
         if (resp.code === 0) {
           this.appStatList = resp.data
-          this.statDialogTitle = row.appId + ' 的应用状态列表'
+          this.statDialogTitle = appId + ' 的应用状态列表'
           this.showStatDialog = true
         } else {
           this.$message.error(resp.msg)