chore: locales

This commit is contained in:
jialin
2026-04-22 13:16:48 +08:00
committed by jialin
parent c92f56ec8f
commit 128f59ed6f
15 changed files with 287 additions and 97 deletions
+24 -5
View File
@@ -2,6 +2,7 @@ import CardWrapper from '@/components/card-wrapper';
import MixLineBar from '@/components/echarts/mix-line-bar';
import BaseSelect from '@/components/seal-form/base/select';
import { baseColorMap } from '@/pages/dashboard/config';
import { useIntl } from '@umijs/max';
import { Segmented } from 'antd';
import dayjs from 'dayjs';
import React, { useMemo } from 'react';
@@ -42,6 +43,7 @@ const labelFormatter = (v: any) => {
};
const DailyUsage: React.FC<DailyUsageProps> = (props) => {
const intl = useIntl();
const {
timeSeriesData,
metric,
@@ -102,8 +104,15 @@ const DailyUsage: React.FC<DailyUsageProps> = (props) => {
<div className="group">
<BaseSelect
variant="borderless"
prefix={<ControlLabel>Metric</ControlLabel>}
options={metricOptions}
prefix={
<ControlLabel>
{intl.formatMessage({ id: 'usage.filter.metric' })}
</ControlLabel>
}
options={metricOptions.map((item) => ({
label: intl.formatMessage({ id: item.label }),
value: item.value
}))}
value={metric}
popupMatchSelectWidth={false}
onChange={onMetricChange}
@@ -113,8 +122,15 @@ const DailyUsage: React.FC<DailyUsageProps> = (props) => {
<BaseSelect
allowClear
variant="borderless"
prefix={<ControlLabel>Group by</ControlLabel>}
options={groupByOptions}
prefix={
<ControlLabel>
{intl.formatMessage({ id: 'usage.filter.groupBy' })}
</ControlLabel>
}
options={groupByOptions.map((item) => ({
label: intl.formatMessage({ id: item.label }),
value: item.value
}))}
value={groupBy}
popupMatchSelectWidth={false}
onChange={handleOnGroupByChange}
@@ -123,7 +139,10 @@ const DailyUsage: React.FC<DailyUsageProps> = (props) => {
</div>
<Segmented
size="small"
options={granularities}
options={granularities.map((item) => ({
label: intl.formatMessage({ id: item.label }),
value: item.value
}))}
value={granularity}
onChange={onGranularityChange}
></Segmented>