fix: new added model item is cleared

This commit is contained in:
jialin
2026-02-10 17:29:57 +08:00
parent 9b498d10d5
commit c3d5234710
3 changed files with 7 additions and 12 deletions
+4 -6
View File
@@ -31,10 +31,6 @@ const CopyButton: React.FC<CopyButtonProps & TextProps> = ({
];
}, [intl]);
const onCopy = () => {
console.log('copied');
};
return (
<Typography.Paragraph
style={{ ...btnStyle, marginBottom: 0 }}
@@ -42,8 +38,10 @@ const CopyButton: React.FC<CopyButtonProps & TextProps> = ({
copyable={{
text: text,
format: format,
tooltips: tooltips,
onCopy: onCopy,
tooltips: [
intl.formatMessage({ id: 'common.button.copy' }),
intl.formatMessage({ id: 'common.button.copied' })
],
icon: [
<CopyOutlined style={{ fontSize: fontSize, ...style }} key="copy" />,
<CheckCircleFilled
@@ -147,11 +147,7 @@ export default function useAddResource(options?: { onCreated?: () => void }) {
}}
onCancel={handleCancel}
>
<Content
style={{
marginTop: !resourceCount.cluster_count ? 32 : 16
}}
>
<Content>
<div className="icon">
<IconFont type="icon-dashboard" />
</div>
@@ -80,7 +80,8 @@ const SupportedModels = () => {
};
const onChange = (data: ProviderModel, index: number) => {
const newList = [...modelList];
const dataList = form.getFieldValue('models') || [];
const newList = [...dataList];
newList[index] = { ...data };
updateModelList(newList);
};