Browse Source

Merge pull request #2311 in DEC/decision-webui-dcm from final/10.0 to persist/10.0

* commit 'dd180a6a9dc3a5e5bec6df33259420abf8b2f6db':
  DEC-19154 fix: 【自动化】数据连接-高级设置中查看和编辑时-获取连接前检验的文本不同
  DEC-19116 fix: 【专题】【主题框架】部分数据连接缺少驱动时的链接跳转不正确
  DEC-18651 feat: 适配hologres数据集
  DEC-18828 feat: 隔离插件支持kerberos认证前后端交互connectionData中新增useJaas字段
persist/10.0 10.0.17.2021.06.24
superman 3 years ago
parent
commit
2f2154719c
  1. 12
      src/modules/constants/constant.ts
  2. 3
      src/modules/crud/crud.typings.d.ts
  3. 76
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  4. 30
      src/modules/pages/maintain/forms/components/form.jndi.ts
  5. 12
      src/modules/pages/maintain/forms/components/form.plugin.ts

12
src/modules/constants/constant.ts

@ -45,7 +45,7 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [
}, },
{ {
databaseType: 'apache-kylin', databaseType: 'apache-kylin',
link: DecCst.Hyperlink.Database.PHOENIX, link: DecCst.Hyperlink.Database.KYLIN,
}, },
{ {
databaseType: 'apache-phoenix', databaseType: 'apache-phoenix',
@ -400,6 +400,16 @@ export const DATA_BASE_TYPES = [
type: 'jdbc', type: 'jdbc',
hasSchema: true, hasSchema: true,
kerberos: true, kerberos: true,
}, {
text: 'Hologres',
databaseType: 'hologres',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/database',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: false,
}, { }, {
text: 'HP Vertica', text: 'HP Vertica',
databaseType: 'hp-vertica', databaseType: 'hp-vertica',

3
src/modules/crud/crud.typings.d.ts vendored

@ -1,4 +1,3 @@
export interface CrudReqOpts { export interface CrudReqOpts {
url?: string; url?: string;
type?: 'GET' | 'POST' | 'DELETE' | 'PUT'; type?: 'GET' | 'POST' | 'DELETE' | 'PUT';
@ -83,7 +82,7 @@ export interface ConnectionJDBC {
/** /**
* *
*/ */
port?: number|''; port?: number | '';
/** /**
* *
*/ */

76
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -1,13 +1,22 @@
import { shortcut } from '@core/core'; import {shortcut} from '@core/core';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import {Collapse, EVENT_CHANGE} from 'src/modules/components/collapse/collapse';
import { FormItem } from '../../components/form_item/form_item'; import {FormItem} from '../../components/form_item/form_item';
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings'; import {Connection, ConnectionJDBC, ConnectionPoolJDBC} from 'src/modules/crud/crud.typings';
import { connectionType } from '@constants/env'; import {connectionType} from '@constants/env';
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; import {CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE} from '@constants/constant';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; import {getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl} from '../../../../app.service';
import { TextChecker } from '../../../../components/text_checker/text_checker'; import {TextChecker} from '../../../../components/text_checker/text_checker';
import { ApiFactory } from 'src/modules/crud/apiFactory'; import {ApiFactory} from 'src/modules/crud/apiFactory';
import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core'; import {
Editor,
EditorIconCheckCombo,
Label,
TextAreaEditor,
TextEditor,
TextValueCombo,
VerticalLayout
} from '@fui/core';
const api = new ApiFactory().create(); const api = new ApiFactory().create();
@shortcut() @shortcut()
@ -57,13 +66,38 @@ export class FormJdbc extends BI.Widget {
}; };
render() { render() {
const { connectionName, connectionData } = this.options.formData; const {connectionName, connectionData} = this.options.formData;
const { driver, user, password, originalCharsetName, schema, url, connectionPoolAttr, database, authType, principal, keyPath } = connectionData as ConnectionJDBC; const {
const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minIdle, minEvictableIdleTimeMillis } = connectionPoolAttr as ConnectionPoolJDBC; driver,
user,
password,
originalCharsetName,
schema,
url,
connectionPoolAttr,
database,
authType,
principal,
keyPath
} = connectionData as ConnectionJDBC;
const {
initialSize,
maxActive,
maxIdle,
maxWait,
validationQuery,
testOnBorrow,
testOnReturn,
testWhileIdle,
timeBetweenEvictionRunsMillis,
numTestsPerEvictionRun,
minIdle,
minEvictableIdleTimeMillis
} = connectionPoolAttr as ConnectionPoolJDBC;
const databaseType = getJdbcDatabaseType(database, driver); const databaseType = getJdbcDatabaseType(database, driver);
this.oldPassword = password; this.oldPassword = password;
const { host, port, databaseName } = resolveUrlInfo(url, database); const {host, port, databaseName} = resolveUrlInfo(url, database);
const { hgap, vgap } = CONNECTION_LAYOUT; const {hgap, vgap} = CONNECTION_LAYOUT;
const valueRangeConfig = { const valueRangeConfig = {
errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'),
@ -360,7 +394,7 @@ export class FormJdbc extends BI.Widget {
vgap: 15, vgap: 15,
disabled: true, disabled: true,
value: schema, value: schema,
items: schema ? [{ text: schema, value: schema }] : [], items: schema ? [{text: schema, value: schema}] : [],
ref: (_ref: TextValueCombo) => { ref: (_ref: TextValueCombo) => {
this.form.schema = _ref; this.form.schema = _ref;
}, },
@ -547,7 +581,7 @@ export class FormJdbc extends BI.Widget {
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
forms: [{ forms: [{
type: BI.TextValueCombo.xtype, type: BI.TextValueCombo.xtype,
$value: 'check', $value: 'check',
@ -555,7 +589,7 @@ export class FormJdbc extends BI.Widget {
allowBlank: true, allowBlank: true,
value: testOnBorrow, value: testOnBorrow,
items: this.getBooleanItem(), items: this.getBooleanItem(),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
ref: (_ref: TextValueCombo) => { ref: (_ref: TextValueCombo) => {
this.form.testOnBorrow = _ref; this.form.testOnBorrow = _ref;
}, },
@ -733,7 +767,7 @@ export class FormJdbc extends BI.Widget {
} }
private onHostPortChange(databaseType) { private onHostPortChange(databaseType) {
const { urls, url } = databaseType; const {urls, url} = databaseType;
const driver = this.form.driver.getValue(); const driver = this.form.driver.getValue();
const selectUrl = BI.get(urls, driver) || url; const selectUrl = BI.get(urls, driver) || url;
const host = this.form.host.getValue(); const host = this.form.host.getValue();
@ -766,7 +800,7 @@ export class FormJdbc extends BI.Widget {
connectionType: connectionType.JDBC, connectionType: connectionType.JDBC,
connectionId: this.form.connectionName.getValue(), connectionId: this.form.connectionName.getValue(),
connectionName: this.form.connectionName.getValue(), connectionName: this.form.connectionName.getValue(),
connectionData: { connectionData: <ConnectionJDBC>BI.extend({}, connectionData, {
database: connectionData.database, database: connectionData.database,
connectionName: this.form.connectionName.getValue(), connectionName: this.form.connectionName.getValue(),
driver: this.form.driver.getValue(), driver: this.form.driver.getValue(),
@ -796,7 +830,7 @@ export class FormJdbc extends BI.Widget {
numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(),
minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(), minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(),
}, },
}, }),
}; };
} }
} }

30
src/modules/pages/maintain/forms/components/form.jndi.ts

@ -1,11 +1,11 @@
import { shortcut } from '@core/core'; import {shortcut} from '@core/core';
import { FormItem } from '../../components/form_item/form_item'; import {FormItem} from '../../components/form_item/form_item';
import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings'; import {ConnectionJNDI, Connection, ContextHashtable} from 'src/modules/crud/crud.typings';
import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant'; import {CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS} from '@constants/constant';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import {Collapse, EVENT_CHANGE} from 'src/modules/components/collapse/collapse';
import { connectionType } from '@constants/env'; import {connectionType} from '@constants/env';
import { TextChecker } from '../../../../components/text_checker/text_checker'; import {TextChecker} from '../../../../components/text_checker/text_checker';
import { EditorIconCheckCombo, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core'; import {EditorIconCheckCombo, TextEditor, TextValueCombo, VerticalLayout} from '@fui/core';
@shortcut() @shortcut()
export class FormJndi extends BI.Widget { export class FormJndi extends BI.Widget {
@ -37,9 +37,9 @@ export class FormJndi extends BI.Widget {
} }
render() { render() {
const { connectionName, connectionData } = this.options.formData; const {connectionName, connectionData} = this.options.formData;
const { jndiName, newCharsetName, contextHashtable } = connectionData as ConnectionJNDI; const {jndiName, newCharsetName, contextHashtable} = connectionData as ConnectionJNDI;
const { hgap, vgap } = CONNECTION_LAYOUT; const {hgap, vgap} = CONNECTION_LAYOUT;
return { return {
type: BI.VerticalLayout.xtype, type: BI.VerticalLayout.xtype,
@ -399,7 +399,9 @@ export class FormJndi extends BI.Widget {
this.form.connectionName.setError(value); this.form.connectionName.setError(value);
} }
public getSubmitValue():Connection { public getSubmitValue(): Connection {
const connectionData = this.options.formData.connectionData as ConnectionJNDI;
const contextHashtable = { const contextHashtable = {
'java.naming.factory.initial': this.form.initial.getValue(), 'java.naming.factory.initial': this.form.initial.getValue(),
'java.naming.provider.url': this.form.providerUrl.getValue(), 'java.naming.provider.url': this.form.providerUrl.getValue(),
@ -428,13 +430,13 @@ export class FormJndi extends BI.Widget {
connectionId: this.form.connectionName.getValue(), connectionId: this.form.connectionName.getValue(),
connectionName: this.form.connectionName.getValue(), connectionName: this.form.connectionName.getValue(),
connectionType: connectionType.JNDI, connectionType: connectionType.JNDI,
connectionData: { connectionData: <ConnectionJNDI>BI.extend({}, connectionData, {
jndiName: this.form.jndiName.getValue(), jndiName: this.form.jndiName.getValue(),
newCharsetName: this.form.newCharsetName.getValue()[0] || '', newCharsetName: this.form.newCharsetName.getValue()[0] || '',
originalCharsetName: this.form.newCharsetName.getValue()[0] || '', originalCharsetName: this.form.newCharsetName.getValue()[0] || '',
creator: Dec ? Dec.personal.username : '', creator: Dec ? Dec.personal.username : '',
contextHashtable: contextHashtable as ContextHashtable, contextHashtable: contextHashtable as ContextHashtable,
}, }),
}; };
} }
} }

12
src/modules/pages/maintain/forms/components/form.plugin.ts

@ -1,13 +1,13 @@
import {shortcut} from '@core/core'; import { shortcut } from '@core/core';
import {Connection} from 'src/modules/crud/crud.typings'; import { Connection, ConnectionPlugin } from 'src/modules/crud/crud.typings';
import {getPluginWidgetEdit} from '../../../../app.service'; import { getPluginWidgetEdit } from '../../../../app.service';
@shortcut() @shortcut()
export class FormPlugin extends BI.Widget { export class FormPlugin extends BI.Widget {
static xtype = 'dec.dcm.maintain_plugin'; static xtype = 'dec.dcm.maintain_plugin';
props = { props = {
formData: {} as Connection, formData: {} as Connection,
} };
plugin: any; plugin: any;
@ -28,13 +28,13 @@ export class FormPlugin extends BI.Widget {
} }
public getSubmitValue(): Connection { public getSubmitValue(): Connection {
const { connectionType, connectionId, connectionName } = this.options.formData; const { connectionType, connectionId, connectionName, connectionData } = this.options.formData;
return { return {
connectionId, connectionId,
connectionType, connectionType,
connectionName: this.plugin.getConnectionName ? this.plugin.getConnectionName() : connectionName, connectionName: this.plugin.getConnectionName ? this.plugin.getConnectionName() : connectionName,
connectionData: this.plugin.getValue(), connectionData: <ConnectionPlugin>BI.extend({}, connectionData, this.plugin.getValue()),
}; };
} }
} }

Loading…
Cancel
Save