import { PlusOutlined } from '@ant-design/icons'; import { uid } from '@formily/shared'; import { ActionContext, SchemaComponent, useCompile, usePlugin } from '@nocobase/client'; import { Button, Dropdown } from 'antd'; import _ from 'lodash'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import PluginDatabaseConnectionsClient from '../'; import { NAMESPACE } from '../locale'; import { useTestConnectionAction } from '../hooks'; export const CreateDatabaseConnectAction = () => { const [schema, setSchema] = useState({}); const plugin = usePlugin(PluginDatabaseConnectionsClient); const compile = useCompile(); const [visible, setVisible] = useState(false); const { t } = useTranslation(); const [dialect, setDialect] = useState(null); const useDialectDataSource = (field) => { const options = [...plugin.databaseTypes.values()].map((storageType) => { return { value: storageType.name, label: compile(storageType.title), }; }); field.dataSource = options; }; return (
{ return { key: storageType.name, label: compile(storageType.title), }; }), }} >
); };