|
@@ -16,7 +16,7 @@
|
|
|
</el-select>
|
|
</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-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-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-button size="mini" type="warning" icon="el-icon-upload" style="margin-left: 5px" @click="handleUpdate">更新</el-button>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-header>
|
|
</el-header>
|
|
@@ -229,7 +229,7 @@ export default {
|
|
|
username: 'root',
|
|
username: 'root',
|
|
|
password: '',
|
|
password: '',
|
|
|
privateKey: '',
|
|
privateKey: '',
|
|
|
- appDir: '/opt/app/devops-agent',
|
|
|
|
|
|
|
+ appDir: '/opt/app/devops',
|
|
|
remoteAgentConfig: null
|
|
remoteAgentConfig: null
|
|
|
},
|
|
},
|
|
|
// **********************************************************************
|
|
// **********************************************************************
|
|
@@ -264,22 +264,23 @@ export default {
|
|
|
this.getData()
|
|
this.getData()
|
|
|
},
|
|
},
|
|
|
handleAdd() {
|
|
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() {
|
|
onAdd() {
|
|
|
|
|
+ this.addForm.nodeType = this.queryInfo.nodeType
|
|
|
addRemoteHost(this.addForm).then(resp => {
|
|
addRemoteHost(this.addForm).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
this.getData()
|
|
this.getData()
|