Compare commits

...

20 Commits

Author SHA1 Message Date
richie 3f2e680b63 Merge pull request 'DEC-17971 feat: redis数据集加密' (#9) from dailer/demo-tabledata-redis:master into master 1 year ago
zsmj1994 03eac54abd DEC-17971 feat: redis数据集加密 3 years ago
operation e3fab11a21 Merge pull request 'DEC-17168 更换redis插件前端展示的图片' (#8) from alan/demo-tabledata-redis:master into master 3 years ago
alan 85b03e625d DEC-17168 更换redis插件的图片 3 years ago
operation 1edd7bac51 Merge pull request '更换平台图片' (#7) from Roger.Chen/demo-tabledata-redis:master into master 3 years ago
Roger.Chen c823a2940e DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 3 years ago
Roger.Chen e063102897 Merge branch 'master' of https://code.fanruan.com/Roger.Chen/demo-tabledata-redis 3 years ago
Roger.Chen c36533c0e7 DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 3 years ago
richie 9479176385 Merge pull request 'WIP:修改参数选择公式时的问题,并更换redis.png图片' (#5) from Roger.Chen/demo-tabledata-redis:master into master 3 years ago
Roger.Chen 967b3ae527 DEC-16606 fix: 平台数据集参数公式识别错误 使用fine-kitjar包中的类 3 years ago
Roger.Chen 34b349434d DEC-17168 fix: 替换一下redis数据集的图片 3 years ago
Roger.Chen a7e537312f DEC-16606 fix: 平台数据集参数公式识别错误 3 years ago
richie 428d99baa3 Merge pull request 'KERNEL-6540 类型引用规范化' (#3) from youki/demo-tabledata-redis:master into master 3 years ago
youki 151179763f KERNEL-6540 rafactor: 类型引用规范化 3 years ago
youki 4c1e427b20 KERNEL-6540 chore: 更新依赖配置 3 years ago
richie 60b7cf1d52 Merge pull request 'REPORT-43364 fix: 官网的redis插件连接失败' (#1) from Roger.Chen/demo-tabledata-redis:master into master 4 years ago
Roger.Chen 1ca357677c REPORT-43364 fix: 官网的redis插件连接失败 4 years ago
Roger.Chen 3f549f3922 REPORT-43364 fix: 官网的redis插件连接失败 4 years ago
richie 779743633f 版本号 4 years ago
richie 83e78f2e2f 支持单一主机的集群模式 4 years ago
  1. 6
      plugin.xml
  2. 6
      src/main/java/com/fr/plugin/db/redis/RedisUniversalConnectionImpl.java
  3. 4
      src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java
  4. 15
      src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java
  5. 6
      src/main/java/com/fr/plugin/db/redis/core/RedisPool.java
  6. 1
      src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java
  7. 12
      src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java
  8. BIN
      src/main/resources/com/fr/plugin/db/redis/images/redis.jpg
  9. 1
      src/main/resources/com/fr/plugin/db/redis/locale/redis.properties
  10. 1
      src/main/resources/com/fr/plugin/db/redis/locale/redis_en_US.properties
  11. 11
      src/main/resources/com/fr/plugin/db/redis/locale/redis_zh_CN.properties
  12. 14
      src/main/resources/com/fr/plugin/db/redis/web/redis.js
  13. 30
      src/web/babel.config.js
  14. 6
      src/web/index.html
  15. 15
      src/web/package.json
  16. 4
      src/web/src/index.edit.ts
  17. 2
      src/web/src/index.ts
  18. 2
      src/web/src/less/background.less
  19. 2
      src/web/src/less/font.less
  20. 2
      src/web/src/less/utils.less
  21. 62
      src/web/src/modules/app.dataset.ts
  22. 21
      src/web/src/modules/app.edit.ts
  23. 76
      src/web/src/modules/app.program.ts
  24. 21
      src/web/src/modules/app.show.ts
  25. 8
      src/web/src/modules/components/database_index/database_index.service.ts
  26. 7
      src/web/src/modules/components/database_index/database_index.ts
  27. 5
      src/web/src/modules/components/form_item/form_item.ts
  28. 15
      src/web/src/modules/components/pool/pool.ts
  29. 15
      src/web/src/modules/components/pool/pool_edit.ts
  30. 19
      src/web/src/modules/components/proxy/proxy.ts
  31. 19
      src/web/src/modules/components/proxy/proxy_edit.ts
  32. 9
      src/web/src/modules/table_list/list_item.ts
  33. 25
      src/web/src/modules/table_list/table_list.ts
  34. 81
      src/web/src/ui/fineui.ts
  35. 1
      src/web/src/ui/index.ts
  36. 1
      src/web/tsconfig.json
  37. 2
      src/web/types/globals.d.ts
  38. 2
      src/web/webpack/webpack.common.js

6
plugin.xml

@ -3,12 +3,16 @@
<id>com.fr.solution.plugin.db.redis.v10</id>
<name><![CDATA[Redis数据集]]></name>
<active>yes</active>
<version>7.3.6</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>
[2020-06-30]修复了一个失误导致连接被重复关闭的问题。<br/>
[2020-06-22]修改hkeys没能正确调用的问题。<br/>

6
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
@ -44,7 +44,9 @@ public class RedisUniversalConnectionImpl extends AbstractUniversalConnectionPro
public JSONObject serialize(RedisDatabaseConnection connection) {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put(BASIC_INFO, JSONObject.mapFrom(connection.clone()));
JSONObject basicInfo = JSONObject.mapFrom(connection.clone());
basicInfo.put("password", DecisionServiceConstants.DEFAULT_PASSWORD);
jsonObject.put(BASIC_INFO, basicInfo);
//将ConnectionPoolConfig和RedisConnectionProxyConfig也一次塞给前台展示
jsonObject.put(POOL_INFO, JSONObject.mapFrom(RedisConnectionPoolConfig.getInstance().clone()));
JSONObject proxy = JSONObject.mapFrom(RedisConnectionProxyConfig.getInstance().clone());

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);
}

15
src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java

@ -26,6 +26,7 @@ public class RedisDatabaseConnection extends BaseConnection {
private Conf<String> host = HolderKit.simple(StringKit.EMPTY);
private Conf<String> port = HolderKit.simple(String.valueOf(DEFAULT_REDIS_PORT));
private Conf<String> password = HolderKit.simple(StringKit.EMPTY);
private Conf<Boolean> cluster = HolderKit.simple(false);
public RedisDatabaseConnection() {
@ -55,6 +56,13 @@ public class RedisDatabaseConnection extends BaseConnection {
this.password.set(password);
}
public boolean isCluster() {
return cluster.get();
}
public void setCluster(boolean cluster) {
this.cluster.set(cluster);
}
@Override
public void testConnection() throws Exception {
@ -71,7 +79,7 @@ public class RedisDatabaseConnection extends BaseConnection {
}
public Redis createRedisClient() {
return RedisPool.getFinal(getHost(), getPort(), getPassword());
return RedisPool.getFinal(isCluster(), getHost(), getPort(), getPassword());
}
@Override
@ -151,6 +159,7 @@ public class RedisDatabaseConnection extends BaseConnection {
if (StringKit.isNotEmpty(pwd)) {
setPassword(SecurityKit.encrypt(pwd));
}
setCluster(reader.getAttrAsBoolean("cluster", false));
}
}
}
@ -164,15 +173,17 @@ public class RedisDatabaseConnection extends BaseConnection {
if (StringKit.isNotEmpty(getPassword())) {
writer.attr("password", SecurityKit.decrypt(getPassword()));
}
writer.attr("cluster", isCluster());
writer.end();
}
@Override
public Object clone() throws CloneNotSupportedException {
com.fr.plugin.db.redis.core.RedisDatabaseConnection cloned = (com.fr.plugin.db.redis.core.RedisDatabaseConnection) super.clone();
com.fr.plugin.db.redis.core.RedisDatabaseConnection cloned = (RedisDatabaseConnection) super.clone();
cloned.host = (Conf<String>) host.clone();
cloned.port = (Conf<String>) port.clone();
cloned.password = (Conf<String>) password.clone();
cloned.cluster = (Conf<Boolean>) cluster.clone();
return cloned;
}
}

6
src/main/java/com/fr/plugin/db/redis/core/RedisPool.java

@ -61,9 +61,11 @@ public class RedisPool {
jedisPoolMap.clear();
}
public static Redis getFinal(String host, String port, String password) {
public static Redis getFinal(boolean isCluster, String host, String port, String password) {
List<Pair<String, Integer>> pairs = findAllHostAndPassword(host, port);
if (pairs.size() == 1) {
if (isCluster) {
return pool.getJedisCluster(pairs, password);
} else if (pairs.size() == 1) {
return pool.getStandaloneResource(pairs.get(0), password);
} else {
return pool.getJedisCluster(pairs, password);

1
src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java

@ -34,7 +34,6 @@ public class RedisTableDataModel extends BaseDataModel {
long start = System.currentTimeMillis();
DataWrapper<Object> wrapper = VisitorFactory.getKeyValueResult(calculator, ps, redis.getClient(), query, rowCount);
LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
wrapper.transform(script);
data = wrapper.getData();
columnNames = wrapper.getColumnNames();
} catch (Exception e) {

12
src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java

@ -4,6 +4,7 @@ import com.fanruan.api.conf.ConfigurationKit;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.design.ui.component.UIActionLabel;
import com.fanruan.api.design.ui.component.UIButton;
import com.fanruan.api.design.ui.component.UICheckBox;
import com.fanruan.api.design.ui.component.UILabel;
import com.fanruan.api.design.ui.component.UIPasswordField;
import com.fanruan.api.design.ui.component.UITextField;
@ -31,6 +32,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
private UITextField hostTextField;
private UITextField portNumberField;
private UIPasswordField passwordTextField;
private UICheckBox clusterModeCheckBox;
@Override
@ -40,7 +42,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
hostTextField = new UITextField();
portNumberField = new UITextField();
passwordTextField = new UIPasswordField();
clusterModeCheckBox = new UICheckBox(DesignKit.i18nText("Plugin-Redis_Cluster_Mode"), false);
JPanel globalConfigPane = new JPanel();
GridLayout gridLayout = new GridLayout(1, 2);
@ -63,7 +65,11 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
Component[][] components = new Component[][]{
{new UILabel(DesignKit.i18nText("Plugin-Redis_Host") + ":"),
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER, helpButton, BorderLayout.EAST)},
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER,
GUICoreKit.createBorderLayoutPane(
clusterModeCheckBox, BorderLayout.CENTER,
helpButton, BorderLayout.EAST
), BorderLayout.EAST)},
{new UILabel(DesignKit.i18nText("Plugin-Redis_Port") + ":"), portNumberField},
{new UILabel(DesignKit.i18nText("Plugin-Redis_Password") + ":"), passwordTextField},
{null, globalConfigPane}
@ -135,6 +141,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
hostTextField.setText(ob.getHost());
portNumberField.setText(ob.getPort());
passwordTextField.setText(ob.getPassword());
clusterModeCheckBox.setSelected(ob.isCluster());
}
@Override
@ -143,6 +150,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
connection.setHost(hostTextField.getText());
connection.setPort(portNumberField.getText());
connection.setPassword(passwordTextField.getText());
connection.setCluster(clusterModeCheckBox.isSelected());
return connection;
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

1
src/main/resources/com/fr/plugin/db/redis/locale/redis.properties

@ -39,3 +39,4 @@ Plugin-Redis_Cluster_Config_Description=Input multiple hosts with commas separat
Plugin-Redis_Script_Engine_Type=Script Engine Type
Plugin-Redis_Script_Engine_Type_Default=Default
Plugin-Redis_Script_Engine_Type_V8=V8
Plugin-Redis_Cluster_Mode=Cluster Mode

1
src/main/resources/com/fr/plugin/db/redis/locale/redis_en_US.properties

@ -39,6 +39,7 @@ Plugin-Redis_Cluster_Config_Description=Input multiple hosts with commas separat
Plugin-Redis_Script_Engine_Type=Script Engine Type
Plugin-Redis_Script_Engine_Type_Default=Default
Plugin-Redis_Script_Engine_Type_V8=V8
Plugin-Redis_Cluster_Mode=Cluster Mode
Plugin-Redis_Index=Index
Plugin-Redis_Set_Parameter=Parameter
Plugin-Redis_Set_Parameter_Name=Parameter Name

11
src/main/resources/com/fr/plugin/db/redis/locale/redis_zh_CN.properties

@ -39,6 +39,7 @@ Plugin-Redis_Cluster_Config_Description=1\u3001\u4F7F\u7528\u9017\u53F7\u5206\u5
Plugin-Redis_Script_Engine_Type=\u811A\u672C\u5F15\u64CE
Plugin-Redis_Script_Engine_Type_Default=\u9ED8\u8BA4
Plugin-Redis_Script_Engine_Type_V8=V8\u9AD8\u901F\u5F15\u64CE
Plugin-Redis_Cluster_Mode=\u96C6\u7FA4\u6A21\u5F0F
Plugin-Redis_Proxy_Private_Key_Path_Mark=\u8BF7\u8F93\u5165\u670D\u52A1\u5668\u6587\u4EF6\u8DEF\u5F84
Plugin-Redis_Connection_Form_OriginalCharsetName= \u7F16\u7801
Plugin-Redis_Check_Integer=\u8BF7\u8F93\u5165\u4E0D\u5C0F\u4E8E0\u7684\u6574\u6570
@ -60,8 +61,8 @@ Plugin-Redis_Parameter_Delete_Confirm=\u4F60\u786E\u5B9A\u51B3\u5B9A\u5220\u9664
Plugin-Redis_Parameter_Delete_Alert=\u5F53\u524D\u5217\u8868\u4E3A\u7A7A\u6216\u8005\u4F60\u6CA1\u6709\u9009\u4E2D\u4EFB\u4F55\u9879
Plugin-Redis_View=\u89C6\u56FE
Plugin-Redis_Table=\u8868
Plugin-Redis_Index=\u7f16\u53f7
Plugin-Redis_Set_Parameter=\u53c2\u6570
Plugin-Redis_Set_Parameter_Name=\u53c2\u6570\u540d
Plugin-Redis_Set_Parameter_Type=\u53c2\u6570\u7c7b\u578b
Plugin-Redis_Set_Parameter_Value=\u53c2\u6570\u503c
Plugin-Redis_Index=\u7F16\u53F7
Plugin-Redis_Set_Parameter=\u53C2\u6570
Plugin-Redis_Set_Parameter_Name=\u53C2\u6570\u540D
Plugin-Redis_Set_Parameter_Type=\u53C2\u6570\u7C7B\u578B
Plugin-Redis_Set_Parameter_Value=\u53C2\u6570\u503C

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

File diff suppressed because one or more lines are too long

30
src/web/babel.config.js

@ -1,29 +1 @@
module.exports = function(api) {
api.cache(true);
const presets = [
[
'@babel/preset-env',
{
targets: {
ie: 9,
chrome: 47,
},
},
],
'@babel/preset-typescript',
];
const plugins = [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
'@babel/plugin-proposal-class-properties',
];
return {
presets,
plugins,
};
};
module.exports = require('@fui/babel-preset-fineui').configs.base;

6
src/web/index.html

@ -6,7 +6,7 @@
<!--核心css文件-->
<link
rel="preload"
href="./node_modules/fineui/dist/font/iconfont.woff"
href="./node_modules/@fui/core/dist/font/iconfont.woff"
as="font"
type="font/woff"
crossorigin=""
@ -14,7 +14,7 @@
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui/dist/2.0/fineui.min.css"
href="./node_modules/@fui/core/dist/2.0/fineui.min.css"
/>
<link
rel="stylesheet"
@ -26,7 +26,7 @@
<body id="body">
<div id="wrapper"></div>
<script src="./assets/scripts/dec.js"></script>
<script src="./node_modules/fineui/dist/fineui.js"></script>
<script src="./node_modules/@fui/core/dist/fineui.js"></script>
<script src="./node_modules/@fui/materials/docs/materials.min.js"></script>
</body>
</html>

15
src/web/package.json

@ -7,11 +7,12 @@
"author": "alan",
"license": "MIT",
"dependencies": {
"@fui/materials": "^10.0.0",
"@fui/babel-preset-fineui": "^1.0.0",
"@fui/core": "^2.0.0",
"@fui/materials": "10.0.0-release - 10.0.0-release.99999999999999",
"@types/jss": "9.5.8",
"autoprefixer": "^9.6.1",
"es6-promise": "4.2.6",
"fineui": "^2.0.20200628140334",
"fork-ts-checker-webpack-plugin": "^1.5.1",
"jss": "9.8.7",
"jss-plugin-global": "10.0.0-alpha.7",
@ -20,15 +21,9 @@
"optimize-css-assets-webpack-plugin": "^5.0.3"
},
"devDependencies": {
"@babel/core": "7.4.5",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-proposal-decorators": "7.4.4",
"@babel/polyfill": "7.4.4",
"@babel/preset-env": "7.4.5",
"@babel/preset-typescript": "7.3.3",
"@types/jest": "24.0.11",
"@typescript-eslint/eslint-plugin": "1.7.0",
"@typescript-eslint/parser": "1.7.0",
"@typescript-eslint/eslint-plugin": "2.33.0",
"@typescript-eslint/parser": "2.33.0",
"axios": "0.18.0",
"babel-loader": "8.0.6",
"body-parser": "1.18.3",

4
src/web/src/index.edit.ts

@ -1,6 +1,6 @@
import { TableList } from './modules/table_list/table_list';
import { RedisEdit } from './modules/app.edit';
BI.createWidget({
type: TableList.xtype,
type: RedisEdit.xtype,
element: '#wrapper',
});

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,
});

2
src/web/src/less/background.less

@ -1,2 +1,2 @@
@import "../../node_modules/fineui/src/less/image.less";
@import "../../node_modules/@fui/core/src/less/image.less";
@import "./lib/background.less";

2
src/web/src/less/font.less

@ -1,4 +1,4 @@
@import "../../node_modules/fineui/src/less/resource/font.less";
@import "../../node_modules/@fui/core/src/less/resource/font.less";
@import "./lib/font.less";
.font(redis-refresh-font, @font-redis-refresh);

2
src/web/src/less/utils.less

@ -1 +1 @@
@import '../../node_modules/fineui/src/less/visual.less';
@import '../../node_modules/@fui/core/src/less/visual.less';

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

@ -1,12 +1,11 @@
import { shortcut, store } from '@core/core';
import { VerticalXtype, HtapeXtype, LabelXtype, IconComboXtype, ComponentsStyleTable, ButtonXtype, IconTextValue_Combo, TextAreaEditorXtype } from 'ui';
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)
@ -44,13 +43,14 @@ 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: HtapeXtype,
type: BI.HTapeLayout.xtype,
tgap: 15,
items: [{
el: {
@ -63,24 +63,24 @@ export class RedisDataset extends BI.Widget {
},
width: 300,
}, {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
lgap: 5,
bgap: 10,
items: [{
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 22,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_DB_Index'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
el: {
type: IconComboXtype,
type: BI.IconCombo.xtype,
height: 22,
width: 28,
value: inputType,
@ -116,22 +116,22 @@ export class RedisDataset extends BI.Widget {
}],
}],
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 200,
rgap: 5,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Query_Condition'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: TextAreaEditorXtype,
type: BI.TextAreaEditor.xtype,
cls: 'bi-border',
height: 200,
allowBlank: true,
value: query,
value: plainQuery,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -144,17 +144,17 @@ export class RedisDataset extends BI.Widget {
}],
}],
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 24,
rgap: 5,
items: [{
type: LabelXtype,
type: BI.Label.xtype,
height: 24,
text: BI.i18nText('Plugin-Redis_Set_Parameter'),
textAlign: 'left',
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
text: BI.i18nText('Plugin-Redis_Refresh'),
level: 'ignore',
handler: () => {
@ -167,7 +167,7 @@ export class RedisDataset extends BI.Widget {
width: 80,
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
text: BI.i18nText('Plugin-Redis_Preview'),
disabled: !BI.get(this.model, 'ableSave'),
handler: () => {
@ -180,13 +180,13 @@ export class RedisDataset extends BI.Widget {
width: 80,
}],
}, {
type: ComponentsStyleTable,
type: BI.StyleTable.xtype,
cls: 'param-table',
height: 200,
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -196,22 +196,22 @@ export class RedisDataset extends BI.Widget {
private renderItems() {
const self = this;
return this.model.parameters.map((item, index) => [{
type: LabelXtype,
type: BI.Label.xtype,
text: item.name,
textAlign: 'left',
height: 30,
lgap: 10,
}, {
type: IconTextValue_Combo,
type: BI.IconTextValueCombo.xtype,
cls: 'field-type-change',
height: 30,
items: redisField,
value: item.type,
listeners: [{
eventName: BI.IconTextValueCombo.EVENT_CHANGE,
action () {
action() {
self.store.setParamType(index, this.getValue()[0]);
},
}],
@ -228,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,
};
}

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

@ -1,6 +1,5 @@
import { shortcut } from '@core/core';
import { POOL_CONFIG, PROXY_CONFIG, BASIC_CONFIG, CONNECT_CHARSET } from '@constants/constant';
import { VerticalXtype, TextEditorXtype, TextValueComboXtype, LeftXtype, TextButtonXtype, BarPopOverXtype, EditorXtype } from 'ui';
import { FormItem } from './components/form_item/form_item';
import { PoolEdit } from './components/pool/pool_edit';
import { ProxyEdit } from './components/proxy/proxy_edit';
@ -43,7 +42,7 @@ export class RedisEdit extends BI.Widget {
this.oldPassword = password;
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -51,7 +50,7 @@ export class RedisEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Host'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
ref: _ref => {
@ -64,7 +63,7 @@ export class RedisEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Port'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
ref: _ref => {
@ -77,7 +76,7 @@ export class RedisEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Password'),
forms: [{
type: EditorXtype,
type: BI.Editor.xtype,
cls: 'bi-border',
height: 20,
width: 300,
@ -90,17 +89,17 @@ export class RedisEdit extends BI.Widget {
}],
},
{
type: LeftXtype,
type: BI.FloatLeftLayout.xtype,
hgap: 20,
items: [
{
type: TextButtonXtype,
type: BI.TextButton.xtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Pool_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BarPopOverXtype,
type: BI.BarPopover.xtype,
width: 500,
height: 320,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -121,13 +120,13 @@ export class RedisEdit extends BI.Widget {
},
},
{
type: TextButtonXtype,
type: BI.TextButton.xtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Proxy_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BarPopOverXtype,
type: BI.BarPopover.xtype,
width: 650,
height: 320,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -153,7 +152,7 @@ export class RedisEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Connection_Form_OriginalCharsetName'),
forms: [{
type: TextValueComboXtype,
type: BI.TextValueCombo.xtype,
width: 300,
value: originalCharsetName ? originalCharsetName : '',
items: CONNECT_CHARSET,

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

@ -1,12 +1,11 @@
import { shortcut, store } from '@core/core';
import { VerticalXtype, HtapeXtype, LabelXtype, IconComboXtype, TextValueComboXtype, TextAreaEditorXtype, ComponentsStyleTable, ButtonXtype, IconTextValue_Combo } from 'ui';
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)
@ -47,12 +46,19 @@ 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: HtapeXtype,
type: BI.HTapeLayout.xtype,
tgap: 15,
items: [{
el: {
@ -65,24 +71,24 @@ export class RedisProgram extends BI.Widget {
},
width: 300,
}, {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
lgap: 5,
bgap: 10,
items: [{
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 22,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_DB_Index'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
el: {
type: IconComboXtype,
type: BI.IconCombo.xtype,
height: 22,
width: 28,
value: inputType,
@ -118,18 +124,18 @@ export class RedisProgram extends BI.Widget {
}],
}],
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 22,
rgap: 5,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Script_Engine_Type'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: TextValueComboXtype,
type: BI.TextValueCombo.xtype,
value: engineType,
ref: (_ref: any) => {
this.engineTypeSelect = _ref;
@ -143,22 +149,22 @@ export class RedisProgram extends BI.Widget {
}],
}],
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 200,
rgap: 5,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Script_Query_Text'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: TextAreaEditorXtype,
type: BI.TextAreaEditor.xtype,
cls: 'bi-border',
height: 200,
allowBlank: true,
value: script,
value: plainScript,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -171,17 +177,17 @@ export class RedisProgram extends BI.Widget {
}],
}],
}, {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
height: 24,
rgap: 5,
items: [{
type: LabelXtype,
type: BI.Label.xtype,
height: 24,
text: BI.i18nText('Plugin-Redis_Set_Parameter'),
textAlign: 'left',
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
text: BI.i18nText('Plugin-Redis_Refresh'),
level: 'ignore',
handler: () => {
@ -194,7 +200,7 @@ export class RedisProgram extends BI.Widget {
width: 80,
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
text: BI.i18nText('Plugin-Redis_Preview'),
disabled: !BI.get(this.model, 'ableSave'),
handler: () => {
@ -207,13 +213,13 @@ export class RedisProgram extends BI.Widget {
width: 80,
}],
}, {
type: ComponentsStyleTable,
type: BI.StyleTable.xtype,
cls: 'param-table',
height: 200,
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -223,27 +229,27 @@ export class RedisProgram extends BI.Widget {
private renderItems() {
const self = this;
return this.model.parameters.map((item, index) => [{
type: LabelXtype,
type: BI.Label.xtype,
text: item.name,
textAlign: 'left',
height: 30,
lgap: 10,
}, {
type: IconTextValue_Combo,
type: BI.IconTextValueCombo.xtype,
cls: 'field-type-change',
height: 30,
items: redisField,
value: item.type,
listeners: [{
eventName: BI.IconTextValueCombo.EVENT_CHANGE,
action () {
action() {
self.store.setParamType(index, this.getValue()[0]);
},
}],
}, {
type: LabelXtype,
type: BI.Label.xtype,
text: item.name,
textAlign: 'left',
height: 30,
@ -252,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);
}
@ -261,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,
};

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

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { LabelXtype, VerticalXtype, LeftXtype, TextButtonXtype, BarPopOverXtype } from 'ui';
import { FormItem } from './components/form_item/form_item';
import { PoolConfig } from './components/pool/pool';
import { ProxyConfig } from './components/proxy/proxy';
@ -29,7 +28,7 @@ export class RedisShow extends BI.Widget {
const { host, port, newCharsetName } = basicConfig;
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -37,7 +36,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Host'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: host,
}],
},
@ -45,7 +44,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Port'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: port,
}],
},
@ -53,22 +52,22 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Password'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: '*****',
}],
},
{
type: LeftXtype,
type: BI.FloatLeftLayout.xtype,
hgap: 20,
items: [
{
type: TextButtonXtype,
type: BI.TextButton.xtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Pool_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BarPopOverXtype,
type: BI.BarPopover.xtype,
width: 400,
height: 300,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -81,13 +80,13 @@ export class RedisShow extends BI.Widget {
},
},
{
type: TextButtonXtype,
type: BI.TextButton.xtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Proxy_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BarPopOverXtype,
type: BI.BarPopover.xtype,
width: 650,
height: 280,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -105,7 +104,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Connection_Form_OriginalCharsetName'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: newCharsetName ? newCharsetName : BI.i18nText('BI-Basic_Auto'),
}],
},

8
src/web/src/modules/components/database_index/database_index.service.ts

@ -1,4 +1,4 @@
import { BarPopoverXtype } from 'ui';
import { FormulaOpeartingPanel } from '@fui/materials';
import { fetchFormulaConfig } from '../../crud/crud.request';
/**
@ -8,17 +8,17 @@ export function openFormulaPopover<T extends {formula: string}>(value: T, insert
return new Promise((resolve, reject) => {
const id = BI.UUID();
let formulaPane: typeof BI.FormulaOpeartingPanel;
let formulaPane: FormulaOpeartingPanel;
BI.Popovers.create(id, {
type: BarPopoverXtype,
type: BI.BarPopover.xtype,
width: 900,
height: 600,
header: BI.i18nText('Plugin-JSON_Function_Definition'),
body: {
type: BI.FormulaOpeartingPanel.xtype,
configLoader: fetchFormulaConfig,
ref: (_ref: typeof BI.FormulaOpeartingPanel) => {
ref: (_ref: FormulaOpeartingPanel) => {
formulaPane = _ref;
},
inserterType,

7
src/web/src/modules/components/database_index/database_index.ts

@ -1,5 +1,4 @@
import { shortcut, store } from '@core/core';
import { TabXtype, TextEditorXtype } from 'ui';
import { DatabaseIndexModel } from './database_index.model';
import { openFormulaPopover } from './database_index.service';
@ -26,7 +25,7 @@ export class DatabaseIndex extends BI.Widget {
this.store.setInputType(inputType);
return {
type: TabXtype,
type: BI.Tab.xtype,
single: true,
showIndex: this.model.inputType,
ref: (_ref: any) => {
@ -35,7 +34,7 @@ export class DatabaseIndex extends BI.Widget {
cardCreator: (index: 'int'|'formula') => {
if (index === 'int') {
return {
type: TextEditorXtype,
type: BI.TextEditor.xtype,
warningTitle: '',
value: parseInt(this.model.inputValue as string, 10) || 0,
validationChecker: (v: string) => this.checkInteger(v),
@ -53,7 +52,7 @@ export class DatabaseIndex extends BI.Widget {
}
return {
type: TextEditorXtype,
type: BI.TextEditor.xtype,
allowBlank: true,
value: this.model.inputValue,
ref: (_ref: any) => {

5
src/web/src/modules/components/form_item/form_item.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { LabelXtype, LeftXtype } from 'ui';
@shortcut()
export class FormItem extends BI.Widget {
@ -13,10 +12,10 @@ export class FormItem extends BI.Widget {
render () {
return {
type: LeftXtype,
type: BI.FloatLeftLayout.xtype,
items: [
{
type: LabelXtype,
type: BI.Label.xtype,
cls: 'bi-font-bold',
width: this.options.nameWidth,
textAlign: 'left',

15
src/web/src/modules/components/pool/pool.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { LabelXtype, VerticalXtype, MultiSelectItemXtype } from 'ui';
import { POOL_CONFIG } from '@constants/constant';
import { FormItem } from '../form_item/form_item';
@shortcut()
@ -16,7 +15,7 @@ export class PoolConfig extends BI.Widget {
const { maxTotal, maxWait, maxIdle, blockWhenExhausted, lifo, timeout } = this.options.poolConfig;
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -24,7 +23,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Total'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: maxTotal,
}],
},
@ -32,7 +31,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Wait'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: maxWait,
}],
},
@ -40,7 +39,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Idle'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: maxIdle,
}],
},
@ -48,7 +47,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Block_When_Exhausted'),
forms: [{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
selected: blockWhenExhausted,
}],
},
@ -56,7 +55,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Lifo'),
forms: [{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
selected: lifo,
}],
},
@ -64,7 +63,7 @@ export class PoolConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Timeout'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: timeout,
}],
},

15
src/web/src/modules/components/pool/pool_edit.ts

@ -1,5 +1,4 @@
import { shortcut, store } from '@core/core';
import { VerticalXtype, MultiSelectItemXtype, TextEditorXtype } from 'ui';
import { POOL_CONFIG } from '@constants/constant';
import { FormItem } from '../form_item/form_item';
import { PoolEditModel } from './pool_edit.model';
@ -33,7 +32,7 @@ export class PoolEdit extends BI.Widget {
this.store.setLifo(lifo);
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -41,7 +40,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Total'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: maxTotal,
@ -54,7 +53,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Wait'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: maxWait,
@ -67,7 +66,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Max_Idle'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: maxIdle,
@ -80,7 +79,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Block_When_Exhausted'),
forms: [{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
selected: blockWhenExhausted,
ref: (_ref: any) => {
this.form.blockWhenExhausted = _ref;
@ -94,7 +93,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Lifo'),
forms: [{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
selected: lifo,
ref: (_ref: any) => {
this.form.lifo = _ref;
@ -108,7 +107,7 @@ export class PoolEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Pool_Timeout'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: timeout,

19
src/web/src/modules/components/proxy/proxy.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { LabelXtype, VerticalXtype, MultiSelectItemXtype, CenterAdaptXtype } from 'ui';
import { PROXY_CONFIG } from '@constants/constant';
import { FormItem } from '../form_item/form_item';
@shortcut()
@ -16,7 +15,7 @@ export class ProxyConfig extends BI.Widget {
const { open, host, port, username, password, privateKeyPath } = this.options.proxyConfig;
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -24,14 +23,14 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Open'),
forms: [{
type: CenterAdaptXtype,
type: BI.CenterAdaptLayout.xtype,
items: [
{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
width: 30,
selected: open,
}, {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Proxy_Description'),
},
],
@ -41,7 +40,7 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Host'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: host,
}],
},
@ -49,7 +48,7 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Port'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: port,
}],
},
@ -57,7 +56,7 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Username'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: username,
}],
},
@ -65,7 +64,7 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Password'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: password,
}],
},
@ -73,7 +72,7 @@ export class ProxyConfig extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Private_Key_Path'),
forms: [{
type: LabelXtype,
type: BI.Label.xtype,
text: privateKeyPath,
}],
},

19
src/web/src/modules/components/proxy/proxy_edit.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { LabelXtype, VerticalXtype, MultiSelectItemXtype, CenterAdaptXtype, TextEditorXtype, EditorXtype } from 'ui';
import { PROXY_CONFIG } from '@constants/constant';
import { FormItem } from '../form_item/form_item';
@shortcut()
@ -30,7 +29,7 @@ export class ProxyEdit extends BI.Widget {
this.oldPassword = password;
return {
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
hgap: 15,
vgap: 10,
items: [
@ -38,17 +37,17 @@ export class ProxyEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Open'),
forms: [{
type: CenterAdaptXtype,
type: BI.CenterAdaptLayout.xtype,
items: [
{
type: MultiSelectItemXtype,
type: BI.MultiSelectItem.xtype,
width: 30,
selected: this.isOpen,
handler: () => {
this.isOpen = !this.isOpen;
},
}, {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Proxy_Description'),
},
],
@ -58,7 +57,7 @@ export class ProxyEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Host'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: host,
@ -71,7 +70,7 @@ export class ProxyEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Port'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: port,
@ -84,7 +83,7 @@ export class ProxyEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Username'),
forms: [{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: username,
@ -97,7 +96,7 @@ export class ProxyEdit extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Proxy_Password'),
forms: [{
type: EditorXtype,
type: BI.Editor.xtype,
cls: 'bi-border',
width: 300,
height: 20,
@ -114,7 +113,7 @@ export class ProxyEdit extends BI.Widget {
name: BI.i18nText('Plugin-Redis_Proxy_Private_Key_Path'),
forms: [
{
type: TextEditorXtype,
type: BI.TextEditor.xtype,
width: 300,
allowBlank: true,
value: privateKeyPath,

9
src/web/src/modules/table_list/list_item.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { HtapeXtype, IconLabelXtype, LabelXtype } from 'ui';
@shortcut()
export class ListItem extends BI.BasicButton {
static xtype = 'dec.dcm.connection.plugin.redis.table_list.list_item'
@ -13,22 +12,22 @@ export class ListItem extends BI.BasicButton {
const { text, showIcon } = this.options;
if(showIcon){
return {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
el: {
type: IconLabelXtype,
type: BI.IconLabel.xtype,
cls: 'redis-column-font',
},
width: 25,
}, {
type: LabelXtype,
type: BI.Label.xtype,
textAlign: 'left',
text,
}],
};
}else{
return {
type: LabelXtype,
type: BI.Label.xtype,
textAlign: 'left',
lgap: 5,
text,

25
src/web/src/modules/table_list/table_list.ts

@ -1,5 +1,4 @@
import { shortcut, store } from '@core/core';
import { VtapeXtype, HtapeXtype, LabelXtype, IconButtonXtype, TextValueComboXtype, ButtonXtype, TextEditorXtype, ButtonGroupXtype, VerticalXtype } from 'ui';
import { ListItem } from './list_item';
import { TableModelModel } from './table_list.model';
import { fineServletURL } from '@constants/env';
@ -47,14 +46,14 @@ export class TableList extends BI.Widget {
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
return {
type: VtapeXtype,
type: BI.VTapeLayout.xtype,
hgap: 10,
bgap: 5,
items: [{
el: {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
type: TextValueComboXtype,
type: BI.TextValueCombo.xtype,
ref: (_ref: any) => {
this.connectionTextValue = _ref;
},
@ -68,7 +67,7 @@ export class TableList extends BI.Widget {
}],
}, {
el: {
type: IconButtonXtype,
type: BI.IconButton.xtype,
cls: 'redis-site-font',
title: BI.i18nText('Plugin-Redis_Data_Connection'),
handler: () => {
@ -78,7 +77,7 @@ export class TableList extends BI.Widget {
width: 25,
}, {
el: {
type: IconButtonXtype,
type: BI.IconButton.xtype,
cls: 'redis-refresh-font',
title: BI.i18nText('Plugin-Redis_Refresh'),
handler: () => {
@ -91,10 +90,10 @@ export class TableList extends BI.Widget {
height: 25,
}, {
el: {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
el: {
type: LabelXtype,
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Index'),
textAlign: 'left',
},
@ -109,7 +108,7 @@ export class TableList extends BI.Widget {
width: 24,
height: 22,
}, {
type: TextEditorXtype,
type: BI.TextEditor.xtype,
height: 24,
watermark: BI.i18nText('Plugin-Redis_Keys_Pattern'),
ref: (_ref: any) => {
@ -117,7 +116,7 @@ export class TableList extends BI.Widget {
},
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
minWidth: 50,
text: BI.i18nText('Plugin-Redis_Keys_Pattern_Search'),
handler: () => {
@ -129,12 +128,12 @@ export class TableList extends BI.Widget {
},
height: 25,
}, {
type: VtapeXtype,
type: BI.VTapeLayout.xtype,
items: [{
type: ButtonGroupXtype,
type: BI.ButtonGroup.xtype,
chooseType: BI.Selection.None,
layouts: [{
type: VerticalXtype,
type: BI.VerticalLayout.xtype,
}],
items: [],
ref: (_ref: any) => {

81
src/web/src/ui/fineui.ts

@ -1,81 +0,0 @@
export const IconXtype = 'bi.icon';
export const IconTextItemXtype = 'bi.icon_text_item';
export const IconTextIconItemXtype = 'bi.icon_text_icon_item';
export const IconButtonXtype = 'bi.icon_button';
export const IconChangeButtonXtype = 'bi.icon_change_button';
export const TextButtonXtype = 'bi.text_button';
export const DownListComboXtype = 'bi.down_list_combo';
export const LabelXtype = 'bi.label';
export const SmallTextEditorXtype = 'bi.small_text_editor';
export const MultiFileEditorXtype = 'bi.multifile_editor';
export const SignEditorXtype = 'bi.sign_editor';
export const ButtonXtype = 'bi.button';
export const TextEditorXtype = 'bi.text_editor';
export const MultiSelectInsertComboXtype = 'bi.multi_select_insert_combo';
export const MultiSelectComboXtype = 'bi.multi_select_combo';
export const ButtonGroupXtype = 'bi.button_group';
export const AllValueChooserComboXtype = 'bi.all_value_chooser_combo';
export const TextAreaEditorXtype = 'bi.textarea_editor';
export const MultiSelectItemXtype = 'bi.multi_select_item';
export const BarPopOverXtype = 'bi.bar_popover';
export const DynamicDateComboXtype = 'bi.dynamic_date_combo';
export const DynamicDateTimeComboXtype = 'bi.dynamic_date_time_combo';
export const MultiTreeComboXtype = 'bi.multi_tree_combo';
export const RichEditorXtype = 'bi.rich_editor';
export const NicEditorXtype = 'bi.nic_editor';
export const EditorXtype = 'bi.editor';
export const MultiTreePopupViewXtype = 'bi.multi_tree_popup_view';
export const SingleSelectRadioItemXtype = 'bi.single_select_radio_item';
export const SingleSelectInsertComboXtype = 'bi.single_select_insert_combo';
export const SingleSelectComboXtype = 'bi.single_select_combo';
export const TabXtype = 'bi.tab';
export const DynamicYearMonthComboXtype = 'bi.dynamic_year_month_combo';
export const TextXtype = 'bi.text';
export const ComboXtype = 'bi.combo';
export const TimeComboXtype = 'bi.time_combo';
export const IFrameXtype = 'bi.iframe';
export const MultiTreeInsertComboXtype = 'bi.multi_tree_insert_combo';
export const MultiTreeListComboXtype = 'bi.multi_tree_list_combo';
export const MultilayerSingleTreeComboXtype = 'bi.multilayer_single_tree_combo';
export const MultilayerSelectTreeComboXtype = 'bi.multilayer_select_tree_combo';
export const AsyncTreeXtype = 'bi.async_tree';
export const ListAsyncTreeXtype = 'bi.list_async_tree';
export const MultilayerSingleTreePopupXtype = 'bi.multilayer_single_tree_popup';
export const MultilayerSelectTreePopupXtype = 'bi.multilayer_select_tree_popup';
export const IconLabelXtype = 'bi.icon_label';
export const RadioXtype = 'bi.radio';
export const LinearSegmentXtype = 'bi.linear_segment';
export const SearchEditorXtype = 'bi.search_editor';
export const ImgXtype = 'bi.img';
export const BubbleComboXtype = 'bi.bubble_combo';
export const TextBubblePopupBarViewXtype = 'bi.text_bubble_bar_popup_view';
export const TextValueComboXtype = 'bi.text_value_combo';
export const FileXtype = 'bi.file';
export const IconComboXtype = 'bi.icon_combo';
export const NumberEditorXtype = 'bi.number_editor';
export const CodeEditorXtype = 'bi.code_editor';
export const ComponentsStyleTable = 'bi.components.style_table';
export const IconTextValue_Combo = 'bi.icon_text_value_combo';
export const BarPopoverXtype = 'bi.bar_popover';
// 布局
export const VerticalAdaptXtype = 'bi.vertical_adapt';
export const VtapeXtype = 'bi.vtape';
export const CenterAdaptXtype = 'bi.center_adapt';
export const HtapeXtype = 'bi.htape';
export const LayoutXtype = 'bi.layout';
export const AbsoluteXtype = 'bi.absolute';
export const VerticalXtype = 'bi.vertical';
export const LeftXtype = 'bi.left';
export const RightXtype = 'bi.right';
export const HorizontalAdaptXtype = 'bi.horizontal_adapt';
export const AbsoluteCenterAdaptXtype = 'bi.absolute_center_adapt';
export const TableAdaptXtype = 'bi.table_adapt';
export const RightVerticalAdaptXtype = 'bi.right_vertical_adapt';
export const LeftRightVerticalAdaptXtype = 'bi.left_right_vertical_adapt';
export const ListViewXtype = 'bi.list_view';
export const VirtualGroupXtype = 'bi.virtual_group';
export const HorizotalAutoXtype = 'bi.horizontal_auto';
export const HorizotalXtype = 'bi.horizontal';
export const FloatCenterXtype = 'bi.float_center';
export const LeftRightVerticalAdaptLayoutXtype = 'bi.left_right_vertical_adapt';

1
src/web/src/ui/index.ts

@ -1 +0,0 @@
export * from './fineui';

1
src/web/tsconfig.json

@ -18,6 +18,7 @@
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noImplicitReturns": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"ui": ["./src/ui"],

2
src/web/types/globals.d.ts vendored

@ -2,7 +2,7 @@ interface Obj {
[key: string]: any;
}
declare let BI: Obj & import('fineui').BI & import('fineui-materials').BI;
declare let BI: Obj & import('@fui/core').BI & import('@fui/materials').BI;
declare const Fix: Obj;
declare const DecCst: Obj;
declare const Dec: Obj;

2
src/web/webpack/webpack.common.js

@ -49,7 +49,7 @@ module.exports = {
options: {
plugins: [vars({
variables: {
fontUrl: '../node_modules/fineui/dist/font/',
fontUrl: '../node_modules/@fui/core/dist/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',
}

Loading…
Cancel
Save