Parcourir la source

更新 SysUpdate.vue

reghao il y a 2 mois
Parent
commit
3030e4419b
1 fichiers modifiés avec 16 ajouts et 15 suppressions
  1. 16 15
      src/views/devops/sys/SysUpdate.vue

+ 16 - 15
src/views/devops/sys/SysUpdate.vue

@@ -16,7 +16,7 @@
         </el-select>
         <el-button size="mini" type="warning" icon="el-icon-files" style="margin-left: 5px" @click="handleAgentConfig">agent 节点配置列表</el-button>
         <el-button size="mini" type="warning" icon="el-icon-refresh" style="margin-left: 5px" @click="getData">刷新</el-button>
-        <el-button size="mini" type="warning" icon="el-icon-plus" style="margin-left: 5px" @click="handleAdd">添加</el-button>
+        <el-button size="mini" type="warning" icon="el-icon-plus" style="margin-left: 5px" @click="handleAdd">添加节点</el-button>
         <el-button size="mini" type="warning" icon="el-icon-upload" style="margin-left: 5px" @click="handleUpdate">更新</el-button>
       </el-row>
     </el-header>
@@ -229,7 +229,7 @@ export default {
         username: 'root',
         password: '',
         privateKey: '',
-        appDir: '/opt/app/devops-agent',
+        appDir: '/opt/app/devops',
         remoteAgentConfig: null
       },
       // **********************************************************************
@@ -264,22 +264,23 @@ export default {
       this.getData()
     },
     handleAdd() {
-      if (this.queryInfo.nodeType === 'mgr') {
-        this.$message.warning('mgr 节点无配置可查看')
-        return
+      if (this.queryInfo.nodeType === 'agent') {
+        getAgentConfigList(this.queryInfo).then(resp => {
+          if (resp.code === 0) {
+            this.agentConfigList = resp.data
+            this.showAddDialog = true
+          } else {
+            this.$message.warning(resp.msg)
+          }
+        }).catch(error => {
+          this.$message.error(error.message)
+        })
+      } else {
+        this.showAddDialog = true
       }
-      getAgentConfigList(this.queryInfo).then(resp => {
-        if (resp.code === 0) {
-          this.agentConfigList = resp.data
-          this.showAddDialog = true
-        } else {
-          this.$message.warning(resp.msg)
-        }
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
     },
     onAdd() {
+      this.addForm.nodeType = this.queryInfo.nodeType
       addRemoteHost(this.addForm).then(resp => {
         if (resp.code === 0) {
           this.getData()