mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-21 13:52:17 +08:00
fix: multi-app migration (#7540)
This commit is contained in:
+16
-17
@@ -120,27 +120,25 @@ export const useMigrateData = () => {
|
||||
const port = React.useRef<any>();
|
||||
const api = useAPIClient();
|
||||
const { t } = usePluginUtils();
|
||||
const [form] = Form.useForm();
|
||||
return {
|
||||
async run() {
|
||||
console.log('migrateData');
|
||||
form.resetFields();
|
||||
await Modal.confirm({
|
||||
title: t('Migrate data'),
|
||||
content: (
|
||||
<Form.Item
|
||||
label={t('Port')}
|
||||
tooltip={t(
|
||||
'When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.',
|
||||
)}
|
||||
>
|
||||
<InputNumber
|
||||
onChange={(value) => {
|
||||
port.current = value as number;
|
||||
}}
|
||||
defaultValue={port.current}
|
||||
style={{ width: '100%' }}
|
||||
min={1}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form form={form}>
|
||||
<Form.Item
|
||||
label={t('Port')}
|
||||
tooltip={t(
|
||||
'When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.',
|
||||
)}
|
||||
rules={[{ required: true, message: t('Port is required') }]}
|
||||
name="port"
|
||||
>
|
||||
<InputNumber style={{ width: '100%' }} min={1} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
onOk: async () => {
|
||||
const { data } = await api.resource('pm').get({
|
||||
@@ -150,11 +148,12 @@ export const useMigrateData = () => {
|
||||
message.error(t('Multi-app is not enabled, please enable it first'));
|
||||
return;
|
||||
}
|
||||
const values = await form.validateFields();
|
||||
await api.request({
|
||||
url: 'multiApplications:importFromMultiappManager',
|
||||
method: 'post',
|
||||
data: {
|
||||
port: port.current,
|
||||
port: values.port,
|
||||
},
|
||||
});
|
||||
message.success(t('Migrate successfully'));
|
||||
|
||||
@@ -7,5 +7,7 @@
|
||||
"Custom domain": "Custom domain",
|
||||
"Manage applications": "Manage applications",
|
||||
"Standalone deployment": "Standalone deployment",
|
||||
"Auto start": "Auto start"
|
||||
"Auto start": "Auto start",
|
||||
"Port": "Port",
|
||||
"Please enter the port": "Please enter the port"
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
"Port": "端口号",
|
||||
"When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.": "迁移数据时,系统会基于该端口号自动为每个应用分配一个递增的端口号,您也可以在迁移后手动修改。",
|
||||
"Migrate data to new multi-app": "迁移数据至新多应用",
|
||||
"Multi-app is not enabled, please enable it first": "多应用未启用,请先启用"
|
||||
"Multi-app is not enabled, please enable it first": "多应用未启用,请先启用",
|
||||
"Please enter the port": "请输入端口号"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user