diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 8446ccd31..8a13f51f3 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -842,7 +842,7 @@ export default { issue: 'Feedback', doc: 'Official document', star: 'Star', - description: '1Panel, A modern open source Linux panel.', + description: '1Panel, Modern, open source Linux server operation and maintenance management panel.', }, app: { app: 'Application', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 6be3fda32..f092710ea 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -847,7 +847,7 @@ export default { issue: '问题反馈', doc: '官方文档', star: '点亮 Star', - description: '1Panel,一款现代化的开源 Linux 面板。', + description: '1Panel,现代化、开源的 Linux 服务器运维管理面板。', }, app: { app: '应用', diff --git a/frontend/src/views/log/operation/index.vue b/frontend/src/views/log/operation/index.vue index f8a21f6d3..0e4b76ff2 100644 --- a/frontend/src/views/log/operation/index.vue +++ b/frontend/src/views/log/operation/index.vue @@ -132,6 +132,11 @@ const search = async () => { .then((res) => { loading.value = false; data.value = res.data.items; + if (globalStore.language === 'zh') { + for (const item of data.value) { + item.detailZH = loadDetail(item.detailZH); + } + } paginationConfig.total = res.data.total; }) .catch(() => { @@ -148,6 +153,58 @@ const onClean = async () => { confirmDialogRef.value!.acceptParams(params); }; +const loadDetail = (log: string) => { + if (log.indexOf('[enable]') !== -1) { + log = log.replace('[enable]', '[' + i18n.global.t('commons.button.enable') + ']'); + } + if (log.indexOf('[disable]') !== -1) { + log = log.replace('[disable]', '[' + i18n.global.t('commons.button.disable') + ']'); + } + if (log.indexOf('[light]') !== -1) { + log = log.replace('[light]', '[' + i18n.global.t('setting.light') + ']'); + } + if (log.indexOf('[dark]') !== -1) { + log = log.replace('[dark]', '[' + i18n.global.t('setting.dark') + ']'); + } + if (log.indexOf('[UserName]') !== -1) { + return log.replace('[UserName]', '[' + i18n.global.t('setting.user') + ']'); + } + if (log.indexOf('[PanelName]') !== -1) { + return log.replace('[PanelName]', '[' + i18n.global.t('setting.title') + ']'); + } + if (log.indexOf('[Language]') !== -1) { + return log.replace('[Language]', '[' + i18n.global.t('setting.language') + ']'); + } + if (log.indexOf('[Theme]') !== -1) { + return log.replace('[Theme]', '[' + i18n.global.t('setting.theme') + ']'); + } + if (log.indexOf('[SessionTimeout]') !== -1) { + return log.replace('[SessionTimeout]', '[' + i18n.global.t('setting.sessionTimeout') + ']'); + } + if (log.indexOf('[ExpirationDays]') !== -1) { + return log.replace('[ExpirationDays]', '[' + i18n.global.t('setting.expirationTime') + ']'); + } + if (log.indexOf('[ComplexityVerification]') !== -1) { + return log.replace('[ComplexityVerification]', '[' + i18n.global.t('setting.complexity') + ']'); + } + if (log.indexOf('[MFAStatus]') !== -1) { + return log.replace('[MFAStatus]', '[' + i18n.global.t('setting.mfa') + ']'); + } + if (log.indexOf('[MonitorStatus]') !== -1) { + return log.replace('[MonitorStatus]', '[' + i18n.global.t('setting.enableMonitor') + ']'); + } + if (log.indexOf('[MonitorStoreDays]') !== -1) { + return log.replace('[MonitorStoreDays]', '[' + i18n.global.t('setting.monitor') + ']'); + } + if (log.indexOf('[MonitorStoreDays]') !== -1) { + return log.replace('[MonitorStoreDays]', '[' + i18n.global.t('setting.monitor') + ']'); + } + if (log.indexOf('[MonitorStoreDays]') !== -1) { + return log.replace('[MonitorStoreDays]', '[' + i18n.global.t('setting.monitor') + ']'); + } + return log; +}; + const onSubmitClean = async () => { await cleanLogs({ logType: 'operation' }); search();