fix: new added model item is cleared
This commit is contained in:
@@ -31,10 +31,6 @@ const CopyButton: React.FC<CopyButtonProps & TextProps> = ({
|
|||||||
];
|
];
|
||||||
}, [intl]);
|
}, [intl]);
|
||||||
|
|
||||||
const onCopy = () => {
|
|
||||||
console.log('copied');
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Typography.Paragraph
|
<Typography.Paragraph
|
||||||
style={{ ...btnStyle, marginBottom: 0 }}
|
style={{ ...btnStyle, marginBottom: 0 }}
|
||||||
@@ -42,8 +38,10 @@ const CopyButton: React.FC<CopyButtonProps & TextProps> = ({
|
|||||||
copyable={{
|
copyable={{
|
||||||
text: text,
|
text: text,
|
||||||
format: format,
|
format: format,
|
||||||
tooltips: tooltips,
|
tooltips: [
|
||||||
onCopy: onCopy,
|
intl.formatMessage({ id: 'common.button.copy' }),
|
||||||
|
intl.formatMessage({ id: 'common.button.copied' })
|
||||||
|
],
|
||||||
icon: [
|
icon: [
|
||||||
<CopyOutlined style={{ fontSize: fontSize, ...style }} key="copy" />,
|
<CopyOutlined style={{ fontSize: fontSize, ...style }} key="copy" />,
|
||||||
<CheckCircleFilled
|
<CheckCircleFilled
|
||||||
|
|||||||
@@ -147,11 +147,7 @@ export default function useAddResource(options?: { onCreated?: () => void }) {
|
|||||||
}}
|
}}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
>
|
>
|
||||||
<Content
|
<Content>
|
||||||
style={{
|
|
||||||
marginTop: !resourceCount.cluster_count ? 32 : 16
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="icon">
|
<div className="icon">
|
||||||
<IconFont type="icon-dashboard" />
|
<IconFont type="icon-dashboard" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ const SupportedModels = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (data: ProviderModel, index: number) => {
|
const onChange = (data: ProviderModel, index: number) => {
|
||||||
const newList = [...modelList];
|
const dataList = form.getFieldValue('models') || [];
|
||||||
|
const newList = [...dataList];
|
||||||
newList[index] = { ...data };
|
newList[index] = { ...data };
|
||||||
updateModelList(newList);
|
updateModelList(newList);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user