From 946db8848c246987d2c04830b354049f7d2c99be Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 10 Nov 2023 10:18:49 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=B3=BB=E7=BB=9F=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 35 +++++++++++++++++----------- src/i18n/locales/zh-CN.ts | 7 ++++++ src/views/monitor/monitor/index.vue | 36 ++++++++++++++++++++--------- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index e7c59619..9f5243b7 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -505,20 +505,27 @@ export default { logoutSuccess: "User {num} has been forcibly retired", }, monitor:{ - avgLoad: '平均负载', - memory: '内存', - cache: '缓存', - io: '磁盘', - network: '网络', - loadDetail: "负载率", - resourceUsage: "资源使用率", - read: '读取', - write: '写入', - readWriteCount: '读写次数', - count: '次', - readWriteTime: '读写延迟', - up: '上行', - down: '下行', + filter: "Global Filter", + startTime: 'Start Time', + endTime: 'End Time', + today: 'Today', + yesterday: 'Yesterday', + week: 'This Week', + month: 'This Month', + avgLoad: 'Average loads', + memory: 'RAM', + cache: 'Cache', + io: 'Disk', + network: 'Network', + loadDetail: "Load Factor", + resourceUsage: "Resource utilization rate", + read: 'retrieve', + write: 'write', + readWriteCount: 'Number of reads and writes', + count: 'substandard', + readWriteTime: 'Read/Write Delay', + up: 'up train', + down: 'down train', }, online:{ mettingId:'Session number', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index baf8a8d8..69b417f8 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -505,6 +505,13 @@ export default { logoutSuccess: "已强退用户 {num}", }, monitor:{ + filter: "全局过滤", + startTime: '开始时间', + endTime: '结束时间', + today: '昨天', + yesterday: '今天', + week: '本周', + month: '本月', avgLoad: '平均负载', memory: '内存', cache: '缓存', diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue index 03b0c81f..df257aa0 100644 --- a/src/views/monitor/monitor/index.vue +++ b/src/views/monitor/monitor/index.vue @@ -17,6 +17,7 @@ const { t } = useI18n(); /**开始结束时间类型 */ type RangePickerType = { + placeholder: [string, string]; ranges: Record; /**全局时间 */ all: [string, string]; @@ -34,14 +35,24 @@ type RangePickerType = { /**开始结束时间 */ let rangePicker = reactive({ + placeholder: [ + t('views.monitor.monitor.startTime'), + t('views.monitor.monitor.endTime'), + ], ranges: { - 昨天: [ + [t('views.monitor.monitor.today')]: [ dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day'), ], - 今天: [dayjs().startOf('day'), dayjs()], - 本周: [dayjs().startOf('week'), dayjs().endOf('week')], - 本月: [dayjs().startOf('month'), dayjs().endOf('month')], + [t('views.monitor.monitor.yesterday')]: [dayjs().startOf('day'), dayjs()], + [t('views.monitor.monitor.week')]: [ + dayjs().startOf('week'), + dayjs().endOf('week'), + ], + [t('views.monitor.monitor.month')]: [ + dayjs().startOf('month'), + dayjs().endOf('month'), + ], }, all: ['', ''], load: ['', ''], @@ -427,7 +438,10 @@ onMounted(() => { - + { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" :ranges="rangePicker.ranges" style="width: 100%" > @@ -469,7 +483,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" style="width: 100%" @change="(_:any, d:[string,string]) => fnGetQuery('load', d)" > @@ -499,7 +513,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" style="width: 100%" @change="(_:any, d:[string,string]) => fnGetQuery('cpu', d)" > @@ -527,7 +541,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" style="width: 100%" @change="(_:any, d:[string,string]) => fnGetQuery('memory', d)" > @@ -557,7 +571,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" style="width: 100%" @change="fnGetQueryIO" > @@ -585,7 +599,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" show-time - :placeholder="['开始时间', '结束时间']" + :placeholder="rangePicker.placeholder" style="width: 100%" @change="fnGetQueryNetwork" >