fix(web): InnerToolModal remove InnerToolModal btn
This commit is contained in:
@@ -60,25 +60,23 @@ const InnerToolModal = forwardRef<InnerToolModalRef, InnerToolModalProps>(({
|
|||||||
...values.config,
|
...values.config,
|
||||||
}
|
}
|
||||||
} as any)
|
} as any)
|
||||||
.then(() => {
|
.then((res: any) => {
|
||||||
handleClose()
|
message.success(t('common.saveSuccess'));
|
||||||
message.success(t('common.saveSuccess'))
|
testConnection(res.tool_id || editVo?.id)
|
||||||
refreshTable()
|
.finally(() => {
|
||||||
|
setLoading(false);
|
||||||
|
handleClose();
|
||||||
|
refreshTable()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setLoading(false);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log('err', err)
|
console.log('err', err)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const handleTestConnection = () => {
|
|
||||||
testConnection(editVo.id)
|
|
||||||
.then(() => {
|
|
||||||
message.success(t('tool.testConnectionSuccess'));
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
refreshTable()
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
// 暴露给父组件的方法
|
// 暴露给父组件的方法
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
@@ -91,12 +89,9 @@ const InnerToolModal = forwardRef<InnerToolModalRef, InnerToolModalProps>(({
|
|||||||
title={`${editVo.name} ${t('tool.config')}`}
|
title={`${editVo.name} ${t('tool.config')}`}
|
||||||
open={visible}
|
open={visible}
|
||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
|
okText={t('tool.saveAndTest')}
|
||||||
|
onOk={handleSave}
|
||||||
confirmLoading={loading}
|
confirmLoading={loading}
|
||||||
footer={[
|
|
||||||
<Button onClick={handleClose}>{t('common.cancel')}</Button>,
|
|
||||||
<Button onClick={handleTestConnection}>{t('tool.textLink')}</Button>,
|
|
||||||
<Button type="primary" loading={loading} onClick={handleSave}>{t('common.save')}</Button>,
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
{editVo?.config_data?.tool_class && config && <>
|
{editVo?.config_data?.tool_class && config && <>
|
||||||
<RbAlert className="rb:mb-3">
|
<RbAlert className="rb:mb-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user