chore: ram vram usage in resource

This commit is contained in:
jialin
2025-03-06 19:44:35 +08:00
parent b0ac85d81d
commit 36d626c833
13 changed files with 137 additions and 90 deletions
@@ -0,0 +1,43 @@
import React from 'react';
import { convertFileSize } from '@/utils';
import { useIntl } from '@umijs/max';
import { Divider } from 'antd';
interface InfoColumnProps {
fieldList: { label: string; key: string }[];
data: Record<string, any>;
}
const InfoColumn: React.FC<InfoColumnProps> = (props) => {
const { data, fieldList } = props;
const intl = useIntl();
return (
<span className="flex">
{fieldList.map((item, index) => {
return (
<>
<span className="flex-column flex-center">
<span> {intl.formatMessage({ id: item.label })}</span>
<span> {convertFileSize(data[item.key], 0)}</span>
</span>
{index < fieldList.length - 1 ? (
<Divider
type="vertical"
style={{
height: 30,
marginInline: 16,
borderColor: 'var(--color-white-light-2)',
alignSelf: 'center'
}}
></Divider>
) : null}
</>
);
})}
</span>
);
};
export default InfoColumn;