style: 修改重启面板及服务器按钮位置 (#4221)

This commit is contained in:
ssongliu 2024-03-18 17:34:08 +08:00 committed by GitHub
parent cbfedb5d5e
commit 94028d97cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 47 additions and 42 deletions

View file

@ -1426,7 +1426,7 @@ const message = {
rollbackHelper:
'This recovery is about to be rolled back, which will replace all the files recovered this time. In the process, docker and 1panel services may need to be restarted. Do you want to continue?',
upgradeHelper: 'The upgrade requires a service restart. Do you want to continue?',
upgradeHelper: 'The upgrade requires restarting the 1Panel service. Do you want to continue?',
noUpgrade: 'It is currently the latest version',
versionHelper:
'Name rules: [major version].[functional version].[Bug fix version], as shown in the following example:',

View file

@ -1266,7 +1266,7 @@ const message = {
'即將回滾本次恢復回滾將替換所有本次恢復的文件過程中可能需要重啟 docker 以及 1panel 服務是否繼續',
upgrading: '正在升級中請稍候...',
upgradeHelper: '升級操作需要重啟服務是否繼續',
upgradeHelper: '升級操作需要重啟 1Panel 服務是否繼續',
noUpgrade: '當前已經是最新版本',
versionHelper: '1Panel 版本號命名規則為 [大版本].[功能版本].[Bug 修復版本]',
versionHelper1: 'v1.0.1 v1.0.0 之後的 Bug 修復版本',

View file

@ -1267,7 +1267,7 @@ const message = {
'即将回滚本次恢复回滚将替换所有本次恢复的文件过程中可能需要重启 docker 以及 1panel 服务是否继续',
upgrading: '正在升级中请稍候...',
upgradeHelper: '升级操作需要重启服务是否继续',
upgradeHelper: '升级操作需要重启 1Panel 服务是否继续',
noUpgrade: '当前已经是最新版本',
versionHelper: '1Panel 版本号命名规则为 [大版本].[功能版本].[Bug 修复版本]',
versionHelper1: 'v1.0.1 v1.0.0 之后的 Bug 修复版本',

View file

@ -7,19 +7,7 @@
path: '/',
},
]"
>
<template #route-button>
<div class="router-button">
<el-button link type="primary" @click="onRestart('1panel')">
{{ $t('home.restart_1panel') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onRestart('system')">
{{ $t('home.restart_system') }}
</el-button>
</div>
</template>
</RouterButton>
/>
<el-alert
v-if="!isSafety && globalStore.showEntranceWarn"
style="margin-top: 20px"
@ -230,13 +218,10 @@
</CardWithHeader>
</el-col>
</el-row>
<ConfirmDialog ref="confirmDialogRef" @confirm="onSave"></ConfirmDialog>
</div>
</template>
<script lang="ts" setup>
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { onMounted, onBeforeUnmount, ref, reactive } from 'vue';
import Status from '@/views/home/status/index.vue';
import App from '@/views/home/app/index.vue';
@ -246,17 +231,14 @@ import i18n from '@/lang';
import { Dashboard } from '@/api/interface/dashboard';
import { dateFormatForSecond, computeSize } from '@/utils/util';
import { useRouter } from 'vue-router';
import { loadBaseInfo, loadCurrentInfo, systemRestart } from '@/api/modules/dashboard';
import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard';
import { getIOOptions, getNetworkOptions } from '@/api/modules/monitor';
import { getSettingInfo, loadUpgradeInfo } from '@/api/modules/setting';
import { GlobalStore } from '@/store';
import { MsgSuccess } from '@/utils/message';
const router = useRouter();
const globalStore = GlobalStore();
const statusRef = ref();
const restartType = ref();
const confirmDialogRef = ref();
const appRef = ref();
const isSafety = ref();
@ -549,21 +531,6 @@ const loadSafeStatus = async () => {
isSafety.value = res.data.securityEntrance;
};
const onRestart = (type: string) => {
restartType.value = type;
let params = {
header: i18n.global.t('home.restart_' + type),
operationInfo: '',
submitInputInfo: i18n.global.t('database.restartNow'),
};
confirmDialogRef.value!.acceptParams(params);
};
const onSave = async () => {
globalStore.isOnRestart = true;
MsgSuccess(i18n.global.t('home.operationSuccess'));
await systemRestart(restartType.value);
};
const onFocus = () => {
isActive.value = true;
};

View file

@ -7,12 +7,12 @@
<el-button type="primary" @click="onCreate()">
{{ $t('setting.createSnapshot') }}
</el-button>
<el-button type="primary" plain @click="onIgnore()">
{{ $t('setting.ignoreRule') }}
</el-button>
<el-button type="primary" plain @click="onImport()">
{{ $t('setting.importSnapshot') }}
</el-button>
<el-button type="primary" plain @click="onIgnore()">
{{ $t('setting.ignoreRule') }}
</el-button>
<el-button type="primary" plain :disabled="selects.length === 0" @click="batchDelete(null)">
{{ $t('commons.button.delete') }}
</el-button>

View file

@ -1,14 +1,52 @@
<template>
<div>
<RouterButton :buttons="buttons" />
<RouterButton :buttons="buttons">
<template #route-button>
<div class="router-button">
<el-button link type="primary" @click="onRestart('1panel')">
{{ $t('home.restart_1panel') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onRestart('system')">
{{ $t('home.restart_system') }}
</el-button>
</div>
</template>
</RouterButton>
<LayoutContent>
<router-view></router-view>
</LayoutContent>
<ConfirmDialog ref="confirmDialogRef" @confirm="onSave"></ConfirmDialog>
</div>
</template>
<script lang="ts" setup>
import i18n from '@/lang';
import { ref } from 'vue';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { GlobalStore } from '@/store';
import { MsgSuccess } from '@/utils/message';
import { systemRestart } from '@/api/modules/dashboard';
const restartType = ref();
const confirmDialogRef = ref();
const globalStore = GlobalStore();
const onRestart = (type: string) => {
restartType.value = type;
let params = {
header: i18n.global.t('home.restart_' + type),
operationInfo: '',
submitInputInfo: i18n.global.t('database.restartNow'),
};
confirmDialogRef.value!.acceptParams(params);
};
const onSave = async () => {
globalStore.isOnRestart = true;
MsgSuccess(i18n.global.t('home.operationSuccess'));
await systemRestart(restartType.value);
};
const buttons = [
{