diff --git a/agent/init/dir/dir.go b/agent/init/dir/dir.go index ca8820f36..773a892b9 100644 --- a/agent/init/dir/dir.go +++ b/agent/init/dir/dir.go @@ -3,8 +3,6 @@ package dir import ( "path" - "github.com/1Panel-dev/1Panel/agent/app/model" - "github.com/1Panel-dev/1Panel/agent/constant" "github.com/1Panel-dev/1Panel/agent/global" "github.com/1Panel-dev/1Panel/agent/utils/files" ) @@ -30,15 +28,4 @@ func Init() { global.Dir.RuntimeDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/runtime")) global.Dir.RecycleBinDir, _ = fileOp.CreateDirWithPath(true, "/.1panel_clash") global.Dir.SSLLogDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/log/ssl")) - - //loadLocalDir() -} - -func loadLocalDir() { - var account model.BackupAccount - if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil { - global.LOG.Errorf("load local backup account info failed, err: %v", err) - return - } - global.Dir.LocalBackupDir = account.BackupPath } diff --git a/agent/init/hook/hook.go b/agent/init/hook/hook.go index 7bb58918a..8f826553c 100644 --- a/agent/init/hook/hook.go +++ b/agent/init/hook/hook.go @@ -17,6 +17,8 @@ func Init() { initGlobalData() handleCronjobStatus() handleSnapStatus() + + loadLocalDir() } func initGlobalData() { @@ -92,3 +94,12 @@ func handleCronJobAlert(cronjob *model.Cronjob) { return } } + +func loadLocalDir() { + var account model.BackupAccount + if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil { + global.LOG.Errorf("load local backup account info failed, err: %v", err) + return + } + global.Dir.LocalBackupDir = account.BackupPath +} diff --git a/frontend/src/components/app-status/index.vue b/frontend/src/components/app-status/index.vue index 4f2daf9ff..080d9320e 100644 --- a/frontend/src/components/app-status/index.vue +++ b/frontend/src/components/app-status/index.vue @@ -28,7 +28,7 @@ :disabled="data.status === 'Installing'" @click="onOperate('restart')" > - {{ $t('app.restart') }} + {{ $t('commons.button.restart') }} - + - +