mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
style: 修改重启面板及服务器按钮位置 (#4221)
This commit is contained in:
parent
cbfedb5d5e
commit
94028d97cf
@ -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:',
|
||||
|
@ -1266,7 +1266,7 @@ const message = {
|
||||
'即將回滾本次恢復,回滾將替換所有本次恢復的文件,過程中可能需要重啟 docker 以及 1panel 服務,是否繼續?',
|
||||
|
||||
upgrading: '正在升級中,請稍候...',
|
||||
upgradeHelper: '升級操作需要重啟服務,是否繼續?',
|
||||
upgradeHelper: '升級操作需要重啟 1Panel 服務,是否繼續?',
|
||||
noUpgrade: '當前已經是最新版本',
|
||||
versionHelper: '1Panel 版本號命名規則為: [大版本].[功能版本].[Bug 修復版本],例:',
|
||||
versionHelper1: 'v1.0.1 是 v1.0.0 之後的 Bug 修復版本',
|
||||
|
@ -1267,7 +1267,7 @@ const message = {
|
||||
'即将回滚本次恢复,回滚将替换所有本次恢复的文件,过程中可能需要重启 docker 以及 1panel 服务,是否继续?',
|
||||
|
||||
upgrading: '正在升级中,请稍候...',
|
||||
upgradeHelper: '升级操作需要重启服务,是否继续?',
|
||||
upgradeHelper: '升级操作需要重启 1Panel 服务,是否继续?',
|
||||
noUpgrade: '当前已经是最新版本',
|
||||
versionHelper: '1Panel 版本号命名规则为: [大版本].[功能版本].[Bug 修复版本],例:',
|
||||
versionHelper1: 'v1.0.1 是 v1.0.0 之后的 Bug 修复版本',
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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>
|
||||
|
@ -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 = [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user