Compare commits

...

41 Commits

Author SHA1 Message Date
richie 3f2e680b63 Merge pull request 'DEC-17971 feat: redis数据集加密' (#9) from dailer/demo-tabledata-redis:master into master 2 years ago
zsmj1994 03eac54abd DEC-17971 feat: redis数据集加密 4 years ago
operation e3fab11a21 Merge pull request 'DEC-17168 更换redis插件前端展示的图片' (#8) from alan/demo-tabledata-redis:master into master 4 years ago
alan 85b03e625d DEC-17168 更换redis插件的图片 4 years ago
operation 1edd7bac51 Merge pull request '更换平台图片' (#7) from Roger.Chen/demo-tabledata-redis:master into master 4 years ago
Roger.Chen c823a2940e DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 4 years ago
Roger.Chen e063102897 Merge branch 'master' of https://code.fanruan.com/Roger.Chen/demo-tabledata-redis 4 years ago
Roger.Chen c36533c0e7 DEC-17168 fix: 替换一下redis数据集的图片,之前那样替换会导致设计器图片变大 4 years ago
richie 9479176385 Merge pull request 'WIP:修改参数选择公式时的问题,并更换redis.png图片' (#5) from Roger.Chen/demo-tabledata-redis:master into master 4 years ago
Roger.Chen 967b3ae527 DEC-16606 fix: 平台数据集参数公式识别错误 使用fine-kitjar包中的类 4 years ago
Roger.Chen 34b349434d DEC-17168 fix: 替换一下redis数据集的图片 4 years ago
Roger.Chen a7e537312f DEC-16606 fix: 平台数据集参数公式识别错误 4 years ago
richie 428d99baa3 Merge pull request 'KERNEL-6540 类型引用规范化' (#3) from youki/demo-tabledata-redis:master into master 4 years ago
youki 151179763f KERNEL-6540 rafactor: 类型引用规范化 4 years ago
youki 4c1e427b20 KERNEL-6540 chore: 更新依赖配置 4 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
richie efc0bb85fc 打包脚本 5 years ago
richie 6cd8fabf35 REPORT-34809 参数没有动态计算的问题 5 years ago
richie 923290e4d2 Merge branch 'master' of Jimmy.Chai/demo-tabledata-redis into master 5 years ago
Jimmy.Chai f85211619d 报表平台支持键值按编号搜索 5 years ago
Jimmy.Chai 0d7c7f6deb 报表平台支持键值按编号搜索 5 years ago
Jimmy.Chai d60fc192cd Merge branch 'master' of https://git.fanruan.com/Jimmy.Chai/demo-tabledata-redis into refactor 5 years ago
Jimmy.Chai 16209de366 Merge branch 'master' of https://git.fanruan.com/fanruan/demo-tabledata-redis 5 years ago
richie 7308a07466 更新 5 years ago
richie 3a3124a20b 重复关闭redis连接的问题 5 years ago
Jimmy.Chai d898e82518 pull master 5 years ago
Jimmy.Chai a704a6c452 更新配置 5 years ago
richie c4b6a2c774 修复hkeys问题 5 years ago
richie 697e116b7e 一个引用的问题 5 years ago
richie 9b2c1b0dd5 redis连接没有关闭的问题 5 years ago
richie b2a1466484 readme 5 years ago
richie dfb28e10a4 打包脚本问题 5 years ago
richie 2e600bbe6c gradle构建 5 years ago
richie b119c21410 查key的时候可以选数据库 5 years ago
richie 99b14b115c gradle构建脚本 5 years ago
richie 55c724bb70 移除付费标记 5 years ago
richie a2b55fc862 redis集群问题 5 years ago
  1. 7
      .gitignore
  2. 128
      build.gradle
  3. 13
      encrypt.xml
  4. BIN
      gradle/wrapper/gradle-wrapper.jar
  5. 5
      gradle/wrapper/gradle-wrapper.properties
  6. 183
      gradlew
  7. 103
      gradlew.bat
  8. 15
      plugin.xml
  9. 4
      readme.md
  10. 5
      settings.gradle
  11. 3
      src/main/java/com/fr/plugin/db/redis/RedisLocaleFinder.java
  12. 6
      src/main/java/com/fr/plugin/db/redis/RedisUniversalConnectionImpl.java
  13. 5
      src/main/java/com/fr/plugin/db/redis/action/SearchKeysAction.java
  14. 4
      src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java
  15. 32
      src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java
  16. 6
      src/main/java/com/fr/plugin/db/redis/core/RedisPool.java
  17. 1
      src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java
  18. 18
      src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableDataModel.java
  19. 3
      src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java
  20. 8
      src/main/java/com/fr/plugin/db/redis/core/RedisTableDataModel.java
  21. 5
      src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java
  22. 2
      src/main/java/com/fr/plugin/db/redis/help/client/BaseRedisClient.java
  23. 12
      src/main/java/com/fr/plugin/db/redis/ui/RedisConnectionPane.java
  24. 14
      src/main/java/com/fr/plugin/db/redis/ui/RedisDBConnectionChosePane.java
  25. BIN
      src/main/resources/com/fr/plugin/db/redis/images/redis.jpg
  26. 2
      src/main/resources/com/fr/plugin/db/redis/locale/redis.properties
  27. 7
      src/main/resources/com/fr/plugin/db/redis/locale/redis_en_US.properties
  28. 38
      src/main/resources/com/fr/plugin/db/redis/locale/redis_zh_CN.properties
  29. 6
      src/main/resources/com/fr/plugin/db/redis/web/redis.js
  30. 1
      src/web/.npmrc
  31. 30
      src/web/babel.config.js
  32. 11
      src/web/index.html
  33. 17
      src/web/package.json
  34. 199
      src/web/private/i18n.ts
  35. 2
      src/web/src/index.ts
  36. 2
      src/web/src/less/background.less
  37. 2
      src/web/src/less/font.less
  38. 2
      src/web/src/less/utils.less
  39. 62
      src/web/src/modules/app.dataset.ts
  40. 21
      src/web/src/modules/app.edit.ts
  41. 76
      src/web/src/modules/app.program.ts
  42. 21
      src/web/src/modules/app.show.ts
  43. 8
      src/web/src/modules/components/database_index/database_index.service.ts
  44. 7
      src/web/src/modules/components/database_index/database_index.ts
  45. 5
      src/web/src/modules/components/form_item/form_item.ts
  46. 15
      src/web/src/modules/components/pool/pool.ts
  47. 15
      src/web/src/modules/components/pool/pool_edit.ts
  48. 19
      src/web/src/modules/components/proxy/proxy.ts
  49. 19
      src/web/src/modules/components/proxy/proxy_edit.ts
  50. 3
      src/web/src/modules/crud/crud.request.ts
  51. 9
      src/web/src/modules/table_list/list_item.ts
  52. 6
      src/web/src/modules/table_list/table_list.model.ts
  53. 53
      src/web/src/modules/table_list/table_list.ts
  54. 81
      src/web/src/ui/fineui.ts
  55. 1
      src/web/src/ui/index.ts
  56. 1
      src/web/tsconfig.json
  57. 2
      src/web/types/globals.d.ts
  58. 2
      src/web/webpack/webpack.common.js
  59. 67
      src/web/yarn.lock

7
.gitignore vendored

@ -2,4 +2,9 @@
.idea/
lib/report/*.jar
target/
.DS_Store
.DS_Store
.gradle
build
local.properties
classes/
transform-classes/

128
build.gradle

@ -0,0 +1,128 @@
apply plugin: 'java'
ext {
/**
* jar的路径
* 1.jar需要打包到zip中,lib根目录下
* 2.jar仅仅是编译时需要lib下子目录下即可
*/
libPath = "$projectDir/../webroot/WEB-INF/lib"
/**
* class进行加密保护
*/
guard = false
def pluginInfo = getPluginInfo()
pluginPre = "fine-plugin"
pluginName = pluginInfo.id
pluginVersion = pluginInfo.version
privateLib = "$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0"
outputPath = privateLib + "/classes"
}
group = 'com.fr.plugin'
version = '10.0'
sourceCompatibility = '8'
sourceSets {
main {
java.outputDir = file(outputPath)
output.resourcesDir = file(outputPath)
}
}
ant.importBuild("encrypt.xml")
//ant变量
ant.projectDir = projectDir
ant.references["compile.classpath"] = ant.path {
fileset(dir: libPath, includes: '**/*.jar')
fileset(dir: ".",includes:"**/*.jar" )
}
classes.dependsOn('clean')
task copyFiles(type: Copy,dependsOn: 'classes'){
from outputPath
into "$projectDir/classes"
}
task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas'){
from "$projectDir/classes"
into "$projectDir/transform-classes"
include "**/*.*"
}
jar.dependsOn("preJar")
task makeJar(type: Jar,dependsOn: preJar){
from fileTree(dir: "$projectDir/transform-classes")
baseName pluginPre
appendix pluginName
version pluginVersion
destinationDir = file("$buildDir/libs")
doLast(){
delete file("$projectDir/classes")
delete file("$projectDir/transform-classes")
}
}
task copyFile(type: Copy,dependsOn: ["makeJar"]){
from "$buildDir/libs"
from("$projectDir/lib") {
include "*.jar"
}
from "$projectDir/plugin.xml"
into file("$buildDir/temp/plugin")
}
task zip(type:Zip,dependsOn:["copyFile"]){
from "$buildDir/temp/plugin"
destinationDir file("$buildDir/install")
baseName pluginPre
appendix pluginName
version pluginVersion
}
//build时包含哪些文件,
processResources {
// exclude everything
// *.css没效果
// exclude '**/*.css'
// except this file
// include 'xx.xml'
}
/*读取plugin.xml中的version*/
def getPluginInfo(){
def xmlFile = file("plugin.xml")
if (!xmlFile.exists()) {
return ["id":"none", "version":"1.0.0"]
}
def plugin = new XmlParser().parse(xmlFile)
def version = plugin.version[0].text()
def id = plugin.id[0].text()
return ["id":id,"version":version]
}
repositories {
mavenLocal()
maven {
url = uri('http://mvn.finedevelop.com/repository/maven-public/')
}
}
task prepare(type: Copy) {
into privateLib
from configurations.runtimeClasspath
}
dependencies {
//使jar
implementation fileTree(dir: 'lib', include: ['**/*.jar'])
implementation fileTree(dir: libPath, include: ['**/*.jar'])
}

13
encrypt.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<target name="compile_encrypt_javas" depends="copyFiles">
<echo message="加密文件"/>
<echo message="${projectDir}"/>
<taskdef name="pretreatment" classname="com.fr.plugin.pack.PluginPretreatmentTask">
<classpath refid="compile.classpath"/>
</taskdef>
<pretreatment baseDir="${projectDir}"/>
</target>
<target name="compile_plain_javas" depends="copyFiles">
</target>
</project>

BIN
gradle/wrapper/gradle-wrapper.jar vendored

Binary file not shown.

5
gradle/wrapper/gradle-wrapper.properties vendored

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://downloads.gradle-dn.com/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
gradlew vendored

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

103
gradlew.bat vendored

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

15
plugin.xml

@ -3,12 +3,23 @@
<id>com.fr.solution.plugin.db.redis.v10</id>
<name><![CDATA[Redis数据集]]></name>
<active>yes</active>
<version>7.2</version>
<version>7.4.3</version>
<env-version>10.0</env-version>
<jartime>2019-03-29</jartime>
<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/>
[2020-06-09]修复redis连接没有正确关闭的问题。<br/>
[2020-06-05]搜索key的时候可以选择不同的数据库。<br>
[2020-04-26]修复插件被标记为需要付费的问题。<br/>
[2020-04-21]修复redis集群下的一个问题。<br/>
[2019-10-30]适配新服务器数据集接口,在决策平台可以直接定义<br/>
[2019-09-29]修复无法兼容老版本的问题。<br/>
[2019-09-18]支持手动选择不同JavaScript脚本引擎。<br/>

4
readme.md

@ -1,8 +1,8 @@
# 帆软报表连接redis缓存数据库插件
## 插件编译
进入插件源码目录,执行命令
`ant -f build.xml jar`
即可
`gradle zip`
即可在build/install下获得插件安装包
## 插件安装
使用帆软设计器自带的插件管理器即可安装。

5
settings.gradle

@ -0,0 +1,5 @@
/*
* This file was generated by the Gradle 'init' task.
*/
rootProject.name = 'demo-tabledata-redis'

3
src/main/java/com/fr/plugin/db/redis/RedisLocaleFinder.java

@ -1,11 +1,8 @@
package com.fr.plugin.db.redis;
import com.fr.plugin.db.redis.core.RedisConstants;
import com.fr.stable.fun.Authorize;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
@Authorize(callSignKey = RedisConstants.PLUGIN_ID)
public class RedisLocaleFinder extends AbstractLocaleFinder {
@Override
public String find() {

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

5
src/main/java/com/fr/plugin/db/redis/action/SearchKeysAction.java

@ -40,10 +40,11 @@ public class SearchKeysAction extends BaseHttpHandler {
String[] keys = new String[0];
String pattern = request.getParameter("pattern");
String connectionName = request.getParameter("database");
if (StringKit.isNotEmpty(pattern) && StringKit.isNotEmpty(connectionName)) {
String orderValue = request.getParameter("orderValue");
if (StringKit.isNotEmpty(pattern) && StringKit.isNotEmpty(connectionName) && StringKit.isNotEmpty(orderValue)) {
Connection connection = ConnectionKit.getConnection(connectionName);
if (connection instanceof RedisDatabaseConnection) {
keys = connection.summary(pattern);
keys = connection.summary(pattern, orderValue);
}
}
FlushKit.printAsJSON(response, JSONFactory.createJSON(Arrays.asList(keys)));

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

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

@ -9,6 +9,7 @@ import com.fanruan.api.util.StringKit;
import com.fanruan.api.util.TypeKit;
import com.fr.config.holder.Conf;
import com.fr.data.impl.Connection;
import com.fr.plugin.db.redis.core.accessor.EmbedRedis;
import com.fr.plugin.db.redis.core.emb.Redis;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
@ -25,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() {
@ -54,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 {
@ -70,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
@ -79,10 +88,18 @@ public class RedisDatabaseConnection extends BaseConnection {
return ArrayKit.EMPTY_STRING_ARRAY;
} else {
Redis redis = createRedisClient();
Set<String> keys = redis.getClient().keys(args[0]);
String[] array = keys.toArray(new String[0]);
redis.close();
return array;
try {
EmbedRedis embedRedis = redis.getClient();
int len = ArrayKit.getLength(args);
if (len > 1) {
int dbIndex = Integer.parseInt(args[1]);
embedRedis.select(dbIndex);
}
Set<String> keys = embedRedis.keys(args[0]);
return keys.toArray(new String[0]);
} finally {
redis.close();
}
}
}
@ -142,6 +159,7 @@ public class RedisDatabaseConnection extends BaseConnection {
if (StringKit.isNotEmpty(pwd)) {
setPassword(SecurityKit.encrypt(pwd));
}
setCluster(reader.getAttrAsBoolean("cluster", false));
}
}
}
@ -155,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/RedisScriptTableData.java

@ -18,7 +18,6 @@ import com.fr.plugin.db.redis.core.script.EngineType;
import com.fr.plugin.db.redis.util.RedisUtils;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.Calculator;
import com.fr.stable.NameReference;
import com.fr.stable.ParameterProvider;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;

18
src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableDataModel.java

@ -38,13 +38,17 @@ public class RedisScriptTableDataModel extends BaseDataModel {
return;
}
Redis redis = mc.createRedisClient();
redis.getClient().select(dbIndex);
RedisClient redisClient = RedisClientSelector.select(redis, engineType);
SimpleDataModel simple = redisClient.build(redis, script, rowCount);
if (simple != null) {
this.columnNames = simple.getColumnNames();
this.data = simple.getData();
this.rowCount = simple.getRowCount();
try {
redis.getClient().select(dbIndex);
RedisClient redisClient = RedisClientSelector.select(redis, engineType);
SimpleDataModel simple = redisClient.build(redis, script, rowCount);
if (simple != null) {
this.columnNames = simple.getColumnNames();
this.data = simple.getData();
this.rowCount = simple.getRowCount();
}
} finally {
redis.close();
}
}

3
src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java

@ -77,7 +77,8 @@ public class RedisTableData extends BaseTableData {
@Focus(id = RedisConstants.PLUGIN_ID, text = "Plugin-Redis_DB", source = Original.PLUGIN)
public DataModel createDataModel(Calculator calculator, int rowCount) {
long start = System.currentTimeMillis();
ParameterProvider[] ps = getParameters(calculator);
ParameterProvider[] providers = getParameters(calculator);
ParameterProvider[] ps = Calculator.processParameters(calculator, providers);
Connection connection = database.get();
String name = RedisUtils.getName(connection);
if (StringKit.isNotEmpty(name)) {

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

@ -28,18 +28,18 @@ public class RedisTableDataModel extends BaseDataModel {
return;
}
Redis redis = mc.createRedisClient();
redis.getClient().select(dbIndex);
LogKit.info("Connect to redis and select database:" + dbIndex);
try {
redis.getClient().select(dbIndex);
LogKit.info("Connect to redis and select database:" + dbIndex);
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();
redis.close();
} catch (Exception e) {
throw new RuntimeException(e.getCause());
} finally {
redis.close();
}
}

5
src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java

@ -91,7 +91,10 @@ public class ClusterRedisClient implements EmbedRedis {
@Override
public void select(int index) {
jedisCluster.select(index);
Map<String, JedisPool> clusterNodes = jedisCluster.getClusterNodes();
for (Map.Entry<String, JedisPool> entry : clusterNodes.entrySet()) {
entry.getValue().getResource().select(index);
}
}
@Override

2
src/main/java/com/fr/plugin/db/redis/help/client/BaseRedisClient.java

@ -50,7 +50,7 @@ public abstract class BaseRedisClient<A> implements RedisClient<A> {
@ScriptBridge
public String hkeys(String key) {
long start = System.currentTimeMillis();
Set<String> set = jedis.keys(key);
Set<String> set = jedis.hkeys(key);
LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start);
return object2JSONString(set);
}

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

14
src/main/java/com/fr/plugin/db/redis/ui/RedisDBConnectionChosePane.java

@ -1,5 +1,7 @@
package com.fr.plugin.db.redis.ui;
import com.fanruan.api.design.ui.component.UIIntNumberField;
import com.fanruan.api.design.ui.component.UILabel;
import com.fanruan.api.design.work.ConnectionComboBoxPanel;
import com.fr.data.impl.Connection;
import com.fr.data.operator.DataOperator;
@ -29,6 +31,7 @@ public class RedisDBConnectionChosePane extends BasicPane {
private DefaultListModel listModel = new DefaultListModel();
private List<DataLoadedListener> listeners = new ArrayList<DataLoadedListener>();
private UIPlaceholderTextField keysPatternTextField;
private UIIntNumberField dbIndexNumberField;
public RedisDBConnectionChosePane() {
setLayout(new BorderLayout(4, 4));
@ -51,6 +54,10 @@ public class RedisDBConnectionChosePane extends BasicPane {
keysPatternTextField = new UIPlaceholderTextField(10);
keysPatternTextField.setPlaceholder(DesignKit.i18nText("Plugin-Redis_Keys_Pattern"));
dbIndexNumberField = new UIIntNumberField();
dbIndexNumberField.setColumns(2);
dbIndexNumberField.setInt(0);
JPanel centerPane = new JPanel(new BorderLayout());
UIButton searchButton = new UIButton(DesignKit.i18nText("Plugin-Redis_Keys_Pattern_Search"));
@ -63,6 +70,10 @@ public class RedisDBConnectionChosePane extends BasicPane {
centerPane.add(GUICoreKit.createBorderLayoutPane(
keysPatternTextField, BorderLayout.CENTER,
GUICoreKit.createBorderLayoutPane(
new UILabel(DesignKit.i18nText("Plugin-Redis_DB_Simple_Index")), BorderLayout.WEST,
dbIndexNumberField, BorderLayout.CENTER
), BorderLayout.WEST,
searchButton, BorderLayout.EAST), BorderLayout.NORTH);
centerPane.add(list, BorderLayout.CENTER);
@ -97,7 +108,8 @@ public class RedisDBConnectionChosePane extends BasicPane {
if (StringKit.isEmpty(keysPattern)) {
return ArrayKit.EMPTY_STRING_ARRAY;
} else {
return DataOperator.getInstance().getTableSummary(connection, keysPattern);
String dbIndex = String.valueOf(dbIndexNumberField.getInt());
return DataOperator.getInstance().getTableSummary(connection, keysPattern, dbIndex);
}
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

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

@ -9,6 +9,7 @@ Plugin-Redis_Help=Help Doc
Plugin-Redis_Keys_Pattern=Keys Pattern
Plugin-Redis_Keys_Pattern_Search=Search
Plugin-Redis_DB_Index=DB Index
Plugin-Redis_DB_Simple_Index=Index
Plugin-Redis_Preview=Preview
Plugin-Redis_Refresh=Refresh
Plugin-Redis_Formula=Formula
@ -38,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

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

@ -9,6 +9,7 @@ Plugin-Redis_Help=Help Doc
Plugin-Redis_Keys_Pattern=Keys Pattern
Plugin-Redis_Keys_Pattern_Search=Search
Plugin-Redis_DB_Index=DB Index
Plugin-Redis_DB_Simple_Index=Index
Plugin-Redis_Preview=Preview
Plugin-Redis_Refresh=Refresh
Plugin-Redis_Formula=Formula
@ -38,3 +39,9 @@ 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
Plugin-Redis_Set_Parameter_Type=Parameter Type
Plugin-Redis_Set_Parameter_Value=Parameter Value

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

@ -9,6 +9,7 @@ Plugin-Redis_Help=\u5E2E\u52A9\u6587\u6863
Plugin-Redis_Keys_Pattern=\u952E\u503C\u7684\u6B63\u5219\u8868\u8FBE\u5F0F
Plugin-Redis_Keys_Pattern_Search=\u641C\u7D22
Plugin-Redis_DB_Index=\u6570\u636E\u5E93\u7F16\u53F7
Plugin-Redis_DB_Simple_Index=\u7F16\u53F7
Plugin-Redis_Preview=\u9884\u89C8
Plugin-Redis_Refresh=\u5237\u65B0
Plugin-Redis_Formula=\u516C\u5F0F
@ -38,15 +39,30 @@ 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_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\u4e8e\u0030\u7684\u6574\u6570
Plugin-Redis_View=\u89c6\u56fe
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
Plugin-Redis_Parameter_Insert=\u63D2\u5165
Plugin-Redis_Parameter_Delete=\u5220\u9664
Plugin-Redis_Parameter_Move_Up=\u4E0A\u79FB
Plugin-Redis_Parameter_Move_Down=\u4E0B\u79FB
Plugin-Redis_Parameter_Refresh=\u5237\u65B0
Plugin-Redis_Dataset_Parameter_Name=\u53C2\u6570
Plugin-Redis_Dataset_Parameter_Value=\u503C
Plugin-Redis_Parameter_Please_Set_Parameter_Name=\u8BF7\u5148\u8BBE\u7F6E\u53C2\u6570\u540D
Plugin-Redis_Parameter_Type_String=\u5B57\u7B26\u4E32
Plugin-Redis_Parameter_Type_Int=\u6574\u578B
Plugin-Redis_Parameter_Type_Number=\u53CC\u7CBE\u5EA6\u578B
Plugin-Redis_Parameter_Type_Date=\u65E5\u671F
Plugin-Redis_Parameter_Type_Boolean=\u5E03\u5C14\u578B
Plugin-Redis_Parameter_Type_Formula=\u516C\u5F0F
Plugin-Redis_Parameter_Delete_Confirm=\u4F60\u786E\u5B9A\u51B3\u5B9A\u5220\u9664\u9009\u4E2D\u7684\u9879\uFF1F
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_Preview=\u9884\u89c8
Plugin-Redis_Refresh=\u5237\u65B0
Plugin-Redis_Data_Connection=\u6570\u636e\u8fde\u63a5
Plugin-Redis_Set_Parameter=\u53c2\u6570\u8bbe\u7f6e
Plugin-Redis_Set_Parameter_Name=\u53c2\u6570\u540d
Plugin-Redis_Set_Parameter_Type=\u53c2\u6570\u7c7b\u578b
Plugin-Redis_Set_Parameter_Value=\u9ed8\u8ba4\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

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

File diff suppressed because one or more lines are too long

1
src/web/.npmrc

@ -0,0 +1 @@
@fui:registry=https://npm.fineres.com/

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;

11
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,20 +14,19 @@
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui/dist/fineui.css"
href="./node_modules/@fui/core/dist/2.0/fineui.min.css"
/>
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui-materials/docs/materials.min.css"
href="./node_modules/@fui/materials/docs/materials.min.css"
/>
</head>
<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/fineui-materials/docs/materials.min.js"></script>
<script src="./node_modules/fineui/i18n/i18n.cn.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>

17
src/web/package.json

@ -7,6 +7,9 @@
"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",
"@types/jss": "9.5.8",
"autoprefixer": "^9.6.1",
"es6-promise": "4.2.6",
@ -18,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",
@ -58,10 +55,6 @@
"webpack-dev-server": "3.7.2",
"webpack-merge": "4.2.1"
},
"optionalDependencies": {
"fineui": "git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git",
"fineui-materials": "git+ssh://git@cloud.finedevelop.com:7999/fui/fineui-materials.git#release/10.0"
},
"scripts": {
"dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open",
"build": "webpack -p --progress --config=webpack/webpack.prod.js --mode production",

199
src/web/private/i18n.ts

@ -9,7 +9,12 @@ export const i18n = {
'Plugin-Redis_Help': '帮助文档',
'Plugin-Redis_Keys_Pattern': '键值的正则表达式',
'Plugin-Redis_Keys_Pattern_Search': '搜索',
'Plugin-Redis_Set_Parameter': '参数',
'Plugin-Redis_Set_Parameter_Name': '参数名',
'Plugin-Redis_Set_Parameter_Type': '参数类型',
'Plugin-Redis_Set_Parameter_Value': '参数值',
'Plugin-Redis_DB_Index': '数据库编号',
'Plugin-Redis_Index': '编号',
'Plugin-Redis_Preview': '预览',
'Plugin-Redis_Refresh': '刷新',
'Plugin-Redis_Formula': '公式',
@ -44,9 +49,193 @@ export const i18n = {
'Plugin-Redis_Check_Integer': '请输入不小于0的整数',
'Plugin-Redis_View': '视图',
'Plugin-Redis_Table': '表',
'Plugin-Redis_Data_Connection': '数据连接',
'Plugin-Redis_Set_Parameter': '参数设置',
'Plugin-Redis_Set_Parameter_Name': '参数名',
'Plugin-Redis_Set_Parameter_Type': '参数类型',
'Plugin-Redis_Set_Parameter_Value': '默认值',
'BI-Multi_Date_Quarter_End': '季度末',
'BI-Multi_Date_Month_Begin': '月初',
'BI-Multi_Date_YMD': '年月日',
'BI-Custom_Color': '自定义颜色',
'BI-Numerical_Interval_Input_Data': '请输入数值',
'BI-Please_Input_Natural_Number': '请输入非负整数',
'BI-No_More_Data': '无更多数据',
'BI-Basic_Altogether': '共',
'BI-Basic_Sunday': '星期日',
'BI-Widget_Background_Colour': '组件背景',
'BI-Color_Picker_Error_Text': '请输入0~255的正整数',
'BI-Multi_Date_Month': '月',
'BI-No_Selected_Item': '没有可选项',
'BI-Multi_Date_Year_Begin': '年初',
'BI-Quarter_1': '第1季度',
'BI-Quarter_2': '第2季度',
'BI-Quarter_3': '第3季度',
'BI-Quarter_4': '第4季度',
'BI-Multi_Date_Year_Next': '年后',
'BI-Multi_Date_Month_Prev': '个月前',
'BI-Month_Trigger_Error_Text': '请输入1~12的正整数',
'BI-Less_And_Equal': '小于等于',
'BI-Year_Trigger_Invalid_Text': '请输入有效时间',
'BI-Multi_Date_Week_Next': '周后',
'BI-Font_Size': '字号',
'BI-Basic_Total': '共',
'BI-Already_Selected': '已选择',
'BI-Formula_Insert': '插入',
'BI-Select_All': '全选',
'BI-Basic_Tuesday': '星期二',
'BI-Multi_Date_Month_End': '月末',
'BI-Load_More': '点击加载更多数据',
'BI-Basic_September': '九月',
'BI-Current_Is_Last_Page': '当前已是最后一页',
'BI-Basic_Auto': '自动',
'BI-Basic_Count': '个',
'BI-Basic_Value': '值',
'BI-Basic_Unrestricted': '无限制',
'BI-Quarter_Trigger_Error_Text': '请输入1~4的正整数',
'BI-Basic_More': '更多',
'BI-Basic_Wednesday': '星期三',
'BI-Basic_Bold': '加粗',
'BI-Basic_Simple_Saturday': '六',
'BI-Multi_Date_Month_Next': '个月后',
'BI-Basic_March': '三月',
'BI-Current_Is_First_Page': '当前已是第一页',
'BI-Basic_Thursday': '星期四',
'BI-Basic_Prompt': '提示',
'BI-Multi_Date_Today': '今天',
'BI-Multi_Date_Quarter_Prev': '个季度前',
'BI-Row_Header': '行表头',
'BI-Date_Trigger_Error_Text': '日期格式示例:2015-3-11',
'BI-Basic_Cancel': '取消',
'BI-Basic_January': '一月',
'BI-Basic_June': '六月',
'BI-Basic_July': '七月',
'BI-Basic_April': '四月',
'BI-Multi_Date_Quarter_Begin': '季度初',
'BI-Multi_Date_Week': '周',
'BI-Click_Blank_To_Select': '点击\\空格键\\选中完全匹配项',
'BI-Basic_August': '八月',
'BI-Word_Align_Left': '文字居左',
'BI-Basic_November': '十一月',
'BI-Font_Colour': '字体颜色',
'BI-Multi_Date_Day_Prev': '天前',
'BI-Select_Part': '部分选择',
'BI-Multi_Date_Day_Next': '天后',
'BI-Less_Than': '小于',
'BI-Basic_February': '二月',
'BI-Multi_Date_Year': '年',
'BI-Number_Index': '序号',
'BI-Multi_Date_Week_Prev': '周前',
'BI-Next_Page': '下一页',
'BI-Right_Page': '向右翻页',
'BI-Numerical_Interval_Signal_Value': '前后值相等,请将操作符改为“≤”',
'BI-Basic_December': '十二月',
'BI-Basic_Saturday': '星期六',
'BI-Basic_Simple_Wednesday': '三',
'BI-Multi_Date_Quarter_Next': '个季度后',
'BI-Basic_October': '十月',
'BI-Basic_Simple_Friday': '五',
'BI-Basic_Save': '保存',
'BI-Numerical_Interval_Number_Value': '请保证前面的数值小于/等于后面的数值',
'BI-Previous_Page': '上一页',
'BI-No_Select': '搜索结果为空',
'BI-Basic_Clears': '清空',
'BI-Created_By_Me': '我创建的',
'BI-Basic_Simple_Tuesday': '二',
'BI-Word_Align_Right': '文字居右',
'BI-Summary_Values': '汇总',
'BI-Basic_Clear': '清除',
'BI-Upload_File_Size_Error': '文件大小不支持',
'BI-Up_Page': '向上翻页',
'BI-Basic_Simple_Sunday': '日',
'BI-Multi_Date_Relative_Current_Time': '相对当前时间',
'BI-Selected_Data': '已选数据:',
'BI-Multi_Date_Quarter': '季度',
'BI-Check_Selected': '查看已选',
'BI-Basic_Search': '搜索',
'BI-Basic_May': '五月',
'BI-Continue_Select': '继续选择',
'BI-Please_Input_Positive_Integer': '请输入正整数',
'BI-Upload_File_Type_Error': '文件类型不支持',
'BI-Upload_File_Error': '文件上传失败',
'BI-Basic_Friday': '星期五',
'BI-Down_Page': '向下翻页',
'BI-Basic_Monday': '星期一',
'BI-Left_Page': '向左翻页',
'BI-Transparent_Color': '透明',
'BI-Basic_Simple_Monday': '一',
'BI-Multi_Date_Year_End': '年末',
'BI-Time_Interval_Error_Text': '请保证开始时间早于/等于结束时间',
'BI-Basic_Time': '时间',
'BI-Basic_OK': '确定',
'BI-Basic_Sure': '确定',
'BI-Basic_Simple_Thursday': '四',
'BI-Multi_Date_Year_Prev': '年前',
'BI-Tiao_Data': '条数据',
'BI-Basic_Italic': '斜体',
'BI-Basic_Dynamic_Title': '动态时间',
'BI-Basic_Year': '年',
'BI-Basic_Single_Quarter': '季',
'BI-Basic_Month': '月',
'BI-Basic_Week': '周',
'BI-Basic_Day': '天',
'BI-Basic_Work_Day': '工作日',
'BI-Basic_Front': '前',
'BI-Basic_Behind': '后',
'BI-Basic_Empty': '空',
'BI-Basic_Month_End': '月末',
'BI-Basic_Month_Begin': '月初',
'BI-Basic_Year_End': '年末',
'BI-Basic_Year_Begin': '年初',
'BI-Basic_Quarter_End': '季末',
'BI-Basic_Quarter_Begin': '季初',
'BI-Basic_Week_End': '周末',
'BI-Basic_Week_Begin': '周初',
'BI-Basic_Current_Day': '当天',
'BI-Basic_Begin_Start': '初',
'BI-Basic_End_Stop': '末',
'BI-Basic_Current_Year': '今年',
'BI-Basic_Year_Fen': '年份',
'BI-Basic_Current_Month': '本月',
'BI-Basic_Current_Quarter': '本季度',
'BI-Basic_Year_Month': '年月',
'BI-Basic_Year_Quarter': '年季度',
'BI-Basic_Input_Can_Not_Null': '输入框不能为空',
'BI-Basic_Date_Time_Error_Text': '日期格式示例:2015-3-11 00:00:00',
'BI-Basic_Input_From_To_Number': '请输入{R1}的数值',
'BI-Basic_Or': '或',
'BI-Basic_And': '且',
'BI-Conf_Add_Formula': '添加公式',
'BI-Conf_Add_Condition': '添加条件',
'BI-Conf_Formula_And': '且公式条件',
'BI-Conf_Formula_Or': '或公式条件',
'BI-Conf_Condition_And': '且条件',
'BI-Conf_Condition_Or': '或条件',
'BI-Microsoft_YaHei': '微软雅黑',
'BI-Apple_Light': '苹方-light',
'BI-Font_Family': '字体',
'BI-Basic_Please_Input_Content': '请输入内容',
'BI-Word_Align_Center': '文字居中',
'BI-Basic_Please_Enter_Number_Between': '请输入{R1}-{R2}的值',
'BI-More_Than': '大于',
'BI-More_And_Equal': '大于等于',
'BI-Please_Enter_SQL': '请输入SQL',
'BI-Basic_Click_To_Add_Text': '+点击新增\\{R1}\\',
'BI-Basic_Please_Select': '请选择',
'BI-Basic_Font_Color': '文字颜色',
'BI-Basic_Background_Color': '背景色',
'BI-Basic_Underline': '下划线',
'BI-Basic_Param_Month': '{R1}月',
'BI-Basic_Param_Day': '{R1}日',
'BI-Basic_Param_Quarter': '{R1}季度',
'BI-Basic_Param_Week_Count': '第{R1}周',
'BI-Basic_Param_Hour': '{R1}时',
'BI-Basic_Param_Minute': '{R1}分',
'BI-Basic_Param_Second': '{R1}秒',
'BI-Basic_Param_Year': '{R1}年',
'BI-Basic_Date_Day': '日',
'BI-Basic_Hour_Sin': '时',
'BI-Basic_Seconds': '秒',
'BI-Basic_Minute': '分',
'BI-Basic_Wan': '万',
'BI-Basic_Million': '百万',
'BI-Basic_Billion': '亿',
'BI-Basic_Quarter': '季度',
'BI-Basic_No_Select': '不选',
'BI-Basic_Now': '此刻',
};

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,

3
src/web/src/modules/crud/crud.request.ts

@ -4,10 +4,11 @@ export function getConnectionlist(): Promise<{data?: Connection[]}> {
return requestGet('/v10/config/connection/list');
}
export function getTableList(database: string, pattern = ''): Promise<string[]> {
export function getTableList(database: string, pattern = '', orderValue: string | number): Promise<string[]> {
return requestGet('plugin/private/com.fr.solution.plugin.db.redis.v10/redis/keys', {
database,
pattern,
orderValue,
});
}

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,

6
src/web/src/modules/table_list/table_list.model.ts

@ -9,6 +9,7 @@ export class TableModelModel extends Model {
connections: [] as string[],
tables: [] as string[],
search: '',
orderValue: '',
selectedConnection: '',
};
}
@ -21,15 +22,16 @@ export class TableModelModel extends Model {
},
initTableList: () => {
if (this.model.selectedConnection) {
getTableList(this.model.selectedConnection, this.model.search).then(re => {
getTableList(this.model.selectedConnection, this.model.search, this.model.orderValue).then(re => {
this.model.tables = re ? re : [];
});
} else {
this.model.tables = [];
}
},
setSearch(value: string) {
setSearch(value: string, orderValue: string | number) {
this.model.search = value;
this.model.orderValue = orderValue;
},
setSelectedConnection(name: string) {
this.model.selectedConnection = name;

53
src/web/src/modules/table_list/table_list.ts

@ -1,8 +1,8 @@
import { shortcut, store } from '@core/core';
import { VtapeXtype, HtapeXtype, IconButtonXtype, TextValueComboXtype, ButtonXtype, TextEditorXtype, ButtonGroupXtype, VerticalXtype } from 'ui';
import { ListItem } from './list_item';
import { TableModelModel } from './table_list.model';
import { fineServletURL } from '@constants/env';
import { DatabaseIndex } from '../components/database_index/database_index';
@shortcut()
@store(TableModelModel)
@ -12,12 +12,18 @@ export class TableList extends BI.Widget {
store: TableModelModel['store']
model: TableModelModel['model']
databaseIndex: DatabaseIndex;
buttonGroup: any;
connectionTextValue: any;
searchText: any;
props = {
database: '',
value: {
datasetData: {
orderValue: 0,
},
},
}
watch = {
@ -27,7 +33,7 @@ export class TableList extends BI.Widget {
this.connectionTextValue.setValue(name);
this.store.setSelectedConnection(name);
},
'selectedConnection || search': () => {
'selectedConnection || search || orderValue': () => {
this.store.initTableList();
},
tables: (tables: string[]) => {
@ -36,15 +42,18 @@ export class TableList extends BI.Widget {
}
render() {
const { orderValue = 0 } = this.options.value.datasetData || {};
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;
},
@ -58,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: () => {
@ -68,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: () => {
@ -81,9 +90,25 @@ export class TableList extends BI.Widget {
height: 25,
}, {
el: {
type: HtapeXtype,
type: BI.HTapeLayout.xtype,
items: [{
type: TextEditorXtype,
el: {
type: BI.Label.xtype,
text: BI.i18nText('Plugin-Redis_Index'),
textAlign: 'left',
},
width: 24,
}, {
type: DatabaseIndex.xtype,
value: orderValue,
inputType,
ref: (_ref: any) => {
this.databaseIndex = _ref;
},
width: 24,
height: 22,
}, {
type: BI.TextEditor.xtype,
height: 24,
watermark: BI.i18nText('Plugin-Redis_Keys_Pattern'),
ref: (_ref: any) => {
@ -91,11 +116,11 @@ export class TableList extends BI.Widget {
},
}, {
el: {
type: ButtonXtype,
type: BI.Button.xtype,
minWidth: 50,
text: BI.i18nText('Plugin-Redis_Keys_Pattern_Search'),
handler: () => {
this.store.setSearch(this.searchText.getValue());
this.store.setSearch(this.searchText.getValue(), this.databaseIndex.getValue());
},
},
width: 50,
@ -103,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',
}

67
src/web/yarn.lock

@ -723,10 +723,18 @@
exec-sh "^0.3.2"
minimist "^1.2.0"
"@jest/console@^24.7.1", "@jest/console@^24.9.0":
version "24.9.0"
resolved "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0"
integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==
"@fui/materials@^10.0.0":
version "10.0.0"
resolved "https://npm.fineres.com/@fui%2fmaterials/-/materials-10.0.0.tgz#816187a3c287f59e4f7e404f3b9f7f041aa424a4"
integrity sha512-yQvAR8yfnnnFPu9UEdlfx15bO/GVtrppOvbp/kJPPFW+MnW8fQ60WYAnIPjzLLu0LxNRsucvsKDAiYAUFWVwIA==
dependencies:
"@types/codemirror" "0.0.77"
codemirror "5.42.2"
"@jest/console@^24.7.1":
version "24.7.1"
resolved "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"
integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==
dependencies:
"@jest/source-map" "^24.9.0"
chalk "^2.0.1"
@ -906,15 +914,15 @@
"@types/codemirror@0.0.77":
version "0.0.77"
resolved "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.77.tgz#6785a0183b4aea147de650530259ebf2a511bde9"
integrity sha512-nfjRJpAXgkT075jztMp92Ol2b7w7JrDvpfBU70GfVhpfdpWiZi6NqVIO3STGNzWl77/iJkTu2ZSg6hQobrEadg==
resolved "https://registry.npm.taobao.org/@types/codemirror/download/@types/codemirror-0.0.77.tgz#6785a0183b4aea147de650530259ebf2a511bde9"
integrity sha1-Z4WgGDtK6hR95lBTAlnr8qURvek=
dependencies:
"@types/tern" "*"
"@types/estree@*":
version "0.0.39"
resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
version "0.0.45"
resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884"
integrity sha1-6Th1cpmOXs2sIhlQ2rPow7Fq+IQ=
"@types/events@*":
version "3.0.0"
@ -992,22 +1000,15 @@
"@types/tern@*":
version "0.23.3"
resolved "https://registry.npmjs.org/@types/tern/-/tern-0.23.3.tgz#4b54538f04a88c9ff79de1f6f94f575a7f339460"
integrity sha512-imDtS4TAoTcXk0g7u4kkWqedB3E4qpjXzCpD2LU5M5NAXHzCDsypyvXSaG7mM8DKYkCRa7tFp4tS/lp/Wo7Q3w==
resolved "https://registry.npm.taobao.org/@types/tern/download/@types/tern-0.23.3.tgz#4b54538f04a88c9ff79de1f6f94f575a7f339460"
integrity sha1-S1RTjwSojJ/3neH2+U9XWn8zlGA=
dependencies:
"@types/estree" "*"
"@types/yargs-parser@*":
version "13.1.0"
resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228"
integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==
"@types/yargs@^13.0.0":
version "13.0.3"
resolved "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380"
integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ==
dependencies:
"@types/yargs-parser" "*"
"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
version "12.0.12"
resolved "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==
"@typescript-eslint/eslint-plugin@1.7.0":
version "1.7.0"
@ -2088,10 +2089,10 @@ code-point-at@^1.0.0:
resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
codemirror@5.49.0:
version "5.49.0"
resolved "https://registry.npmjs.org/codemirror/-/codemirror-5.49.0.tgz#adedbffcc81091e4a0334bcb96b1ae3b7ada5e3f"
integrity sha512-Hyzr0HToBdZpLBN9dYFO/KlJAsKH37/cXVHPAqa+imml0R92tb9AkmsvjnXL+SluEvjjdfkDgRjc65NG5jnMYA==
codemirror@5.42.2:
version "5.42.2"
resolved "https://registry.npm.taobao.org/codemirror/download/codemirror-5.42.2.tgz?cache=0&sync_timestamp=1592745428423&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcodemirror%2Fdownload%2Fcodemirror-5.42.2.tgz#801ab715a7a7e1c7ed4162b78e9d8138b98de8f0"
integrity sha1-gBq3Faen4cftQWK3jp2BOLmN6PA=
collection-visit@^1.0.0:
version "1.0.0"
@ -3432,16 +3433,10 @@ findup-sync@3.0.0:
micromatch "^3.0.4"
resolve-dir "^1.0.1"
"fineui-materials@git+ssh://git@cloud.finedevelop.com:7999/fui/fineui-materials.git#release/10.0":
version "1.0.0"
resolved "git+ssh://git@cloud.finedevelop.com:7999/fui/fineui-materials.git#df3fd3821680cd28edbc5e03b6182d8d7021fc45"
dependencies:
"@types/codemirror" "0.0.77"
codemirror "5.49.0"
"fineui@git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git":
version "1.1.2"
resolved "git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git#9463c7fbf77e9636945a4b08eff8c30cf8664425"
fineui@^2.0.20200628140334:
version "2.0.20200628140334"
resolved "https://registry.npm.taobao.org/fineui/download/fineui-2.0.20200628140334.tgz#9280889789402c8f731792279eeb6e43d95e6bdb"
integrity sha1-koCIl4lALI9zF5InnutuQ9lea9s=
flat-cache@^2.0.1:
version "2.0.1"

Loading…
Cancel
Save