fix: usage locales

This commit is contained in:
jialin
2026-06-05 23:08:45 +08:00
committed by Lawrence Li
parent 9f5d95f565
commit d8f6064d5e
10 changed files with 63 additions and 13 deletions
@@ -51,7 +51,14 @@ const InstanceTypeCell: React.FC<{
<IconFont type={sec.icon} />
<span>{sec.name}</span>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<div
style={{
display: 'flex',
flexDirection: 'column',
gap: 2,
width: '100%'
}}
>
{rows.map(([label, value], i) => (
<div
key={i}
@@ -60,7 +67,15 @@ const InstanceTypeCell: React.FC<{
<span style={{ opacity: 0.65, minWidth: 96 }}>
{label || ''}
</span>
<span>{value}</span>
<span
style={{
display: 'flex',
flex: 1,
justifyContent: 'flex-end'
}}
>
{value}
</span>
</div>
))}
</div>
@@ -245,7 +245,12 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
const unitResourcesParsed = instanceType?.spec?.unitResourcesParsed;
const { count = 0 } = options;
return {
console.log('building resources data with', {
unitResourcesParsed,
count
});
const result = {
accelerator: _.toString(count),
cpu: unitResourcesParsed?.cpu?.cores
? count * unitResourcesParsed?.cpu?.cores
@@ -254,6 +259,8 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
? count * unitResourcesParsed?.ram?.value
: null
};
console.log('built resources data', result);
return result;
};
const buildResourcesDataForSubmit = (values: FormData) => {
@@ -475,7 +482,6 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
},
getFieldsValue: () => form.getFieldsValue(),
applyInstanceType: (instanceType?: InstanceTypeItem) => {
console.log('applying instance type', instanceType);
if (!instanceType) {
resolveAndApply(undefined, 0);
return;
@@ -273,7 +273,10 @@ const InstanceTypeFormItem: React.FC<InstanceTypeFormItemProps> = ({
</div>
{isGPU && (
<div style={{ flex: 1 }}>
<Form.Item<FormData> name={['spec', 'resources', 'cpu']}>
<Form.Item<FormData>
name={['spec', 'resources', 'cpu']}
key="cpu_input"
>
<InputNumber
label={'CPU'}
max={onceMaxRequest?.cpu ?? undefined}