|
|
@ -1,8 +1,16 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<SearchTemplate> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" class="reset-button-style" @click="getList">刷新</el-button> |
|
|
|
<el-button icon="el-icon-plus" class="add-button-style" @click="handleAdd">新增</el-button> |
|
|
|
<el-button |
|
|
|
icon="el-icon-refresh" |
|
|
|
size="mini" |
|
|
|
class="reset-button-style" |
|
|
|
@click="getList" |
|
|
|
>刷新</el-button |
|
|
|
> |
|
|
|
<el-button icon="el-icon-plus" class="add-button-style" @click="handleAdd" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
</SearchTemplate> |
|
|
|
<!-- 页面主题容器 --> |
|
|
|
<ContentContainer> |
|
|
@ -74,13 +82,18 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<AddOrEdit v-if="isShowDialog" :item="item" :isShowDialog="isShowDialog" @editCallBack="completeCallBack"/> |
|
|
|
<AddOrEdit |
|
|
|
v-if="isShowDialog" |
|
|
|
:item="item" |
|
|
|
:isShowDialog="isShowDialog" |
|
|
|
@editCallBack="completeCallBack" |
|
|
|
/> |
|
|
|
</ContentContainer> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import SearchTemplate from "../../components/SearchTemplate.vue" |
|
|
|
import SearchTemplate from "../../components/SearchTemplate.vue"; |
|
|
|
import ContentContainer from "../../components/ContentContainer.vue"; |
|
|
|
import { ListMixin } from "@/mixins/ListMixin"; |
|
|
|
import AddOrEdit from "./AddOrEdit.vue"; |
|
|
@ -107,7 +120,7 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.pagination.path='/services'; |
|
|
|
this.pagination.path = "/services"; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// status对应中文 |
|
|
@ -117,68 +130,68 @@ export default { |
|
|
|
}, |
|
|
|
// 显示添加界面 |
|
|
|
handleAdd() { |
|
|
|
this.changeDialogStatus('add'); |
|
|
|
this.changeDialogStatus("add"); |
|
|
|
}, |
|
|
|
// 启动服务 |
|
|
|
cmdStart(item) { |
|
|
|
this.loading=true, |
|
|
|
get('/v1/keys/cmd', { |
|
|
|
cmd:'start', |
|
|
|
service_path:item.service_path |
|
|
|
}).then(({code, data})=>{ |
|
|
|
this.loading=false; |
|
|
|
if(code==200){ |
|
|
|
this.msgSuccess("启动成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}) |
|
|
|
(this.loading = true), |
|
|
|
get("/v1/keys/cmd", { |
|
|
|
cmd: "start", |
|
|
|
service_path: item.service_path, |
|
|
|
}).then(({ code }) => { |
|
|
|
this.loading = false; |
|
|
|
if (code == 200) { |
|
|
|
this.msgSuccess("启动成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 暂停服务 |
|
|
|
cmdPause(item){ |
|
|
|
this.loading=true, |
|
|
|
get('/v1/keys/cmd', { |
|
|
|
cmd:'pause', |
|
|
|
service_path:item.service_path |
|
|
|
}).then(({code, data})=>{ |
|
|
|
this.loading=false; |
|
|
|
if(code==200){ |
|
|
|
this.msgSuccess("暂停成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}) |
|
|
|
cmdPause(item) { |
|
|
|
(this.loading = true), |
|
|
|
get("/v1/keys/cmd", { |
|
|
|
cmd: "pause", |
|
|
|
service_path: item.service_path, |
|
|
|
}).then(({ code }) => { |
|
|
|
this.loading = false; |
|
|
|
if (code == 200) { |
|
|
|
this.msgSuccess("暂停成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 恢复服务 |
|
|
|
cmdRecover(item){ |
|
|
|
this.loading=true, |
|
|
|
get('/v1/keys/cmd', { |
|
|
|
cmd:'recover', |
|
|
|
service_path:item.service_path |
|
|
|
}).then(({code, data})=>{ |
|
|
|
this.loading=false; |
|
|
|
if(code==200){ |
|
|
|
this.msgSuccess("恢复成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}) |
|
|
|
cmdRecover(item) { |
|
|
|
(this.loading = true), |
|
|
|
get("/v1/keys/cmd", { |
|
|
|
cmd: "recover", |
|
|
|
service_path: item.service_path, |
|
|
|
}).then(({ code }) => { |
|
|
|
this.loading = false; |
|
|
|
if (code == 200) { |
|
|
|
this.msgSuccess("恢复成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 停止服务 |
|
|
|
cmdStop(item){ |
|
|
|
this.loading=true, |
|
|
|
get('/v1/keys/cmd', { |
|
|
|
cmd:'stop', |
|
|
|
service_path:item.service_path |
|
|
|
}).then(({code, data})=>{ |
|
|
|
this.loading=false; |
|
|
|
if(code==200){ |
|
|
|
this.msgSuccess("停止成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}) |
|
|
|
cmdStop(item) { |
|
|
|
(this.loading = true), |
|
|
|
get("/v1/keys/cmd", { |
|
|
|
cmd: "stop", |
|
|
|
service_path: item.service_path, |
|
|
|
}).then(({ code }) => { |
|
|
|
this.loading = false; |
|
|
|
if (code == 200) { |
|
|
|
this.msgSuccess("停止成功,请稍后刷新列表数据"); |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 删除按钮操作 |
|
|
|
handleDelete(row) { |
|
|
|
this.delHanle('/v1/keys', {service_path: row.service_path}) |
|
|
|
} |
|
|
|
handleDelete(row) { |
|
|
|
this.delHanle("/v1/keys", { service_path: row.service_path }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |