2024-05-20 16:42:44 +08:00
|
|
|
import { Plugin } from '@tachybase/client';
|
2024-05-24 01:06:06 +08:00
|
|
|
import { PluginDataSourceManagerClient } from '@tachybase/plugin-data-source-manager/client';
|
|
|
|
|
2024-05-20 16:42:44 +08:00
|
|
|
import { MysqlDataSourceSettingsForm } from './forms/msql';
|
2024-05-24 01:06:06 +08:00
|
|
|
import { PgDataSourceSettingsForm } from './forms/pg';
|
|
|
|
import { tval } from './locale';
|
2024-05-20 16:42:44 +08:00
|
|
|
|
|
|
|
export class PluginExternalDataSourceClient extends Plugin {
|
|
|
|
async load() {
|
|
|
|
this.app.pm
|
|
|
|
.get(PluginDataSourceManagerClient)
|
|
|
|
.registerType('postgres', { DataSourceSettingsForm: PgDataSourceSettingsForm, label: tval('PostgreSQL') });
|
|
|
|
|
|
|
|
this.app.pm
|
|
|
|
.get(PluginDataSourceManagerClient)
|
|
|
|
.registerType('mysql', { DataSourceSettingsForm: MysqlDataSourceSettingsForm, label: tval('MySQL') });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PluginExternalDataSourceClient;
|