mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
feat: 概览页增加未启用安全入口提示信息
This commit is contained in:
parent
a06e5f28b3
commit
17dd07fe32
@ -221,6 +221,8 @@ const message = {
|
||||
},
|
||||
home: {
|
||||
overview: 'Overview',
|
||||
entranceHelper:
|
||||
'Enabling a secure entrance can help improve system security. If necessary, go to the Control Panel settings, select Security, and enable the secure entrance.',
|
||||
appInstalled: 'App installed',
|
||||
systemInfo: 'System info',
|
||||
hostname: 'Hostname',
|
||||
|
@ -224,6 +224,7 @@ const message = {
|
||||
},
|
||||
home: {
|
||||
overview: '概览',
|
||||
entranceHelper: '设置安全入口有利于提高系统的安全性,如有需要,前往 面板设置-安全 中,启用安全入口',
|
||||
appInstalled: '已安装应用',
|
||||
systemInfo: '系统信息',
|
||||
hostname: '主机名称',
|
||||
|
@ -8,6 +8,22 @@
|
||||
},
|
||||
]"
|
||||
/>
|
||||
<el-alert v-if="!isSafety" :closable="false" style="margin-top: 20px" type="warning">
|
||||
<template #default>
|
||||
<span>
|
||||
<span>{{ $t('home.entranceHelper') }}</span>
|
||||
<el-link
|
||||
style="font-size: 12px; margin-left: 5px"
|
||||
icon="Position"
|
||||
@click="goRouter('/settings/safe')"
|
||||
type="primary"
|
||||
>
|
||||
{{ $t('firewall.quickJump') }}
|
||||
</el-link>
|
||||
</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<el-row :gutter="20" style="margin-top: 20px">
|
||||
<el-col :span="16">
|
||||
<CardWithHeader :header="$t('home.overview')" height="146px">
|
||||
@ -109,7 +125,7 @@
|
||||
|
||||
<div v-if="chartOption === 'io'" style="margin-top: 40px">
|
||||
<v-charts
|
||||
height="300px"
|
||||
height="305px"
|
||||
id="ioChart"
|
||||
type="line"
|
||||
:option="chartsOption['ioChart']"
|
||||
@ -119,7 +135,7 @@
|
||||
</div>
|
||||
<div v-if="chartOption === 'network'" style="margin-top: 40px">
|
||||
<v-charts
|
||||
height="300px"
|
||||
height="305px"
|
||||
id="networkChart"
|
||||
type="line"
|
||||
:option="chartsOption['networkChart']"
|
||||
@ -210,7 +226,7 @@ import { useRouter } from 'vue-router';
|
||||
import RouterButton from '@/components/router-button/index.vue';
|
||||
import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard';
|
||||
import { getIOOptions, getNetworkOptions } from '@/api/modules/monitor';
|
||||
import { loadUpgradeInfo } from '@/api/modules/setting';
|
||||
import { getSettingInfo, loadUpgradeInfo } from '@/api/modules/setting';
|
||||
import { GlobalStore } from '@/store';
|
||||
const router = useRouter();
|
||||
const globalStore = GlobalStore();
|
||||
@ -218,6 +234,8 @@ const globalStore = GlobalStore();
|
||||
const statuRef = ref();
|
||||
const appRef = ref();
|
||||
|
||||
const isSafety = ref();
|
||||
|
||||
const chartOption = ref('network');
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
let isInit = ref<boolean>(true);
|
||||
@ -482,7 +500,13 @@ const loadUpgradeStatus = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const loadSafeStatus = async () => {
|
||||
const res = await getSettingInfo();
|
||||
isSafety.value = res.data.securityEntranceStatus === 'enable';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadSafeStatus();
|
||||
loadUpgradeStatus();
|
||||
onLoadNetworkOptions();
|
||||
onLoadIOOptions();
|
||||
|
@ -183,6 +183,12 @@ const loadDetail = (log: string) => {
|
||||
if (log.indexOf('[SessionTimeout]') !== -1) {
|
||||
return log.replace('[SessionTimeout]', '[' + i18n.global.t('setting.sessionTimeout') + ']');
|
||||
}
|
||||
if (log.indexOf('SecurityEntranceStatus') !== -1) {
|
||||
return log.replace('[SecurityEntranceStatus]', '[' + i18n.global.t('setting.entrance') + ']');
|
||||
}
|
||||
if (log.indexOf('SecurityEntrance') !== -1) {
|
||||
return log.replace('[SecurityEntrance]', '[' + i18n.global.t('setting.entrance') + ']');
|
||||
}
|
||||
if (log.indexOf('[ExpirationDays]') !== -1) {
|
||||
return log.replace('[ExpirationDays]', '[' + i18n.global.t('setting.expirationTime') + ']');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user