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 { RedisEdit } from './modules/app.edit';
import { RedisDataset } from './modules/app.dataset'; import { RedisDataset } from './modules/app.dataset';
import { RedisProgram } from './modules/app.program'; 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.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, { BI.config('dec.connection.provider.datebase', provider => {
text: 'Redis', provider.registerDatabaseType({
databaseType: 'Redis', text: 'Redis',
iconUrl: 'com/fr/plugin/db/redis/images/redis.png', databaseType: 'Redis',
}]); iconUrl: 'com/fr/plugin/db/redis/images/redis.png',
edit: RedisEdit.xtype,
show: RedisShow.xtype,
});
});
BI.config('dec.provider.data.set', provider => { BI.config('dec.provider.data.set', provider => {
provider.registerDataSetType({ provider.registerDataSetType({
@ -28,6 +29,4 @@ BI.DOM.ready(() => {
cardType: RedisProgram.xtype, 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 { export class RedisEdit extends BI.Widget {
static xtype = 'dec.dcm.connection.plugin.redis.edit'; static xtype = 'dec.dcm.connection.plugin.redis.edit';
props = { props = {
formData: { value: {
basicConfig : { basicConfig : {
...BASIC_CONFIG, ...BASIC_CONFIG,
}, },
@ -33,10 +33,10 @@ export class RedisEdit extends BI.Widget {
oldPassword = ''; oldPassword = '';
render() { render() {
const formData = BI.get(this.options, 'formData'); const value = BI.get(this.options, 'value');
const basicConfig = BI.get(formData, 'basicConfig', BASIC_CONFIG); const basicConfig = BI.get(value, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(formData, 'poolConfig', POOL_CONFIG); const poolConfig = BI.get(value, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(formData, 'proxyConfig', PROXY_CONFIG); const proxyConfig = BI.get(value, 'proxyConfig', PROXY_CONFIG);
const { host, port, password, originalCharsetName } = basicConfig; const { host, port, password, originalCharsetName } = basicConfig;
this.poolConfigData = poolConfig; this.poolConfigData = poolConfig;
this.proxyConfigData = proxyConfig; this.proxyConfigData = proxyConfig;
@ -166,7 +166,7 @@ export class RedisEdit extends BI.Widget {
}; };
} }
public getSubmitValue() { public getValue() {
const originalCharsetName = this.originalCharsetName.getValue()[0] || ''; const originalCharsetName = this.originalCharsetName.getValue()[0] || '';
return { 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 { export class RedisShow extends BI.Widget {
static xtype = 'dec.dcm.connection.plugin.redis.show' static xtype = 'dec.dcm.connection.plugin.redis.show'
props = { props = {
formData: { value: {
basicConfig : { basicConfig : {
...BASIC_CONFIG, ...BASIC_CONFIG,
}, },
@ -22,10 +22,10 @@ export class RedisShow extends BI.Widget {
}, },
} }
render() { render() {
const formData = BI.get(this.options, 'formData'); const value = BI.get(this.options, 'value');
const basicConfig = BI.get(formData, 'basicConfig', BASIC_CONFIG); const basicConfig = BI.get(value, 'basicConfig', BASIC_CONFIG);
const poolConfig = BI.get(formData, 'poolConfig', POOL_CONFIG); const poolConfig = BI.get(value, 'poolConfig', POOL_CONFIG);
const proxyConfig = BI.get(formData, 'proxyConfig', PROXY_CONFIG); const proxyConfig = BI.get(value, 'proxyConfig', PROXY_CONFIG);
const { host, port, newCharsetName } = basicConfig; const { host, port, newCharsetName } = basicConfig;
return { return {

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

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

Loading…
Cancel
Save