fix: dashboard intl settings

This commit is contained in:
jialin
2024-06-30 13:49:44 +08:00
parent 9f4f28edaf
commit aa160da9f9
23 changed files with 270 additions and 202 deletions
+3 -1
View File
@@ -1,3 +1,4 @@
import { useIntl } from '@umijs/max';
import { Card, Col, Row, Space } from 'antd';
import _ from 'lodash';
import React, { useContext } from 'react';
@@ -26,6 +27,7 @@ const renderCardItem = (data: {
);
};
const Overview: React.FC = () => {
const intl = useIntl();
const data = useContext(DashboardContext).resource_counts || {};
const renderValue = (
@@ -61,7 +63,7 @@ const Overview: React.FC = () => {
key={config.key}
>
{renderCardItem({
label: config.label,
label: intl.formatMessage({ id: config.label }),
value: renderValue(_.get(data, config.key, 0)),
bgColor: config.backgroundColor
})}