mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 19:36:44 +00:00
refactor: edit data soource
This commit is contained in:
parent
101b60129e
commit
cdd0a570f4
@ -16,7 +16,6 @@ import { useForm, useField } from '@formily/react';
|
|||||||
import PluginDatabaseConnectionsClient from '../';
|
import PluginDatabaseConnectionsClient from '../';
|
||||||
import { NAMESPACE } from '../locale';
|
import { NAMESPACE } from '../locale';
|
||||||
|
|
||||||
|
|
||||||
export const EditDatabaseConnectionAction = () => {
|
export const EditDatabaseConnectionAction = () => {
|
||||||
const record = useRecord();
|
const record = useRecord();
|
||||||
const [schema, setSchema] = useState({});
|
const [schema, setSchema] = useState({});
|
||||||
@ -56,7 +55,7 @@ export const EditDatabaseConnectionAction = () => {
|
|||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
const databaseType = plugin.databaseTypes.get(record.type || 'mysql');
|
const databaseType = plugin.databaseTypes.get(record.dialect);
|
||||||
setSchema({
|
setSchema({
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
@ -71,7 +70,10 @@ export const EditDatabaseConnectionAction = () => {
|
|||||||
},
|
},
|
||||||
title: compile("{{t('Edit')}}") + ' - ' + compile(record.name),
|
title: compile("{{t('Edit')}}") + ' - ' + compile(record.name),
|
||||||
properties: {
|
properties: {
|
||||||
..._.cloneDeep(databaseType?.properties),
|
body: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': databaseType.DataSourceSettingsForm,
|
||||||
|
},
|
||||||
footer: {
|
footer: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'Action.Drawer.Footer',
|
'x-component': 'Action.Drawer.Footer',
|
||||||
|
Loading…
Reference in New Issue
Block a user