Compare commits

..

No commits in common. 'master' and 'master' have entirely different histories.

  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,16 +3,12 @@
<id>com.fr.solution.plugin.db.redis.v10</id>
<name><![CDATA[Redis数据集]]></name>
<active>yes</active>
<version>7.4.3</version>
<version>7.3.6</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.jpg";
return "/com/fr/plugin/db/redis/images/redis.png";
}
@Override
@ -44,9 +44,7 @@ public class RedisUniversalConnectionImpl extends AbstractUniversalConnectionPro
public JSONObject serialize(RedisDatabaseConnection connection) {
JSONObject jsonObject = new JSONObject();
try {
JSONObject basicInfo = JSONObject.mapFrom(connection.clone());
basicInfo.put("password", DecisionServiceConstants.DEFAULT_PASSWORD);
jsonObject.put(BASIC_INFO, basicInfo);
jsonObject.put(BASIC_INFO, JSONObject.mapFrom(connection.clone()));
//将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,9 +1,7 @@
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;
@ -63,7 +61,7 @@ public class ParameterBean {
public static ParameterBean createBean(ParameterProvider parameterProvider) {
if (parameterProvider.getValue() != null) {
return new ParameterBean(parameterProvider.getValue().getClass().getSimpleName(), parameterProvider.getName(), GeneralKit.objectToString(parameterProvider.getValue()));
return new ParameterBean(parameterProvider.getValue().getClass().getSimpleName(), parameterProvider.getName(), parameterProvider.valueToString());
} else {
return new ParameterBean(String.class.getSimpleName(), parameterProvider.getName(), StringKit.EMPTY);
}

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

@ -26,7 +26,6 @@ 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() {
@ -56,13 +55,6 @@ 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 {
@ -79,7 +71,7 @@ public class RedisDatabaseConnection extends BaseConnection {
}
public Redis createRedisClient() {
return RedisPool.getFinal(isCluster(), getHost(), getPort(), getPassword());
return RedisPool.getFinal(getHost(), getPort(), getPassword());
}
@Override
@ -159,7 +151,6 @@ public class RedisDatabaseConnection extends BaseConnection {
if (StringKit.isNotEmpty(pwd)) {
setPassword(SecurityKit.encrypt(pwd));
}
setCluster(reader.getAttrAsBoolean("cluster", false));
}
}
}
@ -173,17 +164,15 @@ 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 = (RedisDatabaseConnection) super.clone();
com.fr.plugin.db.redis.core.RedisDatabaseConnection cloned = (com.fr.plugin.db.redis.core.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,11 +61,9 @@ public class RedisPool {
jedisPoolMap.clear();
}
public static Redis getFinal(boolean isCluster, String host, String port, String password) {
public static Redis getFinal(String host, String port, String password) {
List<Pair<String, Integer>> pairs = findAllHostAndPassword(host, port);
if (isCluster) {
return pool.getJedisCluster(pairs, password);
} else if (pairs.size() == 1) {
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,6 +34,7 @@ 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,7 +4,6 @@ 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;
@ -32,7 +31,6 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
private UITextField hostTextField;
private UITextField portNumberField;
private UIPasswordField passwordTextField;
private UICheckBox clusterModeCheckBox;
@Override
@ -42,7 +40,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);
@ -65,11 +63,7 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
Component[][] components = new Component[][]{
{new UILabel(DesignKit.i18nText("Plugin-Redis_Host") + ":"),
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER,
GUICoreKit.createBorderLayoutPane(
clusterModeCheckBox, BorderLayout.CENTER,
helpButton, BorderLayout.EAST
), BorderLayout.EAST)},
GUICoreKit.createBorderLayoutPane(hostTextField, BorderLayout.CENTER, helpButton, BorderLayout.EAST)},
{new UILabel(DesignKit.i18nText("Plugin-Redis_Port") + ":"), portNumberField},
{new UILabel(DesignKit.i18nText("Plugin-Redis_Password") + ":"), passwordTextField},
{null, globalConfigPane}
@ -141,7 +135,6 @@ public class RedisConnectionPane extends DatabaseConnectionPane<RedisDatabaseCon
hostTextField.setText(ob.getHost());
portNumberField.setText(ob.getPort());
passwordTextField.setText(ob.getPassword());
clusterModeCheckBox.setSelected(ob.isCluster());
}
@Override
@ -150,7 +143,6 @@ 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.

Before

Width:  |  Height:  |  Size: 6.5 KiB

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

@ -39,4 +39,3 @@ 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,7 +39,6 @@ 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,7 +39,6 @@ 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
@ -61,8 +60,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 +1,29 @@
module.exports = require('@fui/babel-preset-fineui').configs.base;
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,
};
};

6
src/web/index.html

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

15
src/web/package.json

@ -7,12 +7,11 @@
"author": "alan",
"license": "MIT",
"dependencies": {
"@fui/babel-preset-fineui": "^1.0.0",
"@fui/core": "^2.0.0",
"@fui/materials": "10.0.0-release - 10.0.0-release.99999999999999",
"@fui/materials": "^10.0.0",
"@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",
@ -21,9 +20,15 @@
"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": "2.33.0",
"@typescript-eslint/parser": "2.33.0",
"@typescript-eslint/eslint-plugin": "1.7.0",
"@typescript-eslint/parser": "1.7.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 { RedisEdit } from './modules/app.edit';
import { TableList } from './modules/table_list/table_list';
BI.createWidget({
type: RedisEdit.xtype,
type: TableList.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.jpg',
iconUrl: 'com/fr/plugin/db/redis/images/redis.png',
edit: RedisEdit.xtype,
show: RedisShow.xtype,
});

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

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

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

@ -1,4 +1,4 @@
@import "../../node_modules/@fui/core/src/less/resource/font.less";
@import "../../node_modules/fineui/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/@fui/core/src/less/visual.less';
@import '../../node_modules/fineui/src/less/visual.less';

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

@ -1,11 +1,12 @@
import {shortcut, store} from '@core/core';
import {TableList} from './table_list/table_list';
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 '../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,14 +44,13 @@ 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);
const plainQuery = BI.Providers.getProvider("dec.provider.cipher").getPlain(query);
this.store.setAbleSave(!!plainQuery);
this.store.setAbleSave(!!query);
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
return {
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
tgap: 15,
items: [{
el: {
@ -63,24 +63,24 @@ export class RedisDataset extends BI.Widget {
},
width: 300,
}, {
type: BI.VerticalLayout.xtype,
type: VerticalXtype,
lgap: 5,
bgap: 10,
items: [{
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
height: 22,
items: [{
el: {
type: BI.Label.xtype,
type: LabelXtype,
text: BI.i18nText('Plugin-Redis_DB_Index'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
items: [{
el: {
type: BI.IconCombo.xtype,
type: IconComboXtype,
height: 22,
width: 28,
value: inputType,
@ -116,22 +116,22 @@ export class RedisDataset extends BI.Widget {
}],
}],
}, {
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
height: 200,
rgap: 5,
items: [{
el: {
type: BI.Label.xtype,
type: LabelXtype,
text: BI.i18nText('Plugin-Redis_Query_Condition'),
textAlign: 'left',
},
width: this.textWidth,
}, {
type: BI.TextAreaEditor.xtype,
type: TextAreaEditorXtype,
cls: 'bi-border',
height: 200,
allowBlank: true,
value: plainQuery,
value: query,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -144,17 +144,17 @@ export class RedisDataset extends BI.Widget {
}],
}],
}, {
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
height: 24,
rgap: 5,
items: [{
type: BI.Label.xtype,
type: LabelXtype,
height: 24,
text: BI.i18nText('Plugin-Redis_Set_Parameter'),
textAlign: 'left',
}, {
el: {
type: BI.Button.xtype,
type: ButtonXtype,
text: BI.i18nText('Plugin-Redis_Refresh'),
level: 'ignore',
handler: () => {
@ -167,7 +167,7 @@ export class RedisDataset extends BI.Widget {
width: 80,
}, {
el: {
type: BI.Button.xtype,
type: ButtonXtype,
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: BI.StyleTable.xtype,
type: ComponentsStyleTable,
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: BI.Label.xtype,
type: LabelXtype,
text: item.name,
textAlign: 'left',
height: 30,
lgap: 10,
}, {
type: BI.IconTextValueCombo.xtype,
type: IconTextValue_Combo,
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: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()),
query: this.queryCondition.getValue(),
parameters: this.model.parameters,
};
}

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

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

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

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

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

@ -1,4 +1,5 @@
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';
@ -28,7 +29,7 @@ export class RedisShow extends BI.Widget {
const { host, port, newCharsetName } = basicConfig;
return {
type: BI.VerticalLayout.xtype,
type: VerticalXtype,
hgap: 15,
vgap: 10,
items: [
@ -36,7 +37,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Host'),
forms: [{
type: BI.Label.xtype,
type: LabelXtype,
text: host,
}],
},
@ -44,7 +45,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Port'),
forms: [{
type: BI.Label.xtype,
type: LabelXtype,
text: port,
}],
},
@ -52,22 +53,22 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Password'),
forms: [{
type: BI.Label.xtype,
type: LabelXtype,
text: '*****',
}],
},
{
type: BI.FloatLeftLayout.xtype,
type: LeftXtype,
hgap: 20,
items: [
{
type: BI.TextButton.xtype,
type: TextButtonXtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Pool_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BI.BarPopover.xtype,
type: BarPopOverXtype,
width: 400,
height: 300,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -80,13 +81,13 @@ export class RedisShow extends BI.Widget {
},
},
{
type: BI.TextButton.xtype,
type: TextButtonXtype,
cls: 'bi-high-light',
text: BI.i18nText('Plugin-Redis_Proxy_Config'),
handler: () => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: BI.BarPopover.xtype,
type: BarPopOverXtype,
width: 650,
height: 280,
header: BI.i18nText('Plugin-Redis_Pool_Config'),
@ -104,7 +105,7 @@ export class RedisShow extends BI.Widget {
type: FormItem.xtype,
name: BI.i18nText('Plugin-Redis_Connection_Form_OriginalCharsetName'),
forms: [{
type: BI.Label.xtype,
type: LabelXtype,
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 { FormulaOpeartingPanel } from '@fui/materials';
import { BarPopoverXtype } from 'ui';
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: FormulaOpeartingPanel;
let formulaPane: typeof BI.FormulaOpeartingPanel;
BI.Popovers.create(id, {
type: BI.BarPopover.xtype,
type: BarPopoverXtype,
width: 900,
height: 600,
header: BI.i18nText('Plugin-JSON_Function_Definition'),
body: {
type: BI.FormulaOpeartingPanel.xtype,
configLoader: fetchFormulaConfig,
ref: (_ref: FormulaOpeartingPanel) => {
ref: (_ref: typeof BI.FormulaOpeartingPanel) => {
formulaPane = _ref;
},
inserterType,

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,4 +1,5 @@
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'
@ -12,22 +13,22 @@ export class ListItem extends BI.BasicButton {
const { text, showIcon } = this.options;
if(showIcon){
return {
type: BI.HTapeLayout.xtype,
type: HtapeXtype,
items: [{
el: {
type: BI.IconLabel.xtype,
type: IconLabelXtype,
cls: 'redis-column-font',
},
width: 25,
}, {
type: BI.Label.xtype,
type: LabelXtype,
textAlign: 'left',
text,
}],
};
}else{
return {
type: BI.Label.xtype,
type: LabelXtype,
textAlign: 'left',
lgap: 5,
text,

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

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

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

@ -0,0 +1,81 @@
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

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

1
src/web/tsconfig.json

@ -18,7 +18,6 @@
// "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('@fui/core').BI & import('@fui/materials').BI;
declare let BI: Obj & import('fineui').BI & import('fineui-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/@fui/core/dist/font/',
fontUrl: '../node_modules/fineui/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