chore: the text on the recreate button

This commit is contained in:
jialin
2024-12-19 19:42:57 +08:00
parent f44aee0af4
commit b40bf76270
4 changed files with 23 additions and 4 deletions
+20 -4
View File
@@ -8,7 +8,14 @@ const DeleteModal = forwardRef((props, ref) => {
const intl = useIntl();
const [visible, setVisible] = useState(false);
const [config, setConfig] = useState<
ModalFuncProps & { content: string; selection?: boolean; name?: string }
ModalFuncProps & {
content: string;
selection?: boolean;
name?: string;
okText?: string;
cancelText?: string;
title?: string;
}
>({});
useImperativeHandle(ref, () => ({
@@ -17,6 +24,9 @@ const DeleteModal = forwardRef((props, ref) => {
content: string;
selection?: boolean;
name?: string;
title?: string;
cancelText?: string;
okText?: string;
}
) => {
setConfig(data);
@@ -55,10 +65,14 @@ const DeleteModal = forwardRef((props, ref) => {
footer={
<Space size={20}>
<Button onClick={handleCancel} size="middle">
{intl.formatMessage({ id: 'common.button.cancel' })}
{config.cancelText
? intl.formatMessage({ id: config.cancelText })
: intl.formatMessage({ id: 'common.button.cancel' })}
</Button>
<Button type="primary" onClick={handleOk} size="middle">
{intl.formatMessage({ id: 'common.button.delete' })}
{config.okText
? intl.formatMessage({ id: config.okText })
: intl.formatMessage({ id: 'common.button.delete' })}
</Button>
</Space>
}
@@ -67,7 +81,9 @@ const DeleteModal = forwardRef((props, ref) => {
<span className="title">
<ExclamationCircleFilled />
<span>
{intl.formatMessage({ id: 'common.title.delete.confirm' })}
{config.title
? intl.formatMessage({ id: config.title })
: intl.formatMessage({ id: 'common.title.delete.confirm' })}
</span>
</span>
</div>
+1
View File
@@ -204,6 +204,7 @@ export default {
'common.button.docs': 'Documentation',
'common.button.version': 'Version',
'common.title.delete.confirm': 'Confirm delete',
'common.title.recreate.confirm': 'Confirm recreate',
'common.button.addLabel': 'Add Labels',
'common.button.addSelector': 'Add Selectors',
'common.button.addParams': 'Add Parameter',
+1
View File
@@ -197,6 +197,7 @@ export default {
'common.button.docs': '文档',
'common.button.version': '版本',
'common.title.delete.confirm': '确认删除',
'common.title.recreate.confirm': '确认重新创建',
'common.button.addLabel': '添加标签',
'common.button.addSelector': '添加选择器',
'common.button.addParams': '添加参数',
@@ -449,6 +449,7 @@ const Models: React.FC<ModelsProps> = ({
const handleDeleteInstace = (row: any, list: ModelInstanceListItem[]) => {
modalRef.current.show({
content: 'models.instances',
okText: 'common.button.recreate',
name: row.name,
async onOk() {
await deleteModelInstance(row.id);