Compare commits

..

13 Commits

Author SHA1 Message Date
richie 3f2e680b63 Merge pull request 'DEC-17971 feat: redis数据集加密' (#9) from dailer/demo-tabledata-redis:master into master 2 years ago
zsmj1994 03eac54abd DEC-17971 feat: redis数据集加密 4 years ago
operation e3fab11a21 Merge pull request 'DEC-17168 更换redis插件前端展示的图片' (#8) from alan/demo-tabledata-redis:master into master 4 years ago
alan 85b03e625d DEC-17168 更换redis插件的图片 4 years ago
operation 1edd7bac51 Merge pull request '更换平台图片' (#7) from Roger.Chen/demo-tabledata-redis:master into master 4 years ago
Roger.Chen c823a2940e DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 4 years ago
Roger.Chen e063102897 Merge branch 'master' of https://code.fanruan.com/Roger.Chen/demo-tabledata-redis 4 years ago
Roger.Chen c36533c0e7 DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 4 years ago
richie 9479176385 Merge pull request 'WIP:修改参数选择公式时的问题,并更换redis.png图片' (#5) from Roger.Chen/demo-tabledata-redis:master into master 4 years ago
Roger.Chen 967b3ae527 DEC-16606 fix: 平台数据集参数公式识别错误 使用fine-kitjar包中的类 4 years ago
Roger.Chen 34b349434d DEC-17168 fix: 替换一下redis数据集的图片 4 years ago
Roger.Chen a7e537312f DEC-16606 fix: 平台数据集参数公式识别错误 4 years ago
richie 428d99baa3 Merge pull request 'KERNEL-6540 类型引用规范化' (#3) from youki/demo-tabledata-redis:master into master 4 years ago
  1. 4
      plugin.xml
  2. 2
      src/main/java/com/fr/plugin/db/redis/RedisUniversalConnectionImpl.java
  3. 4
      src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java
  4. BIN
      src/main/resources/com/fr/plugin/db/redis/images/redis.jpg
  5. 2
      src/main/resources/com/fr/plugin/db/redis/web/redis.js
  6. 2
      src/web/src/index.ts
  7. 29
      src/web/src/modules/app.dataset.ts
  8. 35
      src/web/src/modules/app.program.ts

4
plugin.xml

@ -3,12 +3,14 @@
<id>com.fr.solution.plugin.db.redis.v10</id>
<name><![CDATA[Redis数据集]]></name>
<active>yes</active>
<version>7.4.1</version>
<version>7.4.3</version>
<env-version>10.0</env-version>
<jartime>2020-01-20</jartime>
<vendor>richie</vendor>
<description><![CDATA[可以连接Redis数据库,支持哈希表、列表、集合以及有序集合]]></description>
<change-notes><![CDATA[
[2021-2-4]更换平台redis图片。<br/>
[2020-12-29]解决平台数据集参数公式识别错误。<br/>
[2020-11-16]修复保存数据连接后平台测试连接报错的问题。<br/>
[2020-10-28]支持单一主机的集群模式连接选项。<br/>
[2020-07-07]修复了数据集没有随着参数的变化而变化的问题。<br>

2
src/main/java/com/fr/plugin/db/redis/RedisUniversalConnectionImpl.java

@ -27,7 +27,7 @@ public class RedisUniversalConnectionImpl extends AbstractUniversalConnectionPro
@Override
public String iconPathForConnection() {
return "/com/fr/plugin/db/redis/images/redis.png";
return "/com/fr/plugin/db/redis/images/redis.jpg";
}
@Override

4
src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java

@ -1,7 +1,9 @@
package com.fr.plugin.db.redis.bean;
import com.fanruan.api.cal.ParameterKit;
import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.util.StringKit;
import com.fr.general.GeneralUtils;
import com.fr.stable.ParameterProvider;
import java.util.ArrayList;
@ -61,7 +63,7 @@ public class ParameterBean {
public static ParameterBean createBean(ParameterProvider parameterProvider) {
if (parameterProvider.getValue() != null) {
return new ParameterBean(parameterProvider.getValue().getClass().getSimpleName(), parameterProvider.getName(), parameterProvider.valueToString());
return new ParameterBean(parameterProvider.getValue().getClass().getSimpleName(), parameterProvider.getName(), GeneralKit.objectToString(parameterProvider.getValue()));
} else {
return new ParameterBean(String.class.getSimpleName(), parameterProvider.getName(), StringKit.EMPTY);
}

BIN
src/main/resources/com/fr/plugin/db/redis/images/redis.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

2
src/main/resources/com/fr/plugin/db/redis/web/redis.js

File diff suppressed because one or more lines are too long

2
src/web/src/index.ts

@ -8,7 +8,7 @@ BI.DOM.ready(() => {
provider.registerDatabaseType({
text: 'Redis',
databaseType: 'Redis',
iconUrl: 'com/fr/plugin/db/redis/images/redis.png',
iconUrl: 'com/fr/plugin/db/redis/images/redis.jpg',
edit: RedisEdit.xtype,
show: RedisShow.xtype,
});

29
src/web/src/modules/app.dataset.ts

@ -1,11 +1,11 @@
import { shortcut, store } from '@core/core';
import { TableList } from './table_list/table_list';
import {shortcut, store} from '@core/core';
import {TableList} from './table_list/table_list';
import '../less/index.less';
import { DatabaseIndex } from './components/database_index/database_index';
import { RedisModel, ParameterType } from './app.model';
import { Preview } from './components/preview/preview';
import {DatabaseIndex} from './components/database_index/database_index';
import {RedisModel, ParameterType} from './app.model';
import {Preview} from './components/preview/preview';
import './app.less';
import { redisField } from './app.constant';
import {redisField} from './app.constant';
@shortcut()
@store(RedisModel)
@ -43,11 +43,12 @@ export class RedisDataset extends BI.Widget {
}
render() {
const { database = '', orderValue = 0, query = '', parameters = [] } = this.options.value.datasetData || {};
const {database = '', orderValue = 0, query = '', parameters = []} = this.options.value.datasetData || {};
this.store.setParameters(parameters);
this.store.setAbleSave(!!query);
const plainQuery = BI.Providers.getProvider("dec.provider.cipher").getPlain(query);
this.store.setAbleSave(!!plainQuery);
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
return {
type: BI.HTapeLayout.xtype,
tgap: 15,
@ -130,7 +131,7 @@ export class RedisDataset extends BI.Widget {
cls: 'bi-border',
height: 200,
allowBlank: true,
value: query,
value: plainQuery,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -185,7 +186,7 @@ export class RedisDataset extends BI.Widget {
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -195,7 +196,7 @@ export class RedisDataset extends BI.Widget {
private renderItems() {
const self = this;
return this.model.parameters.map((item, index) => [{
type: BI.Label.xtype,
text: item.name,
@ -210,7 +211,7 @@ export class RedisDataset extends BI.Widget {
value: item.type,
listeners: [{
eventName: BI.IconTextValueCombo.EVENT_CHANGE,
action () {
action() {
self.store.setParamType(index, this.getValue()[0]);
},
}],
@ -227,7 +228,7 @@ export class RedisDataset extends BI.Widget {
return {
database: this.tableList.getSelectedDatabase(),
orderValue: this.databaseIndex.getValue(),
query: this.queryCondition.getValue(),
query: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()),
parameters: this.model.parameters,
};
}

35
src/web/src/modules/app.program.ts

@ -1,11 +1,11 @@
import { shortcut, store } from '@core/core';
import { TableList } from './table_list/table_list';
import {shortcut, store} from '@core/core';
import {TableList} from './table_list/table_list';
import '../less/index.less';
import { DatabaseIndex } from './components/database_index/database_index';
import { RedisModel, ParameterType } from './app.model';
import {DatabaseIndex} from './components/database_index/database_index';
import {RedisModel, ParameterType} from './app.model';
import './app.less';
import { redisField } from './app.constant';
import { Preview } from './components/preview/preview';
import {redisField} from './app.constant';
import {Preview} from './components/preview/preview';
@shortcut()
@store(RedisModel)
@ -46,10 +46,17 @@ export class RedisProgram extends BI.Widget {
}
render() {
const { database = '', orderValue = 0, script = '', parameters = [], engineType = 0 } = this.options.value.datasetData || {};
const {
database = '',
orderValue = 0,
script = '',
parameters = [],
engineType = 0
} = this.options.value.datasetData || {};
this.store.setParameters(parameters);
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
const plainScript = BI.Providers.getProvider("dec.provider.cipher").getPlain(script);
return {
type: BI.HTapeLayout.xtype,
tgap: 15,
@ -157,7 +164,7 @@ export class RedisProgram extends BI.Widget {
cls: 'bi-border',
height: 200,
allowBlank: true,
value: script,
value: plainScript,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -212,7 +219,7 @@ export class RedisProgram extends BI.Widget {
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -222,7 +229,7 @@ export class RedisProgram extends BI.Widget {
private renderItems() {
const self = this;
return this.model.parameters.map((item, index) => [{
type: BI.Label.xtype,
text: item.name,
@ -237,7 +244,7 @@ export class RedisProgram extends BI.Widget {
value: item.type,
listeners: [{
eventName: BI.IconTextValueCombo.EVENT_CHANGE,
action () {
action() {
self.store.setParamType(index, this.getValue()[0]);
},
}],
@ -251,7 +258,7 @@ export class RedisProgram extends BI.Widget {
self.store.setParamValue(index, value);
})]);
}
private createParameterValueItem(param: ParameterType, cb: Function) {
return BI.Services.getService('dec.service.data.set').createParameterValueItem(param, cb);
}
@ -260,7 +267,7 @@ export class RedisProgram extends BI.Widget {
return {
database: this.tableList.getSelectedDatabase(),
orderValue: this.databaseIndex.getValue(),
script: this.queryCondition.getValue(),
script: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()),
engineType: this.engineTypeSelect.getValue()[0],
parameters: this.model.parameters,
};

Loading…
Cancel
Save