服务重启&设备配置应用添加确认提示框

This commit is contained in:
wu
2022-08-23 14:50:01 +08:00
parent fd549832e6
commit f845494607
3 changed files with 44 additions and 21 deletions

View File

@@ -61,7 +61,7 @@
<el-button
class="header-button"
type="primary"
@click="setDeviceConfigure"
@click="setDeviceConfigureConfirm"
>应用</el-button
>
</div>
@@ -735,6 +735,20 @@ export default {
this.$set(this.devicePointData[index], "@Binding", row.nodeCode)
done();
},
setDeviceConfigureConfirm(){
this.$confirm('是否要应用该配置信息,更改配置后需要重启改服务才能使服务生效?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.setDeviceConfigure()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消应用服务配置'
});
});
},
async setDeviceConfigure() {
try {
// 验证表单

View File

@@ -320,23 +320,34 @@ export default {
})
done()
},
async setServerExec ({ row }) {
try {
await this.$api.SET_SERVER_EXEC({
action: 'exec',
server_id: row.id,
command: 'server_restart',
username: 'admin',
password: process.env.VUE_APP_HSLSERVER_PASSWORD
})
this.$message({
message: '服务应用请求成功,请求动作已添加至请求队列中,请从服务监控页面查看结果',
type: 'success'
})
this.getServers()
} catch (e) {
console.log(e)
}
setServerExec ({ row }) {
this.$confirm('是否要重启动该服务', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
try {
await this.$api.SET_SERVER_EXEC({
action: 'exec',
server_id: row.id,
command: 'server_restart'
})
this.$message({
message: '服务应用请求成功,请求动作已添加至请求队列中,请从服务监控页面查看结果',
type: 'success'
})
this.getServers()
} catch (e) {
console.log(e)
}
}).catch(() => {
this.$message({
type: 'info',
message: '已重启动该服务'
});
});
},
handleDialogCancel (done) {
this.$message({

View File

@@ -159,9 +159,7 @@ export default {
action: 'exec',
server_id: server.id,
command: command,
device_name: device.device_name,
username: 'admin',
password: process.env.VUE_APP_HSLSERVER_PASSWORD
device_name: device.device_name
})
this.$message({
message: '请求成功,请求动作已添加至请求队列中',