From 7d828c2fd7826e97939c2a85b9c329637409262d Mon Sep 17 00:00:00 2001 From: alan Date: Tue, 12 Nov 2019 11:25:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/src/index.ts | 19 +++++++++---------- src/web/src/modules/app.edit.ts | 12 ++++++------ src/web/src/modules/app.show.ts | 10 +++++----- src/web/webpack/webpack.prod.js | 6 +++--- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/web/src/index.ts b/src/web/src/index.ts index 6c93924..b48315e 100644 --- a/src/web/src/index.ts +++ b/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); }); diff --git a/src/web/src/modules/app.edit.ts b/src/web/src/modules/app.edit.ts index e5bf2a5..b8e93e5 100644 --- a/src/web/src/modules/app.edit.ts +++ b/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 { diff --git a/src/web/src/modules/app.show.ts b/src/web/src/modules/app.show.ts index d7f0e4f..c3460fa 100644 --- a/src/web/src/modules/app.show.ts +++ b/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 { diff --git a/src/web/webpack/webpack.prod.js b/src/web/webpack/webpack.prod.js index 974d813..2a80783 100644 --- a/src/web/webpack/webpack.prod.js +++ b/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', } })] },