From 63eb96667709e1d5bd8534582b4dd118d81b65ad Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Mon, 7 Mar 2022 08:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mnt/deploy.js | 77 ++++++++++++++++++++++++++++++ src/views/dashboard/AgencyData.vue | 2 +- src/views/home.vue | 12 +++-- 3 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 src/api/mnt/deploy.js diff --git a/src/api/mnt/deploy.js b/src/api/mnt/deploy.js new file mode 100644 index 0000000..c1475ea --- /dev/null +++ b/src/api/mnt/deploy.js @@ -0,0 +1,77 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/deploy', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/deploy', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/deploy', + method: 'put', + data + }) +} + +export function getApps() { + return request({ + url: 'api/app', + method: 'get' + }) +} + +export function getServers() { + return request({ + url: 'api/serverDeploy', + method: 'get' + }) +} + +/** + * 启动服务 + * @param data 选中行 + */ +export function startServer(data) { + return request({ + url: 'api/deploy/startServer', + method: 'post', + data + }) +} + +/** + * 停止服务 + * @param data 选中行 + */ +export function stopServer(data) { + return request({ + url: 'api/deploy/stopServer', + method: 'post', + data + }) +} + +/** + * 停止服务 + * @param data 选中行 + */ +export function serverStatus(data) { + return request({ + url: 'api/deploy/serverStatus', + method: 'post', + data + }) +} + +export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps } diff --git a/src/views/dashboard/AgencyData.vue b/src/views/dashboard/AgencyData.vue index f1f0c9a..d8cac2f 100644 --- a/src/views/dashboard/AgencyData.vue +++ b/src/views/dashboard/AgencyData.vue @@ -52,7 +52,7 @@ export default {