style: 系统资源多语言

This commit is contained in:
TsMask
2023-11-10 10:18:49 +08:00
parent e4b504825d
commit 946db8848c
3 changed files with 53 additions and 25 deletions

View File

@@ -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',

View File

@@ -505,6 +505,13 @@ export default {
logoutSuccess: "已强退用户 {num}",
},
monitor:{
filter: "全局过滤",
startTime: '开始时间',
endTime: '结束时间',
today: '昨天',
yesterday: '今天',
week: '本周',
month: '本月',
avgLoad: '平均负载',
memory: '内存',
cache: '缓存',

View File

@@ -17,6 +17,7 @@ const { t } = useI18n();
/**开始结束时间类型 */
type RangePickerType = {
placeholder: [string, string];
ranges: Record<string, [Dayjs, Dayjs]>;
/**全局时间 */
all: [string, string];
@@ -34,14 +35,24 @@ type RangePickerType = {
/**开始结束时间 */
let rangePicker = reactive<RangePickerType>({
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(() => {
<a-form name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="10" :md="10" :xs="24">
<a-form-item label="全局过滤" name="neTypeSelect">
<a-form-item
:label="t('views.monitor.monitor.filter')"
name="neTypeSelect"
>
<a-range-picker
v-model:value="rangePicker.all"
:allow-clear="false"
@@ -435,7 +449,7 @@ 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%"
></a-range-picker>
@@ -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)"
></a-range-picker>
@@ -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)"
></a-range-picker>
@@ -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)"
></a-range-picker>
@@ -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"
></a-range-picker>
@@ -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"
></a-range-picker>