From f28d199f60381ed7972712436e2326a08365504c Mon Sep 17 00:00:00 2001 From: maslow Date: Fri, 3 Sep 2021 19:52:17 +0800 Subject: [PATCH] feat(system-client): impl app service start & stop; --- packages/system-client/src/api/application.js | 58 ++++++ .../src/views/application/index.vue | 174 ++++++++++++++++-- 2 files changed, 217 insertions(+), 15 deletions(-) diff --git a/packages/system-client/src/api/application.js b/packages/system-client/src/api/application.js index 92da0d02bb..b30b42b51a 100644 --- a/packages/system-client/src/api/application.js +++ b/packages/system-client/src/api/application.js @@ -24,3 +24,61 @@ export async function getApplicationByAppid(appid) { return res } + +/** + * 创建应用 + * @param param0 + * @returns + */ +export async function createApplication({ name }) { + const res = await request({ + url: `/apps/create`, + method: 'post', + data: { + name + } + }) + return res +} + +/** + * 编辑应用 + * @param param0 + * @returns + */ +export async function updateApplication(appid, { name }) { + const res = await request({ + url: `/apps/${appid}`, + method: 'post', + data: { + name + } + }) + return res +} + +/** + * 启动应用服务 + * @param {*} appid + * @returns + */ +export async function startApplication(appid) { + const res = await request({ + url: `/apps/${appid}/start`, + method: 'post' + }) + return res +} + +/** + * 停止应用服务 + * @param {*} appid + * @returns + */ +export async function stopApplication(appid) { + const res = await request({ + url: `/apps/${appid}/stop`, + method: 'post' + }) + return res +} diff --git a/packages/system-client/src/views/application/index.vue b/packages/system-client/src/views/application/index.vue index 23fefc8be3..f43c6dbb0a 100644 --- a/packages/system-client/src/views/application/index.vue +++ b/packages/system-client/src/views/application/index.vue @@ -4,7 +4,7 @@ 刷新 - + 新建 @@ -13,7 +13,7 @@ @@ -22,20 +22,23 @@ {{ scope.row.name }} - - - - + + + +