Browse Source

Merge pull request #2742 in DEC/decision-webui-dcm from feature/10.0 to research/10.0

* commit '8f9ac338a7a4f907d32903885141d25ccd74098d':
  DEC-20204 fix: 【迭代】【驱动管理】次管权限没有限制,可以进入驱动管理页面
  DEC-20200 fix: 【迭代】【驱动管理】新建数据连接,选择自定义驱动,保存后显示默认驱动
  DEC-20201 fix: 【迭代】【驱动管理】切换为自定义驱动,已经填好的数据库信息不会保存
  DEC-20047 fix: 【迭代】【部分数据连接支持fetchSize】平台设置fetchSize为空回填数值为0
research/10.0
superman 3 years ago
parent
commit
64f5cba9cf
  1. 1
      src/modules/pages/connection/connection.ts
  2. 7
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  3. 9
      src/modules/pages/maintain/forms/components/form.jdbc.ts

1
src/modules/pages/connection/connection.ts

@ -79,6 +79,7 @@ export class Connection extends BI.Widget {
right: [ right: [
{ {
type: 'dec.connection.driver.entry', type: 'dec.connection.driver.entry',
invisible: !BI.Services.getService('dec.service.global').isAdmin(),
from: '.dec-dcm', from: '.dec-dcm',
}, },
], ],

7
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -23,6 +23,7 @@ export class ConnectionJdbc extends BI.Widget {
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC;
const { const {
driver, driver,
driverSource,
database, database,
user, user,
originalCharsetName, originalCharsetName,
@ -45,7 +46,7 @@ export class ConnectionJdbc extends BI.Widget {
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
value: driver, value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver,
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
@ -182,9 +183,9 @@ export class ConnectionJdbc extends BI.Widget {
unit: BI.i18nText('BI-Basic_Seconds'), unit: BI.i18nText('BI-Basic_Seconds'),
}, { }, {
type: FormItem.xtype, type: FormItem.xtype,
invisible: BI.parseInt(fetchSize) < 0, invisible: fetchSize < 0 && fetchSize !== -2,
name: 'Fetchsize', name: 'Fetchsize',
value: fetchSize, value: fetchSize === -2 ? '' : fetchSize,
}, },
], ],
}, },

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

@ -148,7 +148,8 @@ export class FormJdbc extends BI.Widget {
const value = this.form.driver.getValue(); const value = this.form.driver.getValue();
const connectionData = this.options.formData.connectionData as ConnectionJDBC; const connectionData = this.options.formData.connectionData as ConnectionJDBC;
const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver);
const url = connectionType.urls ? connectionType.urls[value.driver] : connectionType.url; // DEC-2020
const url = (connectionType.urls && connectionType.urls[value.driver]) || connectionType.url;
this.form.url.setValue(url); this.form.url.setValue(url);
const urlInfo = resolveUrlInfo(url, connectionData.database); const urlInfo = resolveUrlInfo(url, connectionData.database);
this.form.host.setValue(urlInfo.host); this.form.host.setValue(urlInfo.host);
@ -712,7 +713,7 @@ export class FormJdbc extends BI.Widget {
el: { el: {
type: BI.VerticalLayout.xtype, type: BI.VerticalLayout.xtype,
cls: 'bi-border-top', cls: 'bi-border-top',
invisible: BI.parseInt(fetchSize) < 0, invisible: fetchSize < 0 && fetchSize !== -2,
items: [ items: [
{ {
el: { el: {
@ -723,7 +724,7 @@ export class FormJdbc extends BI.Widget {
$value: 'fetch-size', $value: 'fetch-size',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: fetchSize, value: fetchSize === -2 ? '' : fetchSize,
watermark: 'Fetchsize', watermark: 'Fetchsize',
validationChecker: [{ validationChecker: [{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Fetch_Size_Range'), errorText: BI.i18nText('Dec-Dcm_Connection_Check_Fetch_Size_Range'),
@ -857,7 +858,7 @@ export class FormJdbc extends BI.Widget {
creator: Dec ? Dec.personal.username : '', creator: Dec ? Dec.personal.username : '',
principal: this.form.principal.getValue(), principal: this.form.principal.getValue(),
keyPath: this.form.keyPath.getValue(), keyPath: this.form.keyPath.getValue(),
fetchSize: BI.parseInt(this.form.fetchSize.getValue()), fetchSize: BI.isEmptyString(this.form.fetchSize.getValue()) ? -2 : BI.parseInt(this.form.fetchSize.getValue()),
connectionPoolAttr: { connectionPoolAttr: {
initialSize: this.form.initialSize.getValue(), initialSize: this.form.initialSize.getValue(),
maxActive: this.form.maxActive.getValue(), maxActive: this.form.maxActive.getValue(),

Loading…
Cancel
Save