From ee8000fbd853ff710c94bb0a5a7de6a3ebdb1560 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Mon, 5 Sep 2022 21:49:30 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=87=8D=E6=9E=84=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ptools/settings.py | 4 ---- templates/auto_pt/update.html | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/ptools/settings.py b/ptools/settings.py index 493b7cf..b61ff4b 100644 --- a/ptools/settings.py +++ b/ptools/settings.py @@ -207,10 +207,6 @@ SIMPLEUI_CONFIG = { 'name': '更新', 'icon': 'fas fa-code', 'models': [{ - 'name': '重启更新', - 'icon': 'far fa-surprise', - 'url': '/tasks/restart' - }, { 'name': '更新', 'icon': 'far fa-surprise', 'url': '/tasks/update' diff --git a/templates/auto_pt/update.html b/templates/auto_pt/update.html index 810ed57..b39b807 100644 --- a/templates/auto_pt/update.html +++ b/templates/auto_pt/update.html @@ -24,6 +24,7 @@ 重启更新 + 重启
@@ -110,6 +111,43 @@ } , methods: { + do_restart() { + this.$confirm('此操作将重启容器,并更新软件, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + axios.get( + "{% url "do_restart" %}" + ).then(res => { + if (res.data.code === 0) { + this.$message({ + type: 'success', + message: res.data.msg + }); + } else { + console.log(res) + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }).catch(res => { + this.$message({ + type: 'error', + message: "重启失败!" + }); + }) + + }).catch(res => { + {#console.log(res)#} + this.$message({ + type: 'info', + message: '已取消重启' + }); + }); + }, + do_update() { this.$confirm('此操作会拉取软件更新软件,并重启容器,是否继续?', '提示', { confirmButtonText: '确定',