Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions agent/init/dir/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}
11 changes: 11 additions & 0 deletions agent/init/hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ func Init() {
initGlobalData()
handleCronjobStatus()
handleSnapStatus()

loadLocalDir()
}

func initGlobalData() {
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion frontend/src/components/app-status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
:disabled="data.status === 'Installing'"
@click="onOperate('restart')"
>
{{ $t('app.restart') }}
{{ $t('commons.button.restart') }}
</el-button>
<el-divider direction="vertical" />
<el-button
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/backup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
</template>
</el-table-column>
<el-table-column :label="$t('database.source')" prop="backupType">
<el-table-column :label="$t('app.source')" prop="backupType">
<template #default="{ row }">
<span v-if="row.accountType === 'LOCAL'">
{{ $t('setting.LOCAL') }}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/container-log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</el-checkbox>
</div>
<el-button class="margin-button" @click="onDownload" icon="Download">
{{ $t('file.download') }}
{{ $t('commons.button.download') }}
</el-button>
<el-button class="margin-button" @click="onClean" icon="Delete">
{{ $t('commons.button.clean') }}
Expand Down Expand Up @@ -89,7 +89,7 @@ const visibleLogs = computed(() => {
});

const timeOptions = ref([
{ label: i18n.global.t('container.all'), value: 'all' },
{ label: i18n.global.t('commons.table.all'), value: 'all' },
{
label: i18n.global.t('container.lastDay'),
value: '24h',
Expand Down Expand Up @@ -148,7 +148,7 @@ const searchLogs = async () => {
const onDownload = async () => {
logSearch.tail = 0;
let msg = i18n.global.t('container.downLogHelper1', [logSearch.container]);
ElMessageBox.confirm(msg, i18n.global.t('file.download'), {
ElMessageBox.confirm(msg, i18n.global.t('commons.button.download'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
type: 'info',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/log-dialog/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<DrawerPro v-model="open" :header="$t('website.log')" size="large" :back="handleClose">
<DrawerPro v-model="open" :header="$t('commons.button.log')" size="large" :back="handleClose">
<LogFile :config="config" :height-diff="config.heightDiff"></LogFile>
</DrawerPro>
</template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/log-file/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
icon="Download"
:disabled="logs.length === 0"
>
{{ $t('file.download') }}
{{ $t('commons.button.download') }}
</el-button>
<span v-if="$slots.button" class="ml-2.5">
<slot name="button"></slot>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/task-list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Status :status="row.status" :msg="row.errorMsg" />
</template>
</el-table-column>
<el-table-column :label="$t('website.log')" prop="log">
<el-table-column :label="$t('commons.button.log')" prop="log">
<template #default="{ row }">
<el-button @click="openTaskLog(row)" link type="primary">
{{ $t('website.check') }}
Expand Down
Loading
Loading