Browse Source

fix: 更新数据连接接口

refactor
alan 5 years ago
parent
commit
7d828c2fd7
  1. 19
      src/web/src/index.ts
  2. 12
      src/web/src/modules/app.edit.ts
  3. 10
      src/web/src/modules/app.show.ts
  4. 6
      src/web/webpack/webpack.prod.js

19
src/web/src/index.ts

@ -2,16 +2,17 @@ import { RedisShow } from './modules/app.show';
import { RedisEdit } from './modules/app.edit';
import { RedisDataset } from './modules/app.dataset';
import { RedisProgram } from './modules/app.program';
const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';
BI.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, {
text: 'Redis',
databaseType: 'Redis',
iconUrl: 'com/fr/plugin/db/redis/images/redis.png',
}]);
BI.config('dec.connection.provider.datebase', provider => {
provider.registerDatabaseType({
text: 'Redis',
databaseType: 'Redis',
iconUrl: 'com/fr/plugin/db/redis/images/redis.png',
edit: RedisEdit.xtype,
show: RedisShow.xtype,
});
});
BI.config('dec.provider.data.set', provider => {
provider.registerDataSetType({
@ -28,6 +29,4 @@ BI.DOM.ready(() => {
cardType: RedisProgram.xtype,
});
});
BI.constant(ConstantRedisShow, RedisShow.xtype);
BI.constant(ConstantRedisEdit, RedisEdit.xtype);
});

12
src/web/src/modules/app.edit.ts

@ -8,7 +8,7 @@ import { ProxyEdit } from './components/proxy/proxy_edit';
export class RedisEdit extends BI.Widget {
static xtype = 'dec.dcm.connection.plugin.redis.edit';
props = {
formData: {
value: {
basicConfig : {
...BASIC_CONFIG,
},
@ -33,10 +33,10 @@ export class RedisEdit extends BI.Widget {
oldPassword = '';
render() {
const formData = BI.get(this.options, 'formData');
const basicConfig = BI.get(formData, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(formData, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(formData, 'proxyConfig', PROXY_CONFIG);
const value = BI.get(this.options, 'value');
const basicConfig = BI.get(value, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(value, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(value, 'proxyConfig', PROXY_CONFIG);
const { host, port, password, originalCharsetName } = basicConfig;
this.poolConfigData = poolConfig;
this.proxyConfigData = proxyConfig;
@ -166,7 +166,7 @@ export class RedisEdit extends BI.Widget {
};
}
public getSubmitValue() {
public getValue() {
const originalCharsetName = this.originalCharsetName.getValue()[0] || '';
return {

10
src/web/src/modules/app.show.ts

@ -9,7 +9,7 @@ import { POOL_CONFIG, PROXY_CONFIG, BASIC_CONFIG } from '@constants/constant';
export class RedisShow extends BI.Widget {
static xtype = 'dec.dcm.connection.plugin.redis.show'
props = {
formData: {
value: {
basicConfig : {
...BASIC_CONFIG,
},
@ -22,10 +22,10 @@ export class RedisShow extends BI.Widget {
},
}
render() {
const formData = BI.get(this.options, 'formData');
const basicConfig = BI.get(formData, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(formData, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(formData, 'proxyConfig', PROXY_CONFIG);
const value = BI.get(this.options, 'value');
const basicConfig = BI.get(value, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(value, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(value, 'proxyConfig', PROXY_CONFIG);
const { host, port, newCharsetName } = basicConfig;
return {

6
src/web/webpack/webpack.prod.js

@ -38,9 +38,9 @@ module.exports = merge.smart(common, {
options: {
plugins: [vars({
variables: {
fontUrl: '/webroot/decision/resources?path=/com/fr/web/ui/font',
imageUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/1x',
image2xUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/2x',
fontUrl: '${fineServletURL}/resources?path=/com/fr/web/ui/font',
imageUrl: '${fineServletURL}/resources?path=/com/fr/web/resources/dist/images/1x',
image2xUrl: '${fineServletURL}/resources?path=/com/fr/web/resources/dist/images/2x',
}
})]
},

Loading…
Cancel
Save