From 38935607d6b6e2155e8553ef166ae7458d30e832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 13 Oct 2024 01:41:21 +0800 Subject: [PATCH] fix: restart panel after update --- internal/bootstrap/conf.go | 2 +- internal/data/setting.go | 3 ++- web/src/views/home/UpdateView.vue | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/bootstrap/conf.go b/internal/bootstrap/conf.go index 44c5b6de09..0dfbe80754 100644 --- a/internal/bootstrap/conf.go +++ b/internal/bootstrap/conf.go @@ -26,7 +26,7 @@ func initConf() { func initGlobal() { app.Root = app.Conf.MustString("app.root") - app.Version = "2.3.0" + app.Version = "2.3.2" app.Locale = app.Conf.MustString("app.locale") // 初始化时区 diff --git a/internal/data/setting.go b/internal/data/setting.go index a9e60757c1..d8dc3a5613 100644 --- a/internal/data/setting.go +++ b/internal/data/setting.go @@ -18,6 +18,7 @@ import ( "github.com/TheTNB/panel/internal/http/request" "github.com/TheTNB/panel/pkg/io" "github.com/TheTNB/panel/pkg/shell" + "github.com/TheTNB/panel/pkg/tools" "github.com/TheTNB/panel/pkg/types" ) @@ -280,9 +281,9 @@ func (r *settingRepo) UpdatePanel(version, url, checksum string) error { color.Greenln("升级完成") _, _ = shell.Execf("systemctl daemon-reload") - _, _ = shell.Execf("systemctl restart panel") _ = io.Remove("/tmp/panel-storage.zip") _ = io.Remove(filepath.Join(app.Root, "panel/config.example.yml")) + tools.RestartPanel() return nil } diff --git a/web/src/views/home/UpdateView.vue b/web/src/views/home/UpdateView.vue index c2faafc419..1f1c5a4f83 100644 --- a/web/src/views/home/UpdateView.vue +++ b/web/src/views/home/UpdateView.vue @@ -14,7 +14,7 @@ let messageReactive: MessageReactive | null = null const getVersions = () => { info.updateInfo().then((res: any) => { - versions.value = res.data.reverse() + versions.value = res.data }) }