Skip to content

Commit

Permalink
fix: restart panel after update
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 12, 2024
1 parent 0af6b22 commit 3893560
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/bootstrap/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

// 初始化时区
Expand Down
3 changes: 2 additions & 1 deletion internal/data/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion web/src/views/home/UpdateView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
Expand Down

0 comments on commit 3893560

Please sign in to comment.