From 67c2940e5ba691a080f5265276d4fa394c4cd7a5 Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 24 Jun 2020 00:26:10 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E5=88=A0=E9=99=A4=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B0=86=E8=87=AA=E5=8A=A8=E6=B8=85=E7=90=86?= =?UTF-8?q?=E5=85=B6=E5=85=B3=E8=81=94=E7=9A=84=E6=95=B0=E6=8D=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/app/views.py | 5 +++++ spug_web/src/pages/deploy/app/Table.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spug_api/apps/app/views.py b/spug_api/apps/app/views.py index 0de058d..bae4b5c 100644 --- a/spug_api/apps/app/views.py +++ b/spug_api/apps/app/views.py @@ -3,11 +3,14 @@ # Released under the AGPL-3.0 License. from django.views.generic import View from django.db.models import F +from django.conf import settings from libs import JsonParser, Argument, json_response from apps.app.models import App, Deploy, DeployExtend1, DeployExtend2 from apps.config.models import Config from apps.app.utils import parse_envs, fetch_versions, remove_repo +import subprocess import json +import os class AppView(View): @@ -145,6 +148,8 @@ class DeployView(View): ).parse(request.GET) if error is None: Deploy.objects.filter(pk=form.id).delete() + repo_dir = os.path.join(settings.REPOS_DIR, str(form.id)) + subprocess.Popen(f'rm -rf {repo_dir} {repo_dir + "_*"}', shell=True) return json_response(error=error) diff --git a/spug_web/src/pages/deploy/app/Table.js b/spug_web/src/pages/deploy/app/Table.js index 10e5a66..225a6b0 100644 --- a/spug_web/src/pages/deploy/app/Table.js +++ b/spug_web/src/pages/deploy/app/Table.js @@ -67,7 +67,7 @@ class ComTable extends React.Component { handleDeployDelete = (text) => { Modal.confirm({ title: '删除确认', - content: `确定要删除【${lds.get(envStore.idMap, `${text.env_id}.name`)}】的发布配置?`, + content: `删除发布配置将会影响基于该配置所创建发布申请的发布和回滚功能,确定要删除【${lds.get(envStore.idMap, `${text.env_id}.name`)}】的发布配置?`, onOk: () => { return http.delete('/api/app/deploy/', {params: {id: text.id}}) .then(() => {