plugin-data-source-postgres 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client-v2/index.js +1 -1
- package/dist/constants.js +3 -0
- package/dist/externalVersion.js +10 -9
- package/dist/locale/en-US.json +8 -1
- package/dist/locale/zh-CN.json +8 -1
- package/dist/server/plugin.js +126 -5
- package/package.json +2 -2
- package/src/client/ConfigurationForm.tsx +312 -133
- package/src/client/__tests__/client-v1.test.tsx +80 -0
- package/src/client-v2/PostgresConfigForm.tsx +133 -6
- package/src/client-v2/__tests__/plugin.test.tsx +69 -0
- package/src/client-v2/plugin.tsx +2 -2
- package/src/constants.ts +15 -0
- package/src/locale/en-US.json +8 -1
- package/src/locale/zh-CN.json +8 -1
- package/src/server/__tests__/postgres-datasource.unit.test.ts +153 -0
- package/src/server/plugin.ts +160 -1
- package/dist/client-v2/985.34da95acdf7743ab.js +0 -10
package/src/server/plugin.ts
CHANGED
|
@@ -14,7 +14,13 @@ import { Plugin } from '@nocobase/server';
|
|
|
14
14
|
import { isValidFilter } from '@nocobase/utils';
|
|
15
15
|
import { cloneDeep, isEqual, omit, pick } from 'lodash';
|
|
16
16
|
import type { Transaction } from 'sequelize';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
DATA_SOURCE_TYPE,
|
|
19
|
+
DEFAULT_PORT,
|
|
20
|
+
DEFAULT_SCHEMA,
|
|
21
|
+
LIST_SAVED_CONNECTIONS_ACTION,
|
|
22
|
+
type SavedPostgresConnection,
|
|
23
|
+
} from '../constants';
|
|
18
24
|
import { PostgresSQLCollection } from './collections/sql-collection';
|
|
19
25
|
import { PostgresTreeCollection } from './collections/tree-collection';
|
|
20
26
|
import {
|
|
@@ -715,6 +721,93 @@ function prepareFields(values: Record<string, unknown>): void {
|
|
|
715
721
|
values.fields = mapped;
|
|
716
722
|
}
|
|
717
723
|
|
|
724
|
+
function toSavedPostgresConnection(record: Model): SavedPostgresConnection | null {
|
|
725
|
+
const key = String(record.get('key') || '').trim();
|
|
726
|
+
const options = record.get('options');
|
|
727
|
+
if (!key || !isRecord(options)) return null;
|
|
728
|
+
const host = typeof options.host === 'string' ? options.host.trim() : '';
|
|
729
|
+
const username = typeof options.username === 'string' ? options.username.trim() : '';
|
|
730
|
+
if (!host || !username) return null;
|
|
731
|
+
const rawPort = Number(options.port);
|
|
732
|
+
const port = Number.isInteger(rawPort) && rawPort >= 1 && rawPort <= 65535 ? rawPort : DEFAULT_PORT;
|
|
733
|
+
const database = typeof options.database === 'string' ? options.database.trim() : '';
|
|
734
|
+
const schema = typeof options.schema === 'string' && options.schema.trim() ? options.schema.trim() : DEFAULT_SCHEMA;
|
|
735
|
+
const displayName = String(record.get('displayName') || key);
|
|
736
|
+
return {
|
|
737
|
+
key,
|
|
738
|
+
displayName,
|
|
739
|
+
host,
|
|
740
|
+
port,
|
|
741
|
+
database,
|
|
742
|
+
schema,
|
|
743
|
+
username,
|
|
744
|
+
ssl: Boolean(options.ssl),
|
|
745
|
+
hasPassword: typeof options.password === 'string' && options.password.length > 0,
|
|
746
|
+
hasSslCa: typeof options.sslCa === 'string' && options.sslCa.trim().length > 0,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
async function resolveSavedConnectionOptions(ctx: Context, targetOptions: Record<string, unknown>): Promise<void> {
|
|
751
|
+
const rawSourceKey = targetOptions.sourceConnectionKey;
|
|
752
|
+
if ('sourceConnectionKey' in targetOptions) {
|
|
753
|
+
delete targetOptions.sourceConnectionKey;
|
|
754
|
+
}
|
|
755
|
+
const sourceKey = typeof rawSourceKey === 'string' ? rawSourceKey.trim() : '';
|
|
756
|
+
if (!sourceKey) return;
|
|
757
|
+
|
|
758
|
+
const repo = ctx.db?.getRepository?.('dataSources');
|
|
759
|
+
const sourceRecord = (await repo?.findOne?.({
|
|
760
|
+
filter: { key: sourceKey, type: DATA_SOURCE_TYPE },
|
|
761
|
+
})) as Model | null | undefined;
|
|
762
|
+
if (!sourceRecord) {
|
|
763
|
+
throw new PostgresValidationError('Saved PostgreSQL connection {{name}} does not exist', { name: sourceKey });
|
|
764
|
+
}
|
|
765
|
+
const sourceOptions = sourceRecord.get('options');
|
|
766
|
+
if (!isRecord(sourceOptions)) return;
|
|
767
|
+
|
|
768
|
+
if (!targetOptions.host && typeof sourceOptions.host === 'string') {
|
|
769
|
+
targetOptions.host = sourceOptions.host;
|
|
770
|
+
}
|
|
771
|
+
if (
|
|
772
|
+
(targetOptions.port === undefined || targetOptions.port === null || targetOptions.port === '') &&
|
|
773
|
+
sourceOptions.port !== undefined
|
|
774
|
+
) {
|
|
775
|
+
targetOptions.port = sourceOptions.port;
|
|
776
|
+
}
|
|
777
|
+
if (!targetOptions.database && typeof sourceOptions.database === 'string') {
|
|
778
|
+
targetOptions.database = sourceOptions.database;
|
|
779
|
+
}
|
|
780
|
+
if (!targetOptions.schema && typeof sourceOptions.schema === 'string') {
|
|
781
|
+
targetOptions.schema = sourceOptions.schema;
|
|
782
|
+
}
|
|
783
|
+
if (!targetOptions.username && typeof sourceOptions.username === 'string') {
|
|
784
|
+
targetOptions.username = sourceOptions.username;
|
|
785
|
+
}
|
|
786
|
+
if (targetOptions.ssl === undefined && sourceOptions.ssl !== undefined) {
|
|
787
|
+
targetOptions.ssl = Boolean(sourceOptions.ssl);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// Only inherit secret credentials when endpoint host, port, and username match the saved connection.
|
|
791
|
+
const sameHost = String(targetOptions.host || '').trim() === String(sourceOptions.host || '').trim();
|
|
792
|
+
const samePort = Number(targetOptions.port ?? DEFAULT_PORT) === Number(sourceOptions.port ?? DEFAULT_PORT);
|
|
793
|
+
const sameUsername = String(targetOptions.username || '').trim() === String(sourceOptions.username || '').trim();
|
|
794
|
+
if (sameHost && samePort && sameUsername) {
|
|
795
|
+
const hasCustomPassword = typeof targetOptions.password === 'string' && targetOptions.password.length > 0;
|
|
796
|
+
if (!hasCustomPassword && typeof sourceOptions.password === 'string' && sourceOptions.password.length > 0) {
|
|
797
|
+
targetOptions.password = sourceOptions.password;
|
|
798
|
+
}
|
|
799
|
+
const hasCustomSslCa = typeof targetOptions.sslCa === 'string' && targetOptions.sslCa.trim().length > 0;
|
|
800
|
+
if (
|
|
801
|
+
!hasCustomSslCa &&
|
|
802
|
+
targetOptions.ssl !== false &&
|
|
803
|
+
typeof sourceOptions.sslCa === 'string' &&
|
|
804
|
+
sourceOptions.sslCa.trim().length > 0
|
|
805
|
+
) {
|
|
806
|
+
targetOptions.sslCa = sourceOptions.sslCa;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
718
811
|
async function localizeValidationErrors(ctx: Context, next: Next) {
|
|
719
812
|
try {
|
|
720
813
|
await next();
|
|
@@ -1024,6 +1117,32 @@ export class PluginDataSourcePostgresServer extends Plugin {
|
|
|
1024
1117
|
);
|
|
1025
1118
|
},
|
|
1026
1119
|
);
|
|
1120
|
+
const listSavedConnectionsHandler = async (ctx: Context, next: Next) => {
|
|
1121
|
+
const records = (await ctx.db.getRepository('dataSources').find({
|
|
1122
|
+
filter: { type: DATA_SOURCE_TYPE },
|
|
1123
|
+
sort: ['createdAt'],
|
|
1124
|
+
})) as Model[];
|
|
1125
|
+
ctx.body = records
|
|
1126
|
+
.map((record) => toSavedPostgresConnection(record))
|
|
1127
|
+
.filter((item): item is SavedPostgresConnection => item !== null);
|
|
1128
|
+
await next();
|
|
1129
|
+
};
|
|
1130
|
+
const hasDefinedDataSources = Boolean(this.app.resourceManager.isDefined?.('dataSources'));
|
|
1131
|
+
if (hasDefinedDataSources) {
|
|
1132
|
+
const dataSourcesResource = this.app.resourceManager.getResource?.('dataSources') as
|
|
1133
|
+
| {
|
|
1134
|
+
actions?: Map<string, unknown>;
|
|
1135
|
+
addAction?: (name: string, handler: (ctx: Context, next: Next) => Promise<void>) => void;
|
|
1136
|
+
}
|
|
1137
|
+
| undefined;
|
|
1138
|
+
if (dataSourcesResource && !dataSourcesResource.actions?.has('listPostgresConnections')) {
|
|
1139
|
+
dataSourcesResource.addAction?.('listPostgresConnections', listSavedConnectionsHandler);
|
|
1140
|
+
}
|
|
1141
|
+
} else {
|
|
1142
|
+
this.app.resourceManager.registerActionHandlers?.({
|
|
1143
|
+
[LIST_SAVED_CONNECTIONS_ACTION]: listSavedConnectionsHandler,
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1027
1146
|
this.app.resourceManager.registerPreActionHandler('dataSources:readTables', async (ctx, next) => {
|
|
1028
1147
|
const { dataSourceKey, dbOptions } = ctx.action.params.values || {};
|
|
1029
1148
|
if (dbOptions?.type !== DATA_SOURCE_TYPE) {
|
|
@@ -1031,6 +1150,10 @@ export class PluginDataSourcePostgresServer extends Plugin {
|
|
|
1031
1150
|
return;
|
|
1032
1151
|
}
|
|
1033
1152
|
|
|
1153
|
+
if (isRecord(dbOptions)) {
|
|
1154
|
+
await resolveSavedConnectionOptions(ctx, dbOptions);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1034
1157
|
const manager = this.app.dataSourceManager;
|
|
1035
1158
|
const renderedOptions = this.app.environment?.renderJsonTemplate
|
|
1036
1159
|
? this.app.environment.renderJsonTemplate(dbOptions)
|
|
@@ -1129,6 +1252,42 @@ export class PluginDataSourcePostgresServer extends Plugin {
|
|
|
1129
1252
|
},
|
|
1130
1253
|
{ tag: 'postgres-schema-actions', after: ['acl'] },
|
|
1131
1254
|
);
|
|
1255
|
+
this.app.resourceManager.use(
|
|
1256
|
+
async (ctx: Context, next: Next) => {
|
|
1257
|
+
const { resourceName, actionName, params } = ctx.action || {};
|
|
1258
|
+
if (resourceName === 'dataSources') {
|
|
1259
|
+
const values = isRecord(params?.values) ? params.values : undefined;
|
|
1260
|
+
if (
|
|
1261
|
+
actionName === 'readTables' &&
|
|
1262
|
+
isRecord(values?.dbOptions) &&
|
|
1263
|
+
values.dbOptions.type === DATA_SOURCE_TYPE
|
|
1264
|
+
) {
|
|
1265
|
+
await resolveSavedConnectionOptions(ctx, values.dbOptions);
|
|
1266
|
+
} else if (
|
|
1267
|
+
(actionName === 'testConnection' || actionName === 'create') &&
|
|
1268
|
+
values?.type === DATA_SOURCE_TYPE &&
|
|
1269
|
+
isRecord(values.options)
|
|
1270
|
+
) {
|
|
1271
|
+
await resolveSavedConnectionOptions(ctx, values.options);
|
|
1272
|
+
} else if (actionName === 'update' && isRecord(values?.options) && 'sourceConnectionKey' in values.options) {
|
|
1273
|
+
let isPostgresTarget =
|
|
1274
|
+
values.type === DATA_SOURCE_TYPE ||
|
|
1275
|
+
this.app.dataSourceManager.get(params?.filterByTk) instanceof PostgresDataSource;
|
|
1276
|
+
if (!isPostgresTarget && params?.filterByTk) {
|
|
1277
|
+
const target = (await ctx.db
|
|
1278
|
+
?.getRepository?.('dataSources')
|
|
1279
|
+
?.findOne?.({ filterByTk: params.filterByTk })) as Model | null | undefined;
|
|
1280
|
+
isPostgresTarget = target?.get?.('type') === DATA_SOURCE_TYPE;
|
|
1281
|
+
}
|
|
1282
|
+
if (isPostgresTarget) {
|
|
1283
|
+
await resolveSavedConnectionOptions(ctx, values.options);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
await next();
|
|
1288
|
+
},
|
|
1289
|
+
{ tag: 'postgres-saved-connection', after: ['acl'], before: ['default'] },
|
|
1290
|
+
);
|
|
1132
1291
|
}
|
|
1133
1292
|
|
|
1134
1293
|
private async resolveCollectionsToDestroy(ctx: Context, source: PostgresDataSource): Promise<string[]> {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";(self.webpackChunkplugin_data_source_postgres_client_v2=self.webpackChunkplugin_data_source_postgres_client_v2||[]).push([["985"],{184:function(e,t,r){r.r(t),r.d(t,{default:function(){return y}});var n=r(155),o=r.n(n),l=r(59),a=r(694),s=r(953),u=r(981),i=r(582);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t,r,n,o,l,a){try{var s=e[l](a),u=s.value}catch(e){r(e);return}s.done?t(u):Promise.resolve(u).then(n,o)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return l}}(e,t)||d(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}}var f=["host","port","database","schema","username","password","ssl","sslCa"];function b(e,t){var r=null==t?void 0:t[e];return"port"===e?Number(null!=r?r:u.Wg):"schema"===e?"string"==typeof r&&r?r:u.my:"ssl"===e?!!r:"sslCa"===e?null!=r?r:"":r}function y(e){var t,r,y,h,v=e.mode,g=e.initialValues,F=e.loadCollections,w=(0,s.useTranslation)(u.CU).t,E=(0,a.useFlowContext)(),S=l.Form.useFormInstance(),I=l.Form.useWatch(["options","addAllCollections"],S),O=l.Form.useWatch(["options","host"],S),P=l.Form.useWatch(["options","port"],S),C=l.Form.useWatch(["options","database"],S),j=l.Form.useWatch(["options","schema"],S),A=l.Form.useWatch(["options","username"],S),k=l.Form.useWatch(["options","password"],S),_=l.Form.useWatch(["options","ssl"],S),V=l.Form.useWatch(["options","sslCa"],S),x=m((0,n.useState)([]),2),W=x[0],D=x[1],L=m((0,n.useState)(!1),2),R=L[0],T=L[1],U=(0,n.useRef)(0),q=(0,n.useRef)(),N=(0,n.useRef)(!1),M=(0,n.useRef)(!1),z=null==g||null==(r=g.options)?void 0:r.selectedCollections,G=null!=(t=null==g||null==(y=g.options)?void 0:y.addAllCollections)?t:(null==g||null==(h=g.options)?void 0:h.autoDiscover)!==!1,H=null!=I?I:G,K="edit"===v&&!G&&!Array.isArray(z);(0,n.useEffect)(function(){void 0===S.getFieldValue(["options","host"])&&S.setFieldValue(["options","host"],"localhost"),void 0===S.getFieldValue(["options","port"])&&S.setFieldValue(["options","port"],u.Wg),void 0===S.getFieldValue(["options","schema"])&&S.setFieldValue(["options","schema"],u.my),void 0===S.getFieldValue(["options","ssl"])&&S.setFieldValue(["options","ssl"],!1),void 0===S.getFieldValue(["options","addAllCollections"])&&S.setFieldValue(["options","addAllCollections"],G),void 0===S.getFieldValue("__postgresPreserveLegacySelection")&&S.setFieldValue("__postgresPreserveLegacySelection",K),"edit"===v&&Array.isArray(z)&&void 0===S.getFieldValue("collections")&&S.setFieldValue("collections",z)},[S,G,v,K,z]),(0,n.useEffect)(function(){U.current+=1,q.current=void 0,N.current=!1,M.current=!1,D([]),T(!1)},[O,P,C,j,A,k,_,V]);var $=(0,n.useCallback)(function(){var e;return(e=function(){var e,t,r,n,o,l,a,s;return function(e,t){var r,n,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(a,"next",{value:u(0)}),s(a,"throw",{value:u(1)}),s(a,"return",{value:u(2)}),"function"==typeof Symbol&&s(a,Symbol.iterator,{value:function(){return this}}),a;function u(s){return function(u){var i=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}(this,function(p){var m,y,h;switch(p.label){case 0:if(r=[(t=S.getFieldsValue(!0)).key].concat(function(e){if(Array.isArray(e))return c(e)}(m=f.map(function(e){return b(e,t.options)}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(m)||d(m)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),(n=null==(e=q.current)?void 0:e.every(function(e,t){return e===r[t]}))&&(N.current||M.current))return[2];n||(U.current+=1,q.current=r,N.current=!1),o=U.current,M.current=!0,T(!0),p.label=1;case 1:if(p.trys.push([1,6,7,8]),l=f.some(function(e){return b(e,t.options)!==b(e,null==g?void 0:g.options)}),!("create"===v||l))return[3,3];return[4,E.api.resource("dataSources").readTables({values:{dataSourceKey:t.key,dbOptions:(y=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},t.options),h=h={type:u.uy},Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(h)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(h)).forEach(function(e){Object.defineProperty(y,e,Object.getOwnPropertyDescriptor(h,e))}),y)}})];case 2:return s=p.sent().data,[3,5];case 3:return[4,F(String(null==g?void 0:g.key))];case 4:s=p.sent(),p.label=5;case 5:return a=s,o===U.current&&(D((0,i.I)(a)),N.current=!0),[3,8];case 6:return p.sent(),o===U.current&&E.message.error(String(w("Unable to load collections"))),[3,8];case 7:return o===U.current&&(M.current=!1,T(!1)),[7];case 8:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){p(l,n,o,a,s,"next",e)}function s(e){p(l,n,o,a,s,"throw",e)}a(void 0)})})()},[E,S,g,F,v,w]);return o().createElement(o().Fragment,null,o().createElement(l.Form.Item,{name:["options","host"],label:w("Host"),rules:[{required:!0}]},o().createElement(l.Input,null)),o().createElement(l.Form.Item,{name:["options","port"],label:w("Port"),rules:[{required:!0}]},o().createElement(l.InputNumber,{min:1,max:65535,style:{width:"100%"}})),o().createElement(l.Form.Item,{name:["options","database"],label:w("Database"),rules:[{required:!0}]},o().createElement(l.Input,null)),o().createElement(l.Form.Item,{name:["options","schema"],label:w("Schema")},o().createElement(l.Input,null)),o().createElement(l.Form.Item,{name:["options","username"],label:w("Username"),rules:[{required:!0}]},o().createElement(l.Input,null)),o().createElement(l.Form.Item,{name:["options","password"],label:w("Password")},o().createElement(l.Input.Password,null)),o().createElement(l.Form.Item,{name:["options","ssl"],label:w("Use SSL"),valuePropName:"checked"},o().createElement(l.Checkbox,null)),_?o().createElement(l.Form.Item,{name:["options","sslCa"],label:w("CA certificate (PEM)")},o().createElement(l.Input.TextArea,{autoSize:{minRows:3,maxRows:8}})):null,o().createElement(l.Form.Item,{name:["options","addAllCollections"],label:w("Load all collections"),valuePropName:"checked"},o().createElement(l.Checkbox,null)),o().createElement(l.Form.Item,{name:"__postgresPreserveLegacySelection",hidden:!0},o().createElement(l.Input,null)),H?null:o().createElement(l.Form.Item,{name:"collections",label:w("Collections")},o().createElement(l.Select,{mode:"multiple",allowClear:!0,loading:R,options:W,optionFilterProp:"label",onFocus:$,onChange:function(){return S.setFieldValue("__postgresPreserveLegacySelection",!1)}})))}}}]);
|