Browse Source

Merge pull request #8 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:feature/10.0 to feature/10.0

* commit '9df46cb46ccddff9ddbaee4aca27fa9fd7fd1d9c':
  fix: 这个用不到
  refactor: 重构页面
qufenxi
alan 5 years ago
parent
commit
b345c707fd
  1. 10
      .eslintignore
  2. 235
      .eslintrc
  3. 7
      .gitattributes
  4. 11
      .gitignore
  5. 239
      README.md
  6. 29
      babel.config.js
  7. 6
      config/fineui.prepare.js
  8. 48
      config/fineui.setup.js
  9. 34
      config/jest.environment.js
  10. 238
      i18n/zh_cn.properties
  11. 44
      index.html
  12. 26
      jest.config.js
  13. 15
      lib/transform-i18n/transform-i18n.js
  14. 7
      lib/upgrade/index.js
  15. 103
      package.json
  16. 373
      private/constants.ts
  17. 241
      private/i18n.ts
  18. 180
      redis.js
  19. 4
      src/app/app.constant.ts
  20. 39
      src/app/app.model.ts
  21. 55
      src/app/app.ts
  22. 4
      src/app/connection/left/item/left_item.less
  23. 77
      src/app/connection/left/item/left_item.ts
  24. 43
      src/app/connection/left/item/left_item_delete.ts
  25. 26
      src/app/connection/left/item/left_item_icon.ts
  26. 39
      src/app/connection/left/left.ts
  27. 50
      src/app/connection/link_set.mixin.ts
  28. 154
      src/app/connection/link_set.model.ts
  29. 26
      src/app/connection/link_set.service.ts
  30. 58
      src/app/connection/link_set.ts
  31. 6
      src/app/connection/more/item/more_link_item.less
  32. 68
      src/app/connection/more/item/more_link_item.ts
  33. 6
      src/app/connection/more/item/more_link_litem.model.ts
  34. 16
      src/app/connection/more/more_link.model.ts
  35. 50
      src/app/connection/more/more_link.service.ts
  36. 52
      src/app/connection/more/more_link.ts
  37. 30
      src/app/connection/right/nothing.ts
  38. 33
      src/app/connection/right/right.ts
  39. 25
      src/app/connection/right/right.typing.d.ts
  40. 6
      src/app/connection/right/right_detail/right_detail.model.ts
  41. 74
      src/app/connection/right/right_detail/right_detail.ts
  42. 20
      src/app/connection/right/right_edit/right_edit.model.ts
  43. 24
      src/app/connection/right/right_edit/right_edit.service.ts
  44. 373
      src/app/connection/right/right_edit/right_edit.ts
  45. 226
      src/app/connection/right/right_edit/right_edit_jndi.ts
  46. 325
      src/app/connection/right/right_edit/right_edit_mysql.ts
  47. 20
      src/app/connection/right/right_show/right_show.model.ts
  48. 72
      src/app/connection/right/right_show/right_show.ts
  49. 203
      src/app/connection/right/right_show/right_show_jndi.ts
  50. 20
      src/app/connection/right/right_title/right_title.model.ts
  51. 66
      src/app/connection/right/right_title/right_title.ts
  52. 23
      src/app/connection/select/select.service.ts
  53. 77
      src/app/connection/select/select.ts
  54. 17
      src/app/status/left/left.model.ts
  55. 44
      src/app/status/left/left.ts
  56. 39
      src/app/status/left/left_item.ts
  57. 9
      src/app/status/link_status.model.ts
  58. 63
      src/app/status/link_status.ts
  59. 14
      src/app/status/right/right.model.ts
  60. 68
      src/app/status/right/right.ts
  61. 6
      src/app/status/right/right.typings.d.ts
  62. 91
      src/app/status/right/right_card.ts
  63. 8
      src/app/title/title.less
  64. 11
      src/app/title/title.model.ts
  65. 61
      src/app/title/title.ts
  66. 91
      src/demo/plugin.redis.edit.ts
  67. 68
      src/demo/plugin.redis.preview.ts
  68. 53
      src/demo/plugin.tedis.pool.ts
  69. 3
      src/demo/style.scss
  70. 3
      src/i18n.ts
  71. BIN
      src/img/ads.jpg
  72. BIN
      src/img/amazon-redshift.jpg
  73. BIN
      src/img/apache-impala.jpg
  74. BIN
      src/img/apache-kylin.jpg
  75. BIN
      src/img/apache-phoenix.jpg
  76. BIN
      src/img/database-selected.png
  77. BIN
      src/img/derby.jpg
  78. BIN
      src/img/error.png
  79. BIN
      src/img/gbase-8a.jpg
  80. BIN
      src/img/gbase-8s.jpg
  81. BIN
      src/img/gbase-8t.jpg
  82. BIN
      src/img/h2.jpg
  83. BIN
      src/img/hadoop-hive.jpg
  84. BIN
      src/img/hbase.jpg
  85. BIN
      src/img/hp-vertica.jpg
  86. BIN
      src/img/hsql.jpg
  87. BIN
      src/img/hw-dws.jpg
  88. BIN
      src/img/hw-elk.jpg
  89. BIN
      src/img/hw-fusioninsight-hd.jpg
  90. BIN
      src/img/hw-libr-a.jpg
  91. BIN
      src/img/ibm-db2.jpg
  92. BIN
      src/img/icon_close9x9_normal.png
  93. BIN
      src/img/informix.jpg
  94. BIN
      src/img/kingbase.jpg
  95. BIN
      src/img/loading.gif
  96. BIN
      src/img/mysql.jpg
  97. BIN
      src/img/oracle.jpg
  98. BIN
      src/img/pivotal-greenplum-database.jpg
  99. BIN
      src/img/postgresql.jpg
  100. BIN
      src/img/presto.jpg
  101. Some files were not shown because too many files have changed in this diff Show More

10
.eslintignore

@ -1,5 +1,5 @@
dist/*.js
src/assets/*
src/lib/*
webpack.config.js
curd.mock.ts
types
node_modules/
dist/
assets/
webpack/

235
.eslintrc.js → .eslintrc

@ -1,89 +1,61 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules:{
"indent": "off",
"quotes": [1, "single"],
"space-infix-ops": 2,//操作符前后有空格
// 必须使用 === 和 !== ,和 null 对比时除外
'eqeqeq': [2, 'always', { 'null': 'ignore' }],
// 函数的形参不能多于5个
'max-params': [2, 5],
// 禁止 switch 中出现相同的 case
'no-duplicate-case': 2,
// 禁止使用 var,必须用 let 或 const
'no-var': 0,
// 禁止出现空代码块
'no-empty': [2, { 'allowEmptyCatch': true }],
// 禁止空的 function
// 包含注释的情况下允许
'no-empty-function': 0,
// if 后必须包含 { ,单行 if 除外
'curly': [2, 'multi-line', 'consistent'],
// for 循环不得因方向错误造成死循环
'for-direction': 2,
// 关键字前后必须有空格
'keyword-spacing': 2,
'key-spacing':2,
// 最大块嵌套深度为 5 层
'max-depth': [2, 5],
// 最大回调深度为 3 层
'max-nested-callbacks': [2, 3],
// 禁止普通字符串中出现模板字符串语法
'no-template-curly-in-string': 0,
// 禁止连等赋值
'no-multi-assign': 2,
// 禁止使用连续的空格
'no-multi-spaces': 2,
// 禁止使用 \ 来定义多行字符串,统一使用模板字符串来做
'no-multi-str': 2,
// 禁止使用 new Object
'no-new-object': 2,
// 禁止使用 new require
'no-new-require': 2,
// 禁止使用 new Symbol
'no-new-symbol': 2,
// 禁止 new Boolean、Number 或 String
'no-new-wrappers': 2,
// 禁止 new 一个类而不存储该实例
'no-new': 2,
// 禁止把原生对象 Math、JSON、Reflect 当函数使用
'no-obj-calls': 2,
// 禁止使用八进制转义符
'no-octal-escape': 2,
// 禁止使用0开头的数字表示八进制
'no-octal': 2,
// 禁止使用 __dirname + 'file' 的形式拼接路径,应该使用 path.join 或 path.resolve 来代替
'no-path-concat': 2,
// 禁止对函数的参数重新赋值
'no-param-reassign': 2,
// 禁止使用保留字作为变量名
'no-shadow-restricted-names': 2,
// 禁止数组中出现连续逗号
'no-sparse-arrays': 2,
// 禁止在finally块中出现 return、throw、break、continue
'no-unsafe-finally': 2,
// 禁止出现不安全的否定,如 for (!key in obj} {},应该写为 for (!(key in obj)} {}
'no-unsafe-negation': 2,
// ...后面不允许有空格
'rest-spread-spacing': [2, 'never'],
// 注释的斜线和星号后要加空格
'spaced-comment': [2, 'always', {
'block': {
exceptions: ['*'],
balanced: true
{
"env": {
"browser": true,
"node": true,
"es6": true,
"jest/globals": true
},
"globals": {
"Fix": true,
"BI": true,
"Report": true,
"Dec": true,
"DecCst": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"modules": true
}
}],
// typeof 判断条件只能是 "undefined", "object", "boolean", "number", "string", "function" 或 "symbol"
'valid-typeof': 2,
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/explicit-function-return-type": ["warn", {
allowExpressions: true
}],
"@typescript-eslint/no-explicit-any": ["off"],
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {
"no-underscore-dangle": 0,
"prefer-rest-params": 0,
"no-plusplus": 0,
"max-len": 0,
"no-use-before-define": [
"error",
{
"functions": false
}
],
"new-cap": [
"error",
{
"properties": false
}
],
"no-confusing-arrow": ["off"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"args": "none",
"ignoreRestSiblings": true
}
],
"no-irregular-whitespace": [
"error",
{
"skipTemplates": false,
"skipStrings": false
}
],
// 声明
"prefer-const": "error", //如果一个变量不会被重新赋值,最好使用const进行声明
"no-const-assign": "error", //不允许改变用const声明的变量
@ -93,14 +65,8 @@ module.exports = {
"no-prototype-builtins": "error", // 禁止直接使用 Object.prototypes 的内置属性
"no-extend-native": "error", // 禁止扩展原生对象
"no-new-object": "error", // 禁止使用 Object 构造函数
"object-shorthand": [
"error",
"always"
], //要求对象字面量简写语法
"quote-props": [
"error",
"as-needed"
], // 对象属性只在需要的时候加引号
"object-shorthand": ["error", "always"], //要求对象字面量简写语法
"quote-props": ["error", "as-needed"], // 对象属性只在需要的时候加引号
// 数组
"no-sparse-arrays": "error", // 禁用稀疏数组
"no-array-constructor": "error", //禁止使用 Array 构造函数
@ -114,16 +80,13 @@ module.exports = {
}
], // 字符串开头和结束使用单引号
"prefer-template": "error", // 使用模板而非字符串连接
"template-curly-spacing": [
"error",
"never"
], // 强制模板字符串中花括号内不能出现空格
"template-curly-spacing": ["error", "never"], // 强制模板字符串中花括号内不能出现空格
"no-path-concat": "error", // 当使用 _dirname 和 _filename 时不允许字符串拼接
"no-useless-concat": "error", // 禁止没有必要的字符拼接
"no-useless-escape": "error", // 禁用不必要的转义
// 函数
"no-dupe-args": "error", // 禁止在 function 定义中出现重复的参数
"no-new-func": "error", // 禁用Function构造函数
// "no-new-func": "error", // 禁用Function构造函数
"no-return-assign": "error", // 禁止在返回语句中赋值
"func-style": [
"error",
@ -133,10 +96,7 @@ module.exports = {
}
], // 统一函数风格为函数表达式或函数声明,并且允许使用箭头函数
"newline-before-return": "error", // 要求 return 语句之前有一空行
"wrap-iife": [
"error",
"outside"
], // 立即执行函数外部必须包裹括号
"wrap-iife": ["error", "outside"], // 立即执行函数外部必须包裹括号
"no-loop-func": "error", // 禁止在非function内声明function
// "space-before-function-paren": "error", // 函数括号前必须要有空格
"no-param-reassign": "error", // 禁止修改函数参数
@ -144,10 +104,7 @@ module.exports = {
// 箭头函数
"prefer-arrow-callback": "error", // 回调使用箭头函数
"arrow-spacing": "error", // 箭头前后要有空格
"arrow-parens": [
"error",
"as-needed"
], // 参数使用括号包裹
"arrow-parens": ["error", "as-needed"], // 参数使用括号包裹
"arrow-body-style": [
"error",
"as-needed",
@ -167,10 +124,12 @@ module.exports = {
// 属性
"dot-notation": "error", //强制在任何允许的时候使用点号访问属性
// 变量
"no-undef": "error", // 禁止使用未声明的变量
// "one-var": ["error", "never"], // 变量统一声明
// 比较运算符 & 相等运算符
"eqeqeq": "error", // 使用 === 和 !== 代替 == 和 !=
"no-nested-ternary": "error", // 禁止混合的三目运算符
"no-case-declarations": "error", // 禁止在 case 或 default 子句中出现变量声明
// "no-nested-ternary": "error", // 禁止混合的三目运算符
"no-unneeded-ternary": "error", //禁止可以在有更简单的可替代的表达式时使用三元操作符
// 条件
"no-cond-assign": "error", // 禁止在条件语句中出现赋值操作符
@ -181,10 +140,7 @@ module.exports = {
"no-fallthrough": "error", // 禁止 case 语句落空
// 代码块
"brace-style": "error", // 代码块左括号紧跟上一行结束
"curly": [
"error",
"multi-line"
], // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
"curly": ["error", "multi-line"], // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
"no-empty": [
"error",
{
@ -193,11 +149,22 @@ module.exports = {
], // 禁止空块语句,但允许出现空的 catch 子句
// 注释
"spaced-comment": "error", // 注释前有空格
"no-mixed-spaces-and-tabs": "error", // 禁止使用 空格 和 tab 混合缩进
"space-before-blocks": [
"lines-around-comment": [
"error",
{
"beforeBlockComment": false
}
], // 块级注释前要有空行
// 空白
"indent": [
"error",
"always"
], // 语句块之前的需要有空格
4,
{
"SwitchCase": 1
}
], // 缩进控制4空格
"no-mixed-spaces-and-tabs": "error", // 禁止使用 空格 和 tab 混合缩进
"space-before-blocks": ["error", "always"], // 语句块之前的需要有空格
"keyword-spacing": "error", // 关键字后面必须要有空格
"space-infix-ops": [
"error",
@ -207,32 +174,14 @@ module.exports = {
], // 要求中缀操作符周围有空格,设置 int32Hint 选项为 true (默认 false) 允许 a|0 不带空格
"eol-last": "error", // 要求文件末尾保留一行空行
"newline-per-chained-call": "error", // 要求方法链中每个调用都有一个换行符
"padded-blocks": [
"error",
"never"
], // 代码块开始和结束位置不可以有多余的空行
"space-in-parens": [
"error",
"never"
], // 禁止圆括号内的空格
"array-bracket-spacing": [
"error",
"never"
], // 数组紧贴括号部分不允许包含空格
"object-curly-spacing": [
"error",
"never"
], // 对象紧贴花括号部分不允许包含空格
"padded-blocks": ["error", "never"], // 代码块开始和结束位置不可以有多余的空行
"space-in-parens": ["error", "never"], // 禁止圆括号内的空格
"array-bracket-spacing": ["error", "never"], // 数组紧贴括号部分不允许包含空格
"object-curly-spacing": ["error", "always"], // 对象紧贴花括号部分不允许包含空格
"no-regex-spaces": "error", // 禁止正则表达式字面量中出现多个空格
"no-multi-spaces": "error", // 禁止出现多个空格而且不是用来作缩进的
"block-spacing": [
"error",
"never"
], // 单行代码块中紧贴括号部分不允许包含空格
"computed-property-spacing": [
"error",
"never"
], // 禁止括号和其内部值之间的空格
"block-spacing": ["error", "never"], // 单行代码块中紧贴括号部分不允许包含空格
"computed-property-spacing": ["error", "never"], // 禁止括号和其内部值之间的空格
"no-trailing-spaces": [
"error",
{
@ -250,10 +199,7 @@ module.exports = {
], // 强制 yield* 表达式中 * 号前有空格,后无空格
// 逗号
"comma-style": "error", // 逗号必须放在行末
"comma-dangle": [
"error",
"always-multiline"
], // 多行对象字面量中要求拖尾逗号
"comma-dangle": ["error", "always-multiline"], // 多行对象字面量中要求拖尾逗号
"comma-spacing": [
"error",
{
@ -276,7 +222,8 @@ module.exports = {
"no-extra-boolean-cast": "error", // 禁止不必要的布尔类型转换
// 其他最佳实践或规范
"strict": "error", // 使用强制模式开关use strict;
// "@typescript-eslint/no-extra-parens": ["error"],
// 禁止冗余的括号
"@typescript-eslint/no-extra-parens": ["error"],
"no-eval": "error", // 禁用 eval()
"no-with": "error", // 禁用 with 语句
"no-unexpected-multiline": "error", // 禁止使用令人困惑的多行表达式

7
.gitattributes vendored

@ -1,7 +0,0 @@
* text=auto !eol
designer_scripts/designer_scripts.iml -text
designer_scripts/src/readme.md -text
designer_scripts/src/scripts/store/web/index.html -text
designer_scripts/src/scripts/store/web/js/bridge.js -text
designer_scripts/src/scripts/store/web/js/lib/jquery-2.2.2.min.js -text
designer_scripts/src/scripts/store/web/js/store.js -text

11
.gitignore vendored

@ -1,3 +1,10 @@
node_modules
yarn.lock
/node_modules
/bower_components
.idea/
.DS_Store
/constants/classes/
dist
package-lock.json
.vscode
yarn-error.log
.history/

239
README.md

@ -5,149 +5,216 @@
![finui](https://img.shields.io/badge/lib-FinUi-blue.svg)
## 开始
下载代码
```
git clone ssh://git@cloud.finedevelop.com:7999/~alan/database-connection.git
```
安装依赖
```
yarn
```
开始开发
```
yarn start
yarn dev
```
## 接口文档
## 接口文档
### 增加数据连接类型
使用`BI.config`,ConstantName名称为`dec.constant.database.conf.connect.list`,值为连接的名称
使用`BI.config`,ConstantName名称为`dec.constant.database.conf.connect.types`,值为连接的名称
例如增加`Redis`的连接:
```js
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']);
BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
```
### 数据连接填写页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.edit`,值为组件shortcut的名称
ConstantName名称为`dec.constant.database.conf.connect.form.${name}.edit`,值为组件shortcut的名称
例如配置`Redis`的连接填写页面:
### 数据连接展示页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name}.show`,值为组件shortcut的名称
```js
const className = 'fr.plugin.redis.preview';
const RedisPreview = BI.inherit(BI.Widget, {
### 示例
```
const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';
BI.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisShow = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const o = this.options;
return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
cls: 'title',
items: [{
type: 'bi.editor',
watermark:'这里是编辑页',
}],
};
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
});
BI.shortcut(className, RedisPreview);
BI.constant('dec.constant.database.conf.connect.form.redis.edit', className);
```
### 数据连接预览页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.show`,值为组件shortcut的名称
例如配置`Redis`的连接预览页面:
```js
const className = 'fr.plugin.redis.edit';
const RedisPreview = BI.inherit(BI.Widget, {
render() {
return {
{
type: 'bi.label',
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.label',
text: o.formData.port,
},
],
},
{
type: 'bi.left',
cls: 'title',
items: [{
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.label',
text:'这里是预览页',
}],
text: o.formData.password,
},
],
},
],
};
},
});
BI.shortcut(className, RedisPreview);
BI.constant('dec.constant.database.conf.connect.form.redis.edit', className);
```
### 插件配置表单值传递
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.value`,值为插件数据结构
例如:
```js
const ConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = {
url:'192.168.1.22',
port: 6379,
password: '123456'
};
BI.config(ConstantName, (data: object) => form);
```
### 数据连接池页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.pool`,值为组件shortcut的名称
例如配置`Redis`的连接预览页面:
BI.shortcut(RedisShowName, RedisShow);
BI.constant(ConstantRedisShow, RedisShowName);
```js
const classNamePool = 'fr.plugin.redis.pool';
const WidgetPool = BI.inherit(BI.Widget, {
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
const RedisEdit = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options;
const o = this.options;
return {
type: 'bi.left',
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
cls: 'right-status-item',
items: [
{
type: 'bi.vertical',
cls:'right-status-board',
items: [
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
{
type: 'bi.vertical',
cls:'right-status-board-item',
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.url = _ref;
},
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'right-status-text',
extraCls: 'card-font1',
text: numActive,
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.label',
cls: 'right-status-text',
text: '/',
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.port = _ref;
},
{
type: 'bi.label',
cls: 'right-status-text',
text: maxActive,
text: o.formData.port,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
text: 'Redis连接数',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
],
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
inputType: 'password',
ref: _ref => {
this.password = _ref;
},
text: o.formData.password,
},
],
},
],
};
},
getSubmitValue() {
return {
url: this.url.getValue(),
port: this.port.getValue(),
password: this.password.getValue(),
};
},
});
BI.shortcut(classNamePool, WidgetPool);
BI.constant('dec.constant.database.conf.connect.form.redis.pool', classNamePool);
BI.shortcut(RedisEditName, RedisEdit);
BI.constant(ConstantRedisEdit, RedisEditName);
});
```

29
babel.config.js

@ -0,0 +1,29 @@
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
config/fineui.prepare.js

@ -0,0 +1,6 @@
!(function () {
// 先把准备环境准备好
while (BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
}());

48
config/fineui.setup.js

@ -0,0 +1,48 @@
!(function () {
Report = {
SessionMgr: {
get() {
return '';
},
},
};
let target = null;
const targetStack = [];
function pushTarget (_target) {
if (target) {
targetStack.push(target);
}
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
Fix.Test = {
makeContext: (state, fn) => {
const Store = BI.inherit(Fix.Model, {
state,
childContext: Object.keys(state),
});
const store = new Store();
pushTarget(store);
fn(store);
popTarget();
return store;
},
extractContext: (model, contextList) => {
BI.each(BI.deepClone(model), key => {
if (BI.contains(contextList, key)) {
return;
}
delete model[key];
});
return model;
},
};
}());

34
config/jest.environment.js

@ -0,0 +1,34 @@
const JsdomEnvironment = require('jest-environment-jsdom');
const path = require('path');
const fs = require('fs');
class FineUiEnvironment extends JsdomEnvironment {
async setup(...args) {
await super.setup(args);
const document = this.dom.window.document;
document.createElement('body');
[
'../node_modules/fineui/dist/fineui.js',
'../node_modules/fineui-materials/docs/materials.js',
'../config/fineui.prepare.js',
'./fineui.setup.js',
].forEach(scriptRelativePath => {
writeScript(document, scriptRelativePath);
});
return Promise.resolve();
}
}
function writeScript(document, scriptRelativePath) {
const scriptEl = document.createElement('script');
scriptEl.text = fs.readFileSync(path.resolve(__dirname, scriptRelativePath), {
encoding: 'utf8',
});
document.body.appendChild(scriptEl);
}
module.exports = FineUiEnvironment;

238
i18n/zh_cn.properties

@ -1,11 +1,23 @@
Dec-Dcm_Connection_New= 新建数据连接
Dec-Dcm_Connection_Name= 数据连接名称
Dec-Dcm_Connection_None= 无可用数据连接,请点击添加
Dec-Dcm_Connection_Test= 测试连接
Dec-Dcm_Connection_Commonly= 常用
Dec-Dcm_Connection_Type_Filter= 类型筛选:
Dec-Dcm_Connection_Support_Inner= 内置支持
Dec-Dcm_Connection_Support_Plugin= 插件支持
Dec-Dcm_Connection_Filter_Tip= 提示:当前仅支持部分插件类型,未支持类型请使用设计器的旧版本数据连接进行创建
Dec-Dcm_Connection_All= 所有
Dec-Dcm_Connection_Other= 其他
Dec-Dcm_Connection_Management= 数据连接管理
Dec-Dcm_Pool_Connection_Management= 连接池管理
Dec-Dcm_Pool_Connection_Management= 连接池状态
Dec-Dcm_Data_Connections= 数据连接
Dec-Dcm_Active_Connections_Number= 活动连接数
Dec-Dcm_Leisure_Connections_Number= 空闲连接数
Dec-Dcm_Connections= 连接
Dec-Dcm_Default= 默认
Dec-Dcm_Delete= 删除
Dec-Dcm_Millisecond= 毫秒
Dec-Dcm_Test_Connection= 测试连接
Dec-Dcm_Copy= 复制
Dec-Dcm_Edit= 编辑
@ -13,18 +25,20 @@ Dec-Dcm_Save= 保存
Dec-Dcm_Yes= 是
Dec-Dcm_No= 否
Dec-Dcm_Search= 搜索
Dec-Dcm_Type= 类型
Dec-Dcm_Type= 类型:{R1}
Dec-Dcm_Other= 其他
Dec-Dcm_Tips= 提示
Dec-Dcm_Back= 返回
Dec-Dcm_Creator= 创建者
Dec-Dcm_Creator= 创建者:{R1}
Dec-Dcm_First_Step= 第一步
Dec-Dcm_Second_Step= 第二步
Dec-Dcm_Third_Step= 第三步
Dec-Dcm_Connection_ConnectionName_Cannt_Null= 数据连接名不可为空
Dec-Dcm_Connection_Np_Registered= 该类型暂仅支持在设计器中使用旧版本数据连接查看
Dec-Dcm_Connection_Detailed_Information= 详细信息
Dec-Dcm_Connection_Handup_Information= 收起信息
Dec-Dcm_Connection_Testing= 正在测试连接,请稍候...
Dec-Dcm_Connection_Test_Fail= 测试连接失败
Dec-Dcm_Connection_Test_Fail= {R1}测试连接失败
Dec-Dcm_Connection_Test_Success= 连接成功
Dec-Dcm_Connection_Option_Cannot_Find= 找不到该连接的配置信息
Dec-Dcm_Connection_Config_No_Save= 当前设置尚未保存,是否保存?
@ -34,15 +48,21 @@ Dec-Dcm_Connection_More_Title= 更多数据连接
Dec-Dcm_Connection_Other= 其他
Dec-Dcm_Connection_Plase_Add_One= 请选择左侧数据连接或点击新建数据连接
Dec-Dcm_Connection_Is_Existence= 数据连接名已存在
Dec-Dcm_Connection_No_Search_Result= 无搜索结果
Dec-Dcm_Connection_Form_ConnectionName= 数据连接名
Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm= *修改数据连接名会影响相关数据表和仪表板
Dec-Dcm_Connection_Form_Driver= 驱动
Dec-Dcm_Connection_Form_Driver= 驱动
Dec-Dcm_Connection_Form_URL= URL
Dec-Dcm_Connection_Form_Database_URL= 数据库URL
Dec-Dcm_Connection_Form_Place_Input= 请输入
Dec-Dcm_Connection_Form_OriginalCharsetName= 编码
Dec-Dcm_Connection_Form_Auto= 自动
Dec-Dcm_Connection_Form_Host= 主机
Dec-Dcm_Connection_Form_AuthType= 认证方式
Dec-Dcm_Connection_Form_UserName= 用户名
Dec-Dcm_Connection_Form_Password= 密码
Dec-Dcm_Connection_Form_Principal= 客户端principal
Dec-Dcm_Connection_Form_KeyPath= keytab密钥路径
Dec-Dcm_Connection_Form_Pool_Properties= 连接池属性
Dec-Dcm_Connection_Form_SQL_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Connection-Check= 获取连接前校验
@ -50,11 +70,217 @@ Dec-Dcm_Connection_Form_Connection_Max_Number= 最大活动连接数
Dec-Dcm_Connection_Form_Place_Input-Number= 请输入有效的正整数
Dec-Dcm_Connection_Form_Pattern= 模式
Dec-Dcm_Connection_Form_Database_Addr= 数据库地址
Dec-Dcm_Connection_Form_Database_Port= 端口号
Dec-Dcm_Connection_Form_Database_Name= 数据库名称
Dec-Dcm_Connection_Form_Database_Port= 端口
Dec-Dcm_Connection_Form_Database_Advanced_Setting= 高级设置
Dec-Dcm_Connection_Form_Database_Initial_Size= 初始化连接数
Dec-Dcm_Connection_Form_Database_Max_Active= 最大活动连接数
Dec-Dcm_Connection_Form_Database_Max_Idle= 最大空闲连接数
Dec-Dcm_Connection_Form_Database_Max_Wait= 最大等待时间
Dec-Dcm_Connection_Form_Database_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Database_Test_On_Borrow= 获取连接前检验
Dec-Dcm_Connection_Form_Database_Test_On_Return= 归还连接前检验
Dec-Dcm_Connection_Form_Database_Test_While_Idle= 开启空闲回收器检验
Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis= 空闲连接回收器休眠时间
Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num= 空闲连接回收检查数
Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis= 保持空闲最小时间值
Dec-Dcm_Connection_Make_Sure_Delete= 确定删除该数据连接?
Dec-Dcm_Connection_ReConnect= 重新连接
Dec-Dcm_Connection_JNDI_Form_ConnectionName= JNDI的名字
Dec-Dcm_Connection_JNDI_Form_Connection= 数据来自数据连接
Dec-Dcm_Connection_Form_JNDI_Context= 上下文
Dec-Dcm_Connection_Form_JNDI_Advanced= 高级
Dec-Dcm_Connection_Form_JNDI_Other_Attributes= 其他属性
Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes= 收起
Dec-Dcm_Connection_JNDI= JNDI数据连接
Dec-Dcm_Connection_JNDI_Warning= 注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下
Dec-Dcm_Connection_Error= 接口访问错误
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= 此刻

44
index.html

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Fine Report</title>
<!--核心css文件-->
<link
rel="preload"
href="./node_modules/fineui/dist/font/iconfont.woff"
as="font"
type="font/woff"
crossorigin=""
/>
<link
rel="preload"
href="assets/font/iconfont.woff"
as="font"
type="font/woff"
crossorigin=""
/>
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui/dist/fineui.css"
/>
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui-materials/docs/materials.css"
/>
</head>
<script>
var DecCst = null;
var Dec = null;
</script>
<body id="body">
<div id="wrapper"></div>
<script src="./node_modules/fineui/dist/fineui.js"></script>
<script src="./node_modules/fineui/i18n/i18n.cn.js"></script>
<script src="./node_modules/fineui-materials/docs/materials.js"></script>
<script src="./redis.js"></script>
</body>
</html>

26
jest.config.js

@ -0,0 +1,26 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
// which contains the path mapping (ie the `compilerOptions.paths` option):
const { jsonc } = require('jsonc');
const { readFileSync } = require('fs');
const { compilerOptions } = jsonc.parse(readFileSync('./tsconfig.json', { encoding: 'utf8' }));
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testEnvironment: './config/jest.environment.js',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
globals: {
'ts-jest': {
diagnostics: {
ignoreCodes: ['TS151001'],
},
},
},
};

15
lib/transform-i18n/transform-i18n.js

@ -0,0 +1,15 @@
const { resolve } = require('path');
const { writeFileSync } = require('fs');
const propertiesReader = require('properties-reader');
let content = '';
const properties = propertiesReader(resolve(__dirname, '../../i18n/zh_cn.properties'));
properties.each((key, value) => {
content += ` '${key}': '${value}',\n`;
});
writeFileSync(resolve(__dirname, '../../private/i18n.ts'), `export default {
${content}};
`);

7
lib/upgrade/index.js

@ -0,0 +1,7 @@
const { execSync } = require('child_process');
const repositories = ['fineui', 'fineui-materials'];
repositories.forEach(repository => {
execSync(`yarn upgrade ${repository}`);
});

103
package.json

@ -1,38 +1,81 @@
{
"name": "database-connection",
"name": "decision-webui-dcm",
"version": "1.0.0",
"description": "数据连接设置页面",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --mode development --open",
"build": "webpack --mode production"
"description": "",
"main": "src/index.ts",
"repository": "",
"author": "decision",
"license": "MIT",
"dependencies": {
"@types/jss": "9.5.8",
"autoprefixer": "^9.6.1",
"es6-promise": "4.2.6",
"jss": "9.8.7",
"jss-plugin-global": "10.0.0-alpha.7",
"jss-plugin-nested": "10.0.0-alpha.7",
"nprogress": "0.2.0"
},
"author": "alan <alan@fanrun.com>",
"license": "ISC",
"devDependencies": {
"@types/node": "^12.0.2",
"@typescript-eslint/eslint-plugin": "^1.6.0",
"@typescript-eslint/parser": "^1.6.0",
"copy-webpack-plugin": "^5.0.2",
"css-loader": "^2.1.1",
"eslint": "^5.16.0",
"file-loader": "^3.0.1",
"html-webpack-plugin": "^3.2.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"mini-css-extract-plugin": "^0.6.0",
"node-sass": "^4.11.0",
"path": "^0.12.7",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"ts-loader": "^5.3.3",
"typescript": "^3.4.1",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1",
"webpack-stream": "^5.2.1"
"@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",
"axios": "0.18.0",
"babel-loader": "8.0.6",
"body-parser": "1.18.3",
"chokidar": "2.1.5",
"cross-env": "5.2.0",
"css-loader": "3.0.0",
"eslint": "5.16.0",
"eslint-plugin-jest": "22.4.1",
"express": "4.16.4",
"html-webpack-plugin": "3.2.0",
"http-proxy": "1.17.0",
"husky": "1.3.1",
"jest": "24.7.1",
"jest-environment-jsdom": "24.7.1",
"jsdom": "15.0.0",
"jsonc": "1.1.0",
"less": "3.9.0",
"less-loader": "5.0.0",
"mini-css-extract-plugin": "0.7.0",
"npm-run-all": "4.1.5",
"postcss-loader": "3.0.0",
"postcss-simple-vars": "5.0.2",
"properties-reader": "0.0.16",
"source-map-loader": "0.2.4",
"style-loader": "0.23.1",
"ts-jest": "24.0.2",
"typescript": "3.5.1",
"webpack": "4.35.2",
"webpack-cli": "3.3.5",
"webpack-dev-server": "3.7.2",
"webpack-merge": "4.2.1",
"ydoc": "4.1.0",
"ydoc-plugin-jsdoc": "0.0.3"
},
"optionalDependencies": {
"fineui": "git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git"
"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",
"eslint": "eslint './*.js' './**/*.js' './**/*.ts'",
"eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix",
"const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter",
"i18n": "node ./lib/transform-i18n/transform-i18n.js",
"test": "jest --passWithNoTests",
"upgrade": "node lib/upgrade"
},
"husky": {
"hooks": {
"pre-push": "npm run eslint && npm run test"
}
}
}

373
private/constants.ts

@ -1,373 +0,0 @@
export const OTHER_CONNECT = 'other';
export const JNDI_CONNECT = 'JNDI';
export const MYSQL_CONNECT = 'MySQL';
export const DEFAULT_INFO = 'DESIGNER';
export const ACTION_DELETE = 'ACTION_DELETE';
export const ACTION_COPY = 'ACTION_COPY';
export const ACTION_TEST = 'ACTION_TEST';
export const TAB_LINK_SET = 'TAB_LINK_SET';
export const TAB_LINK_POOL = 'TAB_LINK_POOL';
export const DATA_LINKS = ['APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200', 'JNDI'];
export const DATA_BASE_TYPE_OTHER = [
{
text: 'ADS',
databaseType: 'ads',
driver: 'com.mysql.jdbc.Driver',
url: 'jdbc:mysql://hostname:port/my_ads_db',
},
{
text: 'Amazon Redshift',
databaseType: 'amazon-redshift',
driver: 'com.amazon.redshift.jdbc4.Driver',
drivers: ['com.amazon.redshift.jdbc4.Driver', 'com.amazon.redshift.jdbc41.Driver'],
url: 'jdbc:redshift://endpoint:port/database',
},
{
text: 'APACHE IMPALA',
databaseType: 'apache-impala',
driver: 'com.cloudera.impala.jdbc41.Driver',
url: 'jdbc:impala://hostname:port/_impala_builtins',
},
{
text: 'APACHE KYLIN',
databaseType: 'apache-kylin',
driver: 'org.apache.kylin.jdbc.Driver',
url: 'jdbc:kylin://<hostname>:<port>/<kylin_project_name>',
},
{
text: 'APACHE Phoenix',
databaseType: 'apache-phoenix',
driver: 'org.apache.phoenix.jdbc.PhoenixDriver',
url: 'jdbc:phoenix:hostname:port/dbname',
},
{
text: 'DERBY',
databaseType: 'derby',
driver: 'org.apache.derby.jdbc.ClientDriver',
url: 'jdbc:derby://localhost:1527/',
},
{
text: 'Gbase 8A',
databaseType: 'gbase-8a',
driver: 'com.gbase.jdbc.Driver',
url: 'jdbc:gbase://hostname:port/dbname',
},
{
text: 'Gbase 8S',
databaseType: 'gbase-8s',
driver: 'com.gbasedbt.jdbc.IfxDriver',
url: 'jdbc:gbasedbt-sqli://{host}:{port}/{database}',
},
{
text: 'Gbase 8T',
databaseType: 'gbase-8t',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
},
{
text: 'H2',
databaseType: 'h2',
driver: 'org.h2.Driver',
url: 'jdbc:h2://${ENV_HOME}/../databaseName',
},
{
text: '华为云DWS',
databaseType: 'hw-dws',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'FusionInsight elk',
databaseType: 'hw-elk',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'FusionInsight HD',
databaseType: 'hw-fusioninsight-hd',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://10.135.0.110:24002,10.135.0.67:24002,10.135.0.66:24002/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;sasl.qop=auth-conf;auth=KERBEROS;zk.principal=zookeeper/hadoop;principal=hive/hadoop.hadoop.com@HADOOP.COM;',
},
{
text: 'GaussDB 200',
databaseType: 'hw-libr-a',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Hadoop Hive',
databaseType: 'hadoop-hive',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
}, {
text: 'Hbase',
databaseType: 'hbase',
driver: 'org.apache.phoenix.jdbc.PhoenixDriver',
url: 'jdbc:phoenix:hostname:port/dbname',
}, {
text: 'HP Vertica',
databaseType: 'hp-vertica',
driver: 'com.vertica.jdbc.Driver',
url: 'jdbc:vertica://ip:port/databaseName',
}, {
text: 'Hsql',
databaseType: 'hsql',
driver: 'com.fr.third.org.hsqldb.jdbcDriver',
url: 'jdbc:hsqldb:file:[PATH_TO_DB_FILES]',
}, {
text: 'IBM DB2',
databaseType: 'ibm-db2',
driver: 'com.ibm.db2.jcc.DB2Driver',
url: 'jdbc:db2://hostname:port/dbname',
}, {
text: 'INFORMIX',
databaseType: 'informix',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
}, {
text: 'KINGBASE',
databaseType: 'kingbase',
driver: 'com.kingbase.Driver',
url: 'jdbc:kingbase://hostname:port',
}, {
text: 'Microsoft SQL Server',
databaseType: 'sql-server',
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
url: 'jdbc:sqlserver://localhost:1433;databaseName=',
}, {
text: 'MySQL',
databaseType: 'mysql',
driver: 'com.mysql.jdbc.Driver',
drivers: ['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'],
url: 'jdbc:mysql://localhost/dbname',
},
{
text: 'Oracle',
databaseType: 'oracle',
driver: 'oracle.jdbc.driver.OracleDriver',
url: 'jdbc:oracle:thin:@localhost:1521:databaseName',
},
{
text: 'Pivotal Greenplum Database',
databaseType: 'pivotal-greenplum-database',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Postgresql',
databaseType: 'postgresql',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Presto',
databaseType: 'presto',
driver: 'com.facebook.presto.jdbc.PrestoDriver',
url: 'jdbc:presto://host:port/catalog',
}, {
text: 'SAP HANA',
databaseType: 'sap-hana',
driver: 'com.sap.db.jdbc.Driver',
url: 'jdbc:sap://hostname:port?reconnect=true',
}, {
text: 'SAP Sybase',
databaseType: 'sap-sybase',
driver: 'com.sybase.jdbc4.jdbc.SybDriver',
url: 'jdbc:sybase:Tds:hostname:2638/databasename',
}, {
text: 'SPARK',
databaseType: 'spark',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
}, {
text: 'Sqlite',
databaseType: 'sqlite',
driver: 'org.sqlite.JDBC',
url: 'jdbc:sqlite:[PATH_TO_DB_FILES]',
}, {
text: 'TeraData',
databaseType: 'teradata',
driver: 'com.ncr.teradata.TeraDriver',
url: 'jdbc:teradata://localhost/CLIENT_CHARSET=EUC_CN,TMODE=TERA,CHARSET=ASCII,LOB_SUPPORT',
}, {
text: 'TRANSWARP INCEPTOR',
databaseType: 'transwarp-inceptor',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
},
];
export const DATA_BASE_TYPE = [
{
text: 'APACHE KYLIN',
databaseType: 'apache-kylin',
driver: 'org.apache.kylin.jdbc.Driver',
url: 'jdbc:kylin://<hostname>:<port>/<kylin_project_name>',
},
{
text: 'DERBY',
databaseType: 'derby',
driver: 'org.apache.derby.jdbc.ClientDriver',
url: 'jdbc:derby://localhost:1527/',
},
{
text: 'HP Vertica',
databaseType: 'hp-vertica',
driver: 'com.vertica.jdbc.Driver',
url: 'jdbc:vertica://ip:port/databaseName',
},
{
text: 'IBM DB2',
databaseType: 'ibm-db2',
driver: 'com.ibm.db2.jcc.DB2Driver',
url: 'jdbc:db2://hostname:port/dbname',
},
{
text: 'INFORMIX',
databaseType: 'informix',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
},
{
text: 'Microsoft SQL Server',
databaseType: 'sql-server',
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
url: 'jdbc:sqlserver://localhost:1433;databaseName=',
},
{
text: 'Oracle',
databaseType: 'oracle',
driver: 'oracle.jdbc.driver.OracleDriver',
url: 'jdbc:oracle:thin:@localhost:1521:databaseName',
},
{
text: 'Privotal Greenplum Database',
databaseType: 'pivotal-greenplum-database',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'Postgresql',
databaseType: 'postgresql',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'GaussDB 200',
databaseType: 'hw-libr-a',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'MySQL',
databaseType: 'mysql',
driver: 'com.mysql.jdbc.Driver',
drivers: ['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'],
url: 'jdbc:mysql://localhost/dbname',
},
{
text: OTHER_CONNECT,
databaseType: 'other',
driver: 'org.h2.Driver',
drivers: ['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'],
url: 'jdbc:h2://${ENV_HOME}/../databaseName',
},
...DATA_BASE_TYPE_OTHER,
{
text: JNDI_CONNECT,
},
];
export const JNDI_FACTORYS = ['', 'weblogic.jndi.WLInitialContextFactory', 'com.ibm.websphere.naming.WsnInitialContextFactory', 'org.jboss.naming.HttpNamingContextFactory', 'org.jnp.interfaces.NamingContextFactory', 'com.caucho.burlap.BurlapContextFactory'];
export const OTHER_ATTRIBUTES = [
{
text: 'OBJECT_FACTORIES',
name: 'objectFactories',
},
{
text: 'STATE_FACTORIES',
name: 'stateFactories',
},
{
text: 'URL_PKG_PREFIXES',
name: 'urlPkgPrefixes',
},
{
text: 'DNS_URL',
name: 'dnsUrl',
},
{
text: 'AUTHORITATIVE',
name: 'authoritative',
},
{
text: 'BATCHSIZE',
name: 'batchSize',
},
{
text: 'REFERRAL',
name: 'referral',
},
{
text: 'SECURITY_PROTOCOL',
name: 'securityProtocol',
},
{
text: 'SECURITY_AUTHENTICATION',
name: 'securityAuthentication',
},
{
text: 'LANGUAGE',
name: 'language',
},
{
text: 'APPLET',
name: 'applet',
},
];
export const CONNECT_CHARSET = [
{
text: 'GBK',
value: 'GBK',
},
{
text: 'BIG5',
value: 'BIG5',
},
{
text: 'ISO-8859-1',
value: 'ISO-8859-1',
},
{
text: 'UTF-8',
value: 'UTF-8',
},
{
text: 'UTF-16',
value: 'UTF-16',
},
{
text: 'EUC_JP',
value: 'EUC_JP',
},
{
text: 'EUC_KR',
value: 'EUC_KR',
},
{
text: 'CP850',
value: 'CP850',
},
];
const DecDcm = {
TEST_STATUS_WAITING: 1,
TEST_STATUS_SUCCESS: 2,
TEST_STATUS_FAIL: 3,
};
export default DecDcm;

241
private/i18n.ts

@ -1,12 +1,24 @@
export default {
'Dec-Dcm_Connection_New': '新建数据连接',
'Dec-Dcm_Connection_Name': '数据连接名称',
'Dec-Dcm_Connection_None': '无可用数据连接,请点击添加',
'Dec-Dcm_Connection_Test': '测试连接',
'Dec-Dcm_Connection_Commonly': '常用',
'Dec-Dcm_Connection_Type_Filter': '类型筛选:',
'Dec-Dcm_Connection_Support_Inner': '内置支持',
'Dec-Dcm_Connection_Support_Plugin': '插件支持',
'Dec-Dcm_Connection_Filter_Tip': '提示:当前仅支持部分插件类型,未支持类型请使用设计器的旧版本数据连接进行创建',
'Dec-Dcm_Connection_All': '所有',
'Dec-Dcm_Connection_Other': '其他',
'Dec-Dcm_Connection_Management': '数据连接管理',
'Dec-Dcm_Pool_Connection_Management': '连接池管理',
'Dec-Dcm_Pool_Connection_Management': '连接池状态',
'Dec-Dcm_Data_Connections': '数据连接',
'Dec-Dcm_Active_Connections_Number': '活动连接数',
'Dec-Dcm_Leisure_Connections_Number': '空闲连接数',
'Dec-Dcm_Connections': '连接',
'Dec-Dcm_Default': '默认',
'Dec-Dcm_Delete': '删除',
'Dec-Dcm_Millisecond': '毫秒',
'Dec-Dcm_Test_Connection': '测试连接',
'Dec-Dcm_Copy': '复制',
'Dec-Dcm_Edit': '编辑',
@ -14,36 +26,42 @@ export default {
'Dec-Dcm_Yes': '是',
'Dec-Dcm_No': '否',
'Dec-Dcm_Search': '搜索',
'Dec-Dcm_Type': '类型',
'Dec-Dcm_Type': '类型:{R1}',
'Dec-Dcm_Other': '其他',
'Dec-Dcm_Tips': '提示',
'Dec-Dcm_Back': '返回',
'Dec-Dcm_Creator': '创建者',
'Dec-Dcm_Creator': '创建者:{R1}',
'Dec-Dcm_First_Step': '第一步',
'Dec-Dcm_Second_Step': '第二步',
'Dec-Dcm_Third_Step': '第三步',
'Dec-Dcm_Connection_ConnectionName_Cannt_Null': '数据连接名不可为空',
'Dec-Dcm_Connection_Np_Registered': '该类型暂仅支持在设计器中使用旧版本数据连接查看',
'Dec-Dcm_Connection_Detailed_Information': '详细信息',
'Dec-Dcm_Connection_Handup_Information': '收起信息',
'Dec-Dcm_Connection_Testing': '正在测试连接,请稍候...',
'Dec-Dcm_Connection_Test_Fail': '测试连接失败',
'Dec-Dcm_Connection_Test_Fail': '{R1}测试连接失败',
'Dec-Dcm_Connection_Test_Success': '连接成功',
'Dec-Dcm_Connection_Option_Cannot_Find': '找不到该连接的配置信息',
'Dec-Dcm_Connection_Config_No_Save': '当前设置尚未保存,是否保存?',
'Dec-Dcm_Connection_New': '新建数据连接',
'Dec-Dcm_Connection_More': '更多数据连接...',
'Dec-Dcm_Connection_More_Title': '更多数据连接',
'Dec-Dcm_Connection_Other': '其他',
'Dec-Dcm_Connection_Plase_Add_One': '请选择左侧数据连接或点击新建数据连接',
'Dec-Dcm_Connection_Is_Existence': '数据连接名已存在',
'Dec-Dcm_Connection_No_Search_Result': '无搜索结果',
'Dec-Dcm_Connection_Form_ConnectionName': '数据连接名',
'Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm': '*修改数据连接名会影响相关数据表和仪表板',
'Dec-Dcm_Connection_Form_Driver': '驱动',
'Dec-Dcm_Connection_Form_Driver': '驱动',
'Dec-Dcm_Connection_Form_URL': 'URL',
'Dec-Dcm_Connection_Form_Database_URL': '数据库URL',
'Dec-Dcm_Connection_Form_Place_Input': '请输入',
'Dec-Dcm_Connection_Form_OriginalCharsetName': '编码',
'Dec-Dcm_Connection_Form_Auto': '自动',
'Dec-Dcm_Connection_Form_Host': '主机',
'Dec-Dcm_Connection_Form_AuthType': '认证方式',
'Dec-Dcm_Connection_Form_UserName': '用户名',
'Dec-Dcm_Connection_Form_Password': '密码',
'Dec-Dcm_Connection_Form_Principal': '客户端principal',
'Dec-Dcm_Connection_Form_KeyPath': 'keytab密钥路径',
'Dec-Dcm_Connection_Form_Pool_Properties': '连接池属性',
'Dec-Dcm_Connection_Form_SQL_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Connection-Check': '获取连接前校验',
@ -51,13 +69,218 @@ export default {
'Dec-Dcm_Connection_Form_Place_Input-Number': '请输入有效的正整数',
'Dec-Dcm_Connection_Form_Pattern': '模式',
'Dec-Dcm_Connection_Form_Database_Addr': '数据库地址',
'Dec-Dcm_Connection_Form_Database_Port': '端口号',
'Dec-Dcm_Connection_Form_Database_Name': '数据库名称',
'Dec-Dcm_Connection_Form_Database_Port': '端口',
'Dec-Dcm_Connection_Form_Database_Advanced_Setting': '高级设置',
'Dec-Dcm_Connection_Form_Database_Initial_Size': '初始化连接数',
'Dec-Dcm_Connection_Form_Database_Max_Active': '最大活动连接数',
'Dec-Dcm_Connection_Form_Database_Max_Idle': '最大空闲连接数',
'Dec-Dcm_Connection_Form_Database_Max_Wait': '最大等待时间',
'Dec-Dcm_Connection_Form_Database_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Database_Test_On_Borrow': '获取连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_On_Return': '归还连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_While_Idle': '开启空闲回收器检验',
'Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis': '空闲连接回收器休眠时间',
'Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num': '空闲连接回收检查数',
'Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis': '保持空闲最小时间值',
'Dec-Dcm_Connection_Make_Sure_Delete': '确定删除该数据连接?',
'Dec-Dcm_Connection_ReConnect': '重新连接',
'Dec-Dcm_Connection_JNDI_Form_ConnectionName': 'JNDI的名字',
'Dec-Dcm_Connection_JNDI_Form_Connection': '数据来自数据连接',
'Dec-Dcm_Connection_Form_JNDI_Context': '上下文',
'Dec-Dcm_Connection_Form_JNDI_Advanced': '高级',
'Dec-Dcm_Connection_Form_JNDI_Other_Attributes': '其他属性',
'Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes': '收起',
'Dec-Dcm_Connection_Form_JNDI_Notice': '注意:需要把包含INITIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下.',
'Dec-Dcm_Connection_JNDI': 'JNDI数据连接',
'Dec-Dcm_Connection_JNDI_Warning': '注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下',
'Dec-Dcm_Connection_Error': '接口访问错误',
'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': '此刻',
};

180
redis.js

@ -0,0 +1,180 @@
const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';
BI.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisShow = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const o = this.options;
return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
{
type: 'bi.label',
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.label',
text: o.formData.port,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.label',
text: o.formData.password,
},
],
},
],
};
},
});
BI.shortcut(RedisShowName, RedisShow);
BI.constant(ConstantRedisShow, RedisShowName);
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
const RedisEdit = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const o = this.options;
return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.url = _ref;
},
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.port = _ref;
},
text: o.formData.port,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
inputType: 'password',
ref: _ref => {
this.password = _ref;
},
text: o.formData.password,
},
],
},
],
};
},
getSubmitValue() {
return {
url: this.url.getValue(),
port: this.port.getValue(),
password: this.password.getValue(),
};
},
});
BI.shortcut(RedisEditName, RedisEdit);
BI.constant(ConstantRedisEdit, RedisEditName);
});

4
src/app/app.constant.ts

@ -1,4 +0,0 @@
export const ConstantName = 'dec.constant.database.conf.connect.list';
BI.constant(ConstantName, [
]);
export default ConstantName;

39
src/app/app.model.ts

@ -1,39 +0,0 @@
const className = 'dec.dcm.model.main';
import {ModelType} from '@ui';
import {LinkType} from '@ui/type';
import {fetchLinkList} from '../shared/crud/crud.request';
import {TAB_LINK_SET} from '@private/constants';
const linkList: LinkType[] = [];
const Model: ModelType = {
childContext: ['tab', 'linkList', 'linkSelected', 'linkUpdate', 'moreLinkSelected', 'statusSelected', 'connectionNameErr'],
state () {
return {
tab: '',
linkList,
linkSelected: {},
linkUpdate: {},
moreLinkSelected: '',
statusSelected: '',
connectionNameErr: '',
};
},
computed: {
},
actions: {
initData(callback: Function) {
fetchLinkList((linkList: LinkType[]) => {
this.model.linkList = linkList;
this.model.tab = TAB_LINK_SET;
callback();
});
},
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

55
src/app/app.ts

@ -1,55 +0,0 @@
import {Vtape, Absolute, LinearSegment} from '../ui/index';
import appModel from './app.model';
import title from './title/title';
import linkSet from './connection/link_set';
import linkStatus from './status/link_status';
import '../less/index.less';
const className = 'dec.dcm.main';
const Widget = BI.inherit(BI.Widget, {
props: {
baseCls: 'dec-webui-dcm-layout bi-background',
},
_store() {
return BI.Models.getModel(appModel);
},
beforeInit (callback) {
this.store.initData(callback);
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: title,
},
height: 40,
},
{
type: Absolute,
items: [{
el: {
type: linkSet,
},
left: 10,
top: 10,
right: 10,
bottom: 10,
}, {
el: {
type: linkStatus,
},
left: 10,
top: 10,
right: 10,
bottom: 10,
}],
},
],
};
},
});
BI.shortcut(className, Widget);
export default className;

4
src/app/connection/left/item/left_item.less

@ -1,4 +0,0 @@
@import '../../../../less/index.less';
.dec-webui-dcm-connection-left-item{
.hover-visible(link-item-icon);
}

77
src/app/connection/left/item/left_item.ts

@ -1,77 +0,0 @@
import './left_item.less';
import {WidgetType, Icon, TextButton, LeftRightVerticalAdapt} from '@ui';
import ItemIcon from './left_item_icon';
import ItemDelete from './left_item_delete';
import Model from '../../link_set.model';
import {ACTION_COPY, ACTION_TEST, ACTION_DELETE, DEFAULT_INFO} from '@private/constants';
const className = 'dec.dcm.component.linkSet.left.item';
const Widget: WidgetType = {
props: {
title: '',
id: '',
creator: '',
baseCls: 'dec-webui-dcm-connection-left-item bi-list-item-active',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title, creator, text, id} = this.options;
return {
type: LeftRightVerticalAdapt,
items: {
left: [
{
type: Icon,
cls: 'dcm-link-font',
height: 25,
width: 25,
text: BI.i18nText('Dec-Dcm_Connections'),
title,
},
{
type: TextButton,
text: title,
title,
},
],
right: [
{
type: ItemIcon,
cls: 'link-item-icon dcm-test-font',
title: BI.i18nText('Dec-Dcm_Test_Connection'),
value: ACTION_TEST,
id,
},
{
type: ItemIcon,
cls: 'link-item-icon copy-font',
title: BI.i18nText('Dec-Dcm_Copy'),
value: ACTION_COPY,
id,
},
{
type: ItemIcon,
cls: 'link-item-icon dcm-info-font',
title: `${BI.i18nText('Dec-Dcm_Type')}${text === DEFAULT_INFO ? BI.i18nText('Dec-Dcm_Other') : text} \r\n${BI.i18nText('Dec-Dcm_Creator')}${creator}`,
id,
},
{
type: ItemDelete,
cls: 'link-item-icon dcm-delete-font',
title: BI.i18nText('Dec-Dcm_Delete'),
value: ACTION_DELETE,
id,
},
],
},
};
},
doClick() {
const {title} = this.options;
this.store.setLinkSelected(title);
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

43
src/app/connection/left/item/left_item_delete.ts

@ -1,43 +0,0 @@
import {WidgetType, Icon, BubbleCombo, TextBubblePopupBarView} from '@ui';
import Model from '../../link_set.model';
const className = 'dec.dcm.component.linkSet.left.item.icon.delete';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title, id} = this.options;
const that = this;
return {
type: BubbleCombo,
stopPropagation: true,
direction: 'bottom',
ref: _ref => {
this.combo = _ref;
},
el: {
type: Icon,
height: 25,
width: 25,
title,
},
popup: {
type: TextBubblePopupBarView,
text: BI.i18nText('Dec-Dcm_Connection_Make_Sure_Delete'),
listeners: [{
eventName: BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,
action (type: boolean) {
that.combo.hideView();
if (type) {
that.store.onIconClick(title, id);
}
},
}],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

26
src/app/connection/left/item/left_item_icon.ts

@ -1,26 +0,0 @@
import {WidgetType, IconButton} from '@ui';
import Model from '../../link_set.model';
const className = 'dec.dcm.component.linkSet.left.item.icon';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title} = this.options;
return {
type: IconButton,
height: 25,
width: 25,
stopPropagation: true,
title,
handler: () => {
const {id, title} = this.options;
this.store.onIconClick(title, id);
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

39
src/app/connection/left/left.ts

@ -1,39 +0,0 @@
import {WidgetType, ListView} from '@ui';
import Model from '../link_set.model';
import {LinkType} from '@ui/type';
import LeftItem from './item/left_item';
const className = 'dec.dcm.component.linkset.left';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkList(linkList: LinkType[]) {
this.leftContent.populate(BI.createItems(this._renderItems(linkList)));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.leftContent = _ref;
},
items: this._renderItems(this.model.linkList),
};
},
_renderItems(linkList: LinkType[]) {
return BI.map(linkList, (index: number, item: LinkType) => {
return {
type: LeftItem,
selected: item.isSelected,
title: item.connectionName,
id: item.connectionId,
creator: item.creator,
text: item.text ? item.text : BI.i18nText('Dec-Dcm_Default'),
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

50
src/app/connection/link_set.mixin.ts

@ -1,50 +0,0 @@
import {LinkType} from '@ui/type';
import {saveConnection} from './link_set.service';
const mixinName = 'dec.dcm.minxin.linkset';
const Mixin = {
setConnectionNameErr(err: string) {
this.model.connectionNameErr = err;
},
setEdit(type: boolean) {
this.model.linkSelected = {
...this.model.linkSelected,
isSelected: type,
};
this.model.linkUpdate = this.model.linkSelected;
},
setCancel() {
const linkSelected: LinkType = this.model.linkSelected;
const linkList: LinkType[] = this.model.linkList;
if (linkSelected.connectionId) {
this.setEdit(false);
} else {
this.model.linkList = [
...linkList.filter(item => !!item.connectionId),
];
if (this.model.linkList.length > 0) {
this.model.linkList[0].isSelected = true;
this.model.linkSelected = {
...this.model.linkList[0],
isSelected: false,
};
} else {
this.model.linkSelected = {};
}
this.model.linkUpdate = this.model.linkSelected;
}
},
saveLink() {
const pluginData = this.model.linkUpdate.text ? BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${this.model.linkUpdate.text.toLowerCase()}.value`) : {};
const update = {
...this.model.linkUpdate,
...pluginData,
};
saveConnection(update).then(() => {
this.setEdit(false);
});
},
};
Fix.mixin(mixinName, Mixin);
export default mixinName;

154
src/app/connection/link_set.model.ts

@ -1,154 +0,0 @@
import {LinkType} from '@ui/type';
import {deleteConnection, testConnection} from '@shared/crud/crud.request';
import {getCnnectionName} from './select/select.service';
import {DATA_BASE_TYPE} from '@private/constants';
import dialog from '@shared/service/dialog.service';
import Mixin from './link_set.mixin';
const className = 'dec.dcm.model.linkset';
const Model = {
context: ['tab', 'linkList', 'linkSelected', 'linkUpdate', 'connectionNameErr'],
mixins: [Mixin],
actions: {
/**
*
* @param name
*/
setLinkSelected(name: string) {
this._noSaveConfirm(() => {
this._setLinkSelected(name);
});
},
onIconClick(title: string, id: string) {
switch (title) {
case BI.i18nText('Dec-Dcm_Delete'):
deleteConnection(id, () => {
this.model.linkList = [...this.model.linkList.filter((item: LinkType) => item.connectionId !== id)];
this.model.linkSelected = {};
this.model.linkUpdate = {};
});
break;
case BI.i18nText('Dec-Dcm_Test_Connection'):
this._textLink(id);
break;
case BI.i18nText('Dec-Dcm_Copy'):
this._noSaveConfirm(() => {
this.copyLink(id);
});
break;
default:
break;
}
},
copyLink(id: string) {
const connectionName = BI.find(this.model.linkList, (index: number, item: LinkType) => item.connectionId === id).connectionName;
const name = getCnnectionName(this.model.linkList, connectionName);
let data = {};
this.model.linkList.forEach((item: LinkType) => {
if (item.connectionId === id) {
data = item;
}
});
const newCopy = {
...data,
isSelected: true,
connectionName: name,
connectionId: '',
};
this.model.linkList = [
newCopy,
...this.model.linkList,
];
this.model.linkSelected = {
...newCopy,
};
this.model.linkUpdate = {
...newCopy,
};
},
setLinkUpdate(value: any) {
this.model.linkUpdate = value;
},
setNewLink(value: string) {
if (!DATA_BASE_TYPE.some(item => item.text === value) && !BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${value.toLowerCase()}.edit`)) {
dialog.error(BI.i18nText('Dec-Dcm_Connection_Option_Cannot_Find'));
return;
}
this._noSaveConfirm(() => {
this._setNewLink(value);
});
},
},
_setLinkSelected(name: string) {
this.model.linkList.forEach((item: LinkType) => {
item.isSelected = item.connectionName === name;
if (item.connectionName === name) {
this.model.linkSelected = {
...item,
isSelected: false,
};
}
});
this.model.linkList = [...this.model.linkList];
this.model.linkUpdate = this.model.linkSelected;
},
_textLink(id: string) {
const link = this.model.linkList.find((item: LinkType) => item.connectionId === id);
const loadingId = dialog.loading(BI.i18nText('Dec-Dcm_Connection_Testing'));
testConnection(link, (res: any) => {
dialog.remove(loadingId);
if (res && res.errorCode) {
dialog.linkFail(`${link.connectionName}${BI.i18nText('Dec-Dcm_Connection_Test_Fail')}`, res.errorMsg, () => {
this._textLink(id);
});
} else {
dialog.success(BI.i18nText('Dec-Dcm_Connection_Test_Success'));
}
});
},
_setNewLink(value: string) {
const name = getCnnectionName(this.model.linkList, value);
let data = {};
DATA_BASE_TYPE.forEach(item => {
if (item.text === value) {
data = item;
}
});
this.model.linkList = [
{
connectionName: name,
isSelected: true,
...data,
text: value,
},
...this.model.linkList,
];
this.model.linkSelected = {
...data,
connectionName: name,
isSelected: true,
text: value,
};
this.model.linkUpdate = {
...data,
connectionName: name,
text: value,
};
},
_noSaveConfirm(cb: Function) {
if (this.model.linkSelected && this.model.linkSelected.isSelected) {
dialog.confirm(BI.i18nText('Dec-Dcm_Connection_Config_No_Save'), (isConfirm: boolean) => {
if (isConfirm) {
this.saveLink();
} else {
this.setCancel();
}
cb();
});
} else {
cb();
}
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

26
src/app/connection/link_set.service.ts

@ -1,26 +0,0 @@
import {LinkType} from '@ui/type';
import {addConnection, updateConnection} from '@shared/crud/crud.request';
export function saveConnection(linkUpdate: LinkType): Promise<string> {
if (linkUpdate.connectionId) {
return new Promise(((resolve, reject) => {
try {
addConnection(linkUpdate, (res: string) => {
resolve(res);
});
} catch (error) {
reject(error);
}
}));
}
return new Promise(((resolve, reject) => {
try {
updateConnection(linkUpdate, (res: string) => {
resolve(res);
});
} catch (error) {
reject(error);
}
}));
}

58
src/app/connection/link_set.ts

@ -1,58 +0,0 @@
import {Htape, WidgetType, Vtape, VerticalAdapt} from '@ui';
import LeftList from './left/left';
import linkSetModel from './link_set.model';
import Select from './select/select';
import Right from './right/right';
import {TAB_LINK_SET} from '@private/constants';
const className = 'dec.dcm.linkset';
const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkSetModel);
},
watch: {
tab(tab: string) {
this.setVisible(tab === TAB_LINK_SET);
},
},
render() {
return {
type: Htape,
items: [{
el: {
type: Vtape,
cls: 'dcm-link-left bi-border-right',
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Select,
hgap: 10,
vgap: 10,
},
],
},
height: 40,
}, {
type: LeftList,
cls: 'left-list',
vgap: 10,
hgap: 10,
},
],
},
width: 280,
}, {
type: Right,
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

6
src/app/connection/more/item/more_link_item.less

@ -1,6 +0,0 @@
@import '../../../../less/index.less';
.dec-webui-dcm-connection-more-link-item{
&:hover{
border-color :@border-color-highlight;
}
}

68
src/app/connection/more/item/more_link_item.ts

@ -1,68 +0,0 @@
import './more_link_item.less';
import {WidgetType, Img, Label, Layout, Absolute, Vtape} from '@ui/index';
import ModelName from './more_link_litem.model';
const className = 'dec.dcm.component.linkSet.morelink.item';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-connection-more-link-item bi-border',
height: 120,
width: 120,
},
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
otherSelected(otherSelected: string) {
const {text} = this.options;
this.selected.setVisible(text === otherSelected);
},
},
render() {
const {text, name} = this.options;
return {
type: Vtape,
items: [
{
type: Absolute,
items: [
{
el: {
type: Img,
src: this._buildResourceUrl(name),
},
},
{
el: {
type: Layout,
cls: 'dcm-link-more-selected',
invisible: true,
width: 30,
height: 30,
ref: _ref => {
this.selected = _ref;
},
},
right: 0,
},
],
},
{
el: {
type: Label,
cls: 'bi-header-background',
text,
},
height: 30,
},
],
};
},
_buildResourceUrl(name: string) {
// TODO: 目前不知道生产环境下的图片的绝对地址,先这样写用于测试。
return `img/${name}.jpg`;
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

6
src/app/connection/more/item/more_link_litem.model.ts

@ -1,6 +0,0 @@
const className = 'dec.dcm.model.link_set.more_link_item';
export const Model = BI.inherit(Fix.Model, {
context: ['otherSelected'],
});
BI.model(className, Model);
export default className;

16
src/app/connection/more/more_link.model.ts

@ -1,16 +0,0 @@
const className = 'dec.dcm.model.link_set.more_link';
export const Model = BI.inherit(Fix.Model, {
childContext: ['otherSelected'],
state() {
return {
otherSelected: '',
};
},
actions: {
setOtherSelected(name: string) {
this.model.otherSelected = name;
},
},
});
BI.model(className, Model);
export default className;

50
src/app/connection/more/more_link.service.ts

@ -1,50 +0,0 @@
import MoreLink from './more_link';
let subbitButton = null;
let selectKey = '';
export const moreLink = (onConfirm?: Function): void => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: 'bi.bar_popover',
size: 'normal',
header: BI.i18nText('Dec-Dcm_Connection_More_Title'),
width: 560,
height: 500,
body: {
type: MoreLink,
listeners: [
{
eventName: 'EVENT_SELECT',
action (text: string) {
selectKey = text;
subbitButton.setEnable(true);
},
},
],
},
footer: {
type: 'bi.right_vertical_adapt',
lgap: 10,
items: [{
type: 'bi.button',
text: BI.i18nText('BI-Basic_Cancel'),
value: 1,
level: 'ignore',
handler () {
BI.Popovers.close(id);
},
}, {
type: 'bi.button',
text: BI.i18nText('BI-Basic_Sure'),
disabled: true,
value: 0,
ref: _ref => {
subbitButton = _ref;
},
handler () {
BI.Popovers.close(id);
onConfirm ? onConfirm(selectKey) : null;
},
}],
},
}).open(id);
};

52
src/app/connection/more/more_link.ts

@ -1,52 +0,0 @@
import {WidgetType, SearchEditor, Left, Vtape, VerticalAdapt} from '@ui/index';
import {DATA_BASE_TYPE_OTHER} from '@private/constants';
import MoreLinkItem from './item/more_link_item';
import ModelName from './more_link.model';
const className = 'dec.dcm.component.linkSet.morelink';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(ModelName);
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: VerticalAdapt,
items: [{
type: SearchEditor,
width: 300,
watermark: BI.i18nText('Dec-Dcm_Search'),
}],
},
height: 30,
},
{
type: Left,
scrolly: true,
tgap: 2,
rgap: 2,
bgap: 2,
lgap: 2,
items: this._createItems(),
},
],
};
},
_createItems() {
return BI.map(DATA_BASE_TYPE_OTHER, (index: number, item) => {
return {
type: MoreLinkItem,
text: item.text,
name: item.databaseType,
handler: () => {
this.store.setOtherSelected(item.text);
this.fireEvent('EVENT_SELECT', item.text);
},
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

30
src/app/connection/right/nothing.ts

@ -1,30 +0,0 @@
import {WidgetType, Layout, Label, HorizotalAdapt, Vtape} from '@ui/index';
const className = 'dec.dcm.component.right.nothing';
const Widget: WidgetType = {
render() {
return {
type: HorizotalAdapt,
top: 200,
items: [{
type: Vtape,
width: 260,
height: 150,
items: [
{
el: {
type: Layout,
cls: 'data-connection-background',
},
height: 130,
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Plase_Add_One'),
},
],
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

33
src/app/connection/right/right.ts

@ -1,33 +0,0 @@
import {WidgetType, ListView} from '@ui';
import {LinkType} from '@ui/type';
import Nothing from './nothing';
import RightDetail from './right_detail/right_detail';
import Model from '../link_set.model';
const className = 'dec.dcm.component.right';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkSelected(linkSelected: LinkType) {
this.rightContent.populate(BI.createItems([
{
type: (linkSelected && linkSelected.connectionName) ? RightDetail : Nothing,
},
]));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.rightContent = _ref;
},
items: [{
type: Nothing,
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

25
src/app/connection/right/right.typing.d.ts vendored

@ -1,25 +0,0 @@
export interface AttributeType {
text: string;
name: string;
}
export interface FormType {
connectionName?: string;
factory?: string;
url?: string;
principal?: string;
credentials?: string;
originalCharsetName?: string;
objectFactories?: string;
stateFactories?: string;
urlPkgPrefixes?: string;
dnsUrl?: string;
authoritative?: string;
batchSize?: string;
referral?: string;
securityProtocol?: string;
securityAuthentication?: string;
language?: string;
applet?: string;
}

6
src/app/connection/right/right_detail/right_detail.model.ts

@ -1,6 +0,0 @@
const className = 'dec.dcm.model.link.set.right.detail';
export const Model = BI.inherit(Fix.Model, {
context: ['linkSelected'],
});
BI.model(className, Model);
export default className;

74
src/app/connection/right/right_detail/right_detail.ts

@ -1,74 +0,0 @@
import {WidgetType, ListView} from '@ui/index';
import Model from './right_detail.model';
import {LinkType} from '@ui/type';
import Title from '../right_title/right_title';
import RightShow from '../right_show/right_show';
import RightShowJndi from '../right_show/right_show_jndi';
import RightEdit from '../right_edit/right_edit';
import RightEditMysql from '../right_edit/right_edit_mysql';
import RightEditJndi from '../right_edit/right_edit_jndi';
import pluginListConstant from '../../../app.constant';
import {MYSQL_CONNECT, JNDI_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.detail';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkSelected(linkSelected: LinkType) {
const showPage = this._createItems(linkSelected);
this.rightDetail.populate(BI.createItems(showPage));
},
},
render() {
const linkSelected = this.model.linkSelected;
return {
type: ListView,
ref: _ref => {
this.rightDetail = _ref;
},
items: this._createItems(linkSelected),
};
},
_createItems(linkSelected: LinkType) {
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
const isPlugin = BI.some(plugins, (index: number, item: string) => item === linkSelected.text);
let editPage = null;
let showPage = null;
switch (linkSelected.text) {
case (MYSQL_CONNECT):
editPage = RightEditMysql;
showPage = RightShow;
break;
case (JNDI_CONNECT):
editPage = RightEditJndi;
showPage = RightShowJndi;
break;
default:
editPage = RightEdit;
showPage = RightShow;
}
if (isPlugin) {
editPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.edit`);
showPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.preview`);
}
return [
{
type: Title,
isEdit: linkSelected.isSelected,
linkSelected,
}, {
type: linkSelected.isSelected ? editPage : showPage,
vgap: 10,
hgap: 10,
linkSelected,
},
];
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

20
src/app/connection/right/right_edit/right_edit.model.ts

@ -1,20 +0,0 @@
export const className = 'dec.dcm.model.components.right.edit';
export const Model = BI.inherit(Fix.Model, {
state() {
return {
isCollapse: false,
};
},
computed: {
},
actions: {
setIsCollapse(status: boolean) {
this.model.isCollapse = status;
},
},
});
BI.model(className, Model);
export default className;

24
src/app/connection/right/right_edit/right_edit.service.ts

@ -1,24 +0,0 @@
import {LinkType} from '@ui/type';
export function getDrivers(linkSelected: LinkType): {text: string; value: string}[] {
const drivers: {text: string; value: string}[] = [];
if (linkSelected.drivers && linkSelected.drivers.length > 0) {
linkSelected.drivers.forEach(item => {
drivers.push({
text: item,
value: item,
});
});
} else {
drivers.push({
text: linkSelected.driver,
value: linkSelected.driver,
});
}
return drivers;
}
export function connectNameChecker(name: string): boolean {
return /^\+?[1-9][0-9]*$/.test(name);
}

373
src/app/connection/right/right_edit/right_edit.ts

@ -1,373 +0,0 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
connectionNameErr(msg: string) {
if (msg) {
BI.Bubbles.show('singleBubble', msg, connectionName, {
level: 'error',
});
} else {
BI.Bubbles.hide('singleBubble');
}
},
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
connectionName: this.getValue(),
});
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action() {
that.store.setConnectionNameErr('');
},
}],
},
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_First_Step'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.driver,
items: getDrivers(linkSelected),
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
driver: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.url,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
url: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
items: [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: '',
},
...CONNECT_CHARSET,
],
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
originalCharsetName: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.user,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
user: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.password,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
password: this.getValue(),
});
},
}],
},
],
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
height: 100,
value: linkSelected.validationQuery,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
validationQuery: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow,
width: 60,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
testOnBorrow: this.isSelected(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60,
value: linkSelected.maxActive,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker: connectNameChecker,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
maxActive: this.getValue(),
});
},
}],
},
],
},
],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Second_Step'),
},
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Third_Step'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
},
{
type: TextEditor,
width: 300,
disabled: true,
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

226
src/app/connection/right/right_edit/right_edit_jndi.ts

@ -1,226 +0,0 @@
import {Vertical, TextValueCombo, TextButton, Label, TextEditor, VerticalAdapt} from '@ui';
import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_edit.model';
const classNameEdit = 'dec.dcm.component.right.edit.jndi';
const Widget = BI.inherit(BI.Widget, {
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
isCollapse(isCollapse) {
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
},
render() {
const {connectionName, url, factory, principal, credentials, originalCharsetName} = this.options;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: connectionName,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: TextValueCombo,
width: 300,
value: factory,
items: BI.map(JNDI_FACTORYS, (index: number, item: string) => {
return {
text: item,
value: item,
};
}),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: url,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: principal,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: credentials,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 480,
textAlign: 'right',
ref: _ref => {
this.collapseRef = _ref;
},
handler: () => {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
invisible: true,
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: this._getOtherItems(),
},
],
},
],
},
{
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
items: [{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: originalCharsetName,
},
...CONNECT_CHARSET,
],
},
],
},
],
};
},
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: this.options[item.name],
},
],
};
});
},
});
BI.shortcut(classNameEdit, Widget);
export default classNameEdit;

325
src/app/connection/right/right_edit/right_edit_mysql.ts

@ -1,325 +0,0 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit.mysql';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
connectionNameErr(msg: string) {
if (msg) {
BI.Bubbles.show('singleBubble', msg, connectionName, {
level: 'error',
});
} else {
BI.Bubbles.hide('singleBubble');
}
},
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
connectionName: this.getValue(),
});
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action() {
that.store.setConnectionNameErr('');
},
}],
},
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.driver,
items: getDrivers(linkSelected),
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
driver: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.url,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
url: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
items: [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: '',
},
...CONNECT_CHARSET,
],
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
originalCharsetName: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.user,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
user: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.password,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
password: this.getValue(),
});
},
}],
},
],
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
height: 100,
value: linkSelected.validationQuery,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
validationQuery: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow,
width: 60,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
testOnBorrow: this.isSelected(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60,
value: linkSelected.maxActive,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker: connectNameChecker,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
maxActive: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

20
src/app/connection/right/right_show/right_show.model.ts

@ -1,20 +0,0 @@
export const className = 'dec.dcm.model.components.right.show';
export const Model = BI.inherit(Fix.Model, {
state() {
return {
isCollapse: false,
};
},
computed: {
},
actions: {
setIsCollapse(status: boolean) {
this.model.isCollapse = status;
},
},
});
BI.model(className, Model);
export default className;

72
src/app/connection/right/right_show/right_show.ts

@ -1,72 +0,0 @@
import {WidgetType, Vertical} from '@ui/index';
import RightShowModel from '../../link_set.model';
import BothSide from '@shared/components/both_side';
import Title from '@shared/components/title';
import {LinkType} from '@ui/type';
const className = 'dec.dcm.component.right.show';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(RightShowModel);
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
return {
type: Vertical,
vgap: 10,
items: [
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
rightText: linkSelected.connectionName,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
rightText: linkSelected.driver,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
rightText: linkSelected.url,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
rightText: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
rightText: linkSelected.user,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
rightText: linkSelected.password,
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
rightText: linkSelected.validationQuery,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
rightText: linkSelected.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
rightText: linkSelected.maxActive,
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

203
src/app/connection/right/right_show/right_show_jndi.ts

@ -1,203 +0,0 @@
import {Vertical, TextButton, Label, VerticalAdapt} from '@ui';
import {OTHER_ATTRIBUTES} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_show.model';
const className = 'dec.dcm.component.right.show.jndi';
const Widget = BI.inherit(BI.Widget, {
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
isCollapse(isCollapse) {
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
},
render() {
const {connectionName, url, factory, principal, credentials, originalCharsetName} = this.options;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
},
{
type: Label,
text: connectionName,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: Label,
text: factory,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: Label,
text: url,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: Label,
value: principal,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: Label,
value: credentials,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 480,
textAlign: 'right',
ref: _ref => {
this.collapseRef = _ref;
},
handler: () => {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
invisible: true,
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: this._getOtherItems(),
},
],
},
],
},
{
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: Label,
text: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
},
],
},
],
};
},
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: Label,
value: this.options[item.name],
},
],
};
});
},
});
BI.shortcut(className, Widget);
export default className;

20
src/app/connection/right/right_title/right_title.model.ts

@ -1,20 +0,0 @@
import LinksetMixin from '../../link_set.mixin';
import {LinkType} from '@ui/type';
const modelName = 'dec.dcm.model.component.right.title';
export const Model = BI.inherit(Fix.Model, {
context: ['linkSelected', 'linkList', 'linkUpdate'],
mixins: [LinksetMixin],
actions: {
onSave() {
const linkList: LinkType[] = this.model.linkList;
const result = BI.find(linkList, (idx: number, value: LinkType) => this.model.linkUpdate.connectionName === value.connectionName && value.connectionId !== this.model.linkUpdate.connectionId);
if (result) {
this.setConnectionNameErr(BI.i18nText('Dec-Dcm_Connection_Is_Existence'));
} else {
this.saveLink();
}
},
},
});
BI.model(modelName, Model);
export default modelName;

66
src/app/connection/right/right_title/right_title.ts

@ -1,66 +0,0 @@
import {WidgetType, Label, Button, LeftRightVerticalAdapt} from '@ui/index';
import RightTitleModel from './right_title.model';
import {LinkType} from '@ui/type';
import {OTHER_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.title';
const Widget: WidgetType = {
props: {
baseCls: 'bi-border-bottom',
},
_store() {
return BI.Models.getModel(RightTitleModel);
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
const {isEdit} = this.options;
const title = linkSelected.text === OTHER_CONNECT ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text;
return {
type: LeftRightVerticalAdapt,
height: 40,
items: {
left: [
{
type: Label,
cls: 'bi-font-bold',
hgap: 10,
text: `${BI.i18nText('Dec-Dcm_Data_Connections')}(${title ? title : BI.i18nText('Dec-Dcm_Default')})`,
},
],
right: [
{
type: Button,
hgap: 10,
invisible: isEdit,
text: BI.i18nText('Dec-Dcm_Edit'),
handler() {
that.store.setEdit(true);
},
},
{
type: Button,
hgap: 10,
invisible: !isEdit,
level: 'ignore',
text: BI.i18nText('BI-Basic_Cancel'),
handler() {
that.store.setCancel();
},
},
{
type: Button,
hgap: 10,
invisible: !isEdit,
text: BI.i18nText('Dec-Dcm_Save'),
handler() {
that.store.onSave();
},
},
],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

23
src/app/connection/select/select.service.ts

@ -1,23 +0,0 @@
import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant';
export const getCnnectionName = (links: LinkType[], name: string): string => {
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
let nameIndex = 0;
const title = name.replace(/[0-9]/g, '');
const isPlugin = BI.some(plugins, (index: number, item: string) => item === title);
const startWith = isPlugin ? title : BI.i18nText('Dec-Dcm_Data_Connections');
links.forEach(link => {
link.isSelected = false;
if (link.connectionName.startsWith(startWith)) {
const name = link.connectionName.replace(startWith, '0');
const index = parseInt(name, 10) + 1;
if (index > nameIndex) {
nameIndex = index;
}
}
});
return `${startWith}${nameIndex > 0 ? nameIndex : ''}`;
};

77
src/app/connection/select/select.ts

@ -1,77 +0,0 @@
import {WidgetType, Combo, ButtonGroup, TextItem, Vertical} from '@ui';
import selectModel from '../link_set.model';
import {moreLink} from '../more/more_link.service';
import connectList from '../../app.constant';
import {DATA_LINKS} from '@private/constants';
const className = 'dec.dcm.linkset.select';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(selectModel);
},
render() {
return {
type: Combo,
trigger: 'click',
adjustYOffset: 4,
el: {
type: 'bi.button',
text: BI.i18nText('Dec-Dcm_Connection_New'),
},
popup: {
el: {
type: ButtonGroup,
items: [...BI.map([...DATA_LINKS, ...BI.Constants.getConstant(connectList)], (index: number, item: string) => {
return {
type: TextItem,
height: 24,
width: 152,
textLgap: 10,
text: item,
title: item,
value: item,
};
}), {
type: TextItem,
height: 24,
width: 152,
textLgap: 10,
text: BI.i18nText('Dec-Dcm_Connection_More'),
title: BI.i18nText('Dec-Dcm_Connection_More'),
value: 'more',
}, {
type: TextItem,
cls: 'bi-border-top',
height: 24,
width: 152,
textLgap: 10,
text: BI.i18nText('Dec-Dcm_Connection_Other'),
title: BI.i18nText('Dec-Dcm_Connection_Other'),
value: 'other',
}],
layouts: [{
type: Vertical,
}],
},
maxHeight: 400,
},
listeners: [{
eventName: 'EVENT_CHANGE',
action: (v: string) => {
if (v === 'more') {
moreLink((text: string) => {
this.store.setNewLink(text);
});
} else {
this.store.setNewLink(v);
}
this.combo.hideView();
},
}],
ref: _ref => {
this.combo = _ref;
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

17
src/app/status/left/left.model.ts

@ -1,17 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus.left';
const Model: ModelType = {
context: ['tab', 'linkList', 'statusSelected'],
state () {
return {
selected: '',
};
},
actions: {
setStatusSelected(title: string) {
this.model.statusSelected = title;
},
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

44
src/app/status/left/left.ts

@ -1,44 +0,0 @@
import {WidgetType, ListView} from '@ui';
import Model from './left.model';
import {LinkType} from '@ui/type';
import LeftItem from './left_item';
const className = 'dec.dcm.component.linkStatus.left';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkList(linkList: LinkType[]) {
const title = linkList.length > 0 ? linkList[0].connectionName : '';
this.store.setStatusSelected(title);
},
statusSelected(title: string) {
const linkList = this.model.linkList;
this.leftContent.populate(BI.createItems(this._renderItems(linkList, title)));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.leftContent = _ref;
},
items: this._renderItems(this.model.linkList, this.model.statusSelected),
};
},
_renderItems(linkList: LinkType[], selectTitle = '') {
return BI.map(linkList, (index: number, item: LinkType) => {
return {
type: LeftItem,
selected: item.connectionName === selectTitle,
title: item.connectionName,
id: item.connectionId,
creator: item.creator,
text: item.text ? item.text : BI.i18nText('Dec-Dcm_Default'),
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

39
src/app/status/left/left_item.ts

@ -1,39 +0,0 @@
import {WidgetType, TextButton, VerticalAdapt} from '@ui';
import Model from './left.model';
const className = 'dec.dcm.component.linkStatus.left.item';
const Widget: WidgetType = {
props: {
title: '',
id: '',
creator: '',
baseCls: 'bi-list-item-active',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title} = this.options;
return {
type: VerticalAdapt,
cls: 'bi-list-item-active',
height: 30,
items: [
{
type: TextButton,
cls: 'link-title',
lgap: 10,
textAlign: 'left',
text: title,
title,
},
],
};
},
doClick() {
const {title} = this.options;
this.store.setStatusSelected(title);
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

9
src/app/status/link_status.model.ts

@ -1,9 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus';
const Model: ModelType = {
context: ['tab', 'linkList'],
actions: {
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

63
src/app/status/link_status.ts

@ -1,63 +0,0 @@
import {WidgetType, Htape, Vtape, Label, VerticalAdapt} from '@ui';
import linkStatusModel from './link_status.model';
import LeftList from './left/left';
import Right from './right/right';
import {TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.linkstatus';
const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkStatusModel);
},
watch: {
tab(tab: string) {
this.linkStatus.setVisible(tab === TAB_LINK_POOL);
},
},
render() {
return {
type: Htape,
invisible: true,
ref: _ref => {
this.linkStatus = _ref;
},
items: [{
el: {
type: Vtape,
cls: 'dcm-link-left',
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Label,
cls: 'bi-font-bold',
hgap: 6,
vgap: 6,
text: BI.i18nText('Dec-Dcm_Data_Connections'),
},
],
},
height: 40,
}, {
type: LeftList,
cls: 'left-list',
},
],
},
width: 280,
}, {
type: Right,
cls: 'bi-border-left',
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

14
src/app/status/right/right.model.ts

@ -1,14 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus.right';
const Model: ModelType = {
context: ['linkList', 'statusSelected'],
state () {
return {
selected: '',
};
},
actions: {
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

68
src/app/status/right/right.ts

@ -1,68 +0,0 @@
import {WidgetType, Label, ListView, VerticalAdapt, Vtape} from '@ui/index';
import Model from './right.model';
import {info} from '@shared/crud/crud.request';
import RightCard from './right_card';
import {InfoType} from './right.typings';
import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant';
const className = 'dcm-link-form';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() {
return BI.Models.getModel(Model);
},
watch: {
statusSelected(title: string) {
const link = BI.find(this.model.linkList, (index: number, item: LinkType) => item.connectionName === title);
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
const isPlugin = link.text && BI.some(plugins, (index: number, item: string) => item === link.text);
const Pool = isPlugin ? BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${link.text.toLowerCase()}.pool`) : RightCard;
info(name, (res: InfoType) => {
this.statusGroup.populate(BI.createItems([{
type: Pool,
...res,
}]));
});
this.statusTitle.setText(`${BI.i18nText('Dec-Dcm_Data_Connections')}(${title})`);
},
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Label,
cls: 'bi-font-bold',
lgap: 10,
text: BI.i18nText('Dec-Dcm_Data_Connections'),
},
],
ref: _ref => {
this.statusTitle = _ref;
},
},
height: 40,
}, {
type: ListView,
cls: 'right-status-body',
vgap: 10,
hgap: 10,
ref: _ref => {
this.statusGroup = _ref;
},
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

6
src/app/status/right/right.typings.d.ts vendored

@ -1,6 +0,0 @@
export interface InfoType{
maxActive: number;
maxIdle: number;
numActive: number;
numIdle: number;
}

91
src/app/status/right/right_card.ts

@ -1,91 +0,0 @@
import './right_card.less';
import {WidgetType, Left, Label, Vertical, FloatCenter, CenterAdapt, VerticalAdapt} from '@ui/index';
const className = 'dec.dcm.component.linkStatus.right.card';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-status-right-card',
},
render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options;
return {
type: FloatCenter,
height: 150,
hgap: 20,
items: [
{
type: Vertical,
cls: 'bi-background',
items: [
{
type: CenterAdapt,
cls: 'right-status-board-item',
tgap: 40,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-high-light card-font-success',
text: numActive,
},
{
type: Label,
text: '/',
},
{
type: Label,
text: maxActive,
},
],
},
],
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'),
},
],
},
{
type: Vertical,
cls: 'bi-background',
items: [
{
type: CenterAdapt,
tgap: 40,
cls: 'right-status-board-item',
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-high-light card-font-heighlight',
text: numIdle,
},
{
type: Label,
text: '/',
},
{
type: Label,
text: maxIdle,
},
],
},
],
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Leisure_Connections_Number'),
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

8
src/app/title/title.less

@ -1,8 +0,0 @@
@import '../../less/index.less';
.dec-webui-dcm-title{
.title-item-selected{
color: @background-color-highlight;
border-bottom-color:@border-color-highlight;
border-bottom-width: 2px;
}
}

11
src/app/title/title.model.ts

@ -1,11 +0,0 @@
const className = 'dec.dcm.model.title.item';
const Model = BI.inherit(Fix.Model, {
context: ['tab'],
actions: {
setTab(value: string) {
this.model.tab = value;
},
},
});
BI.model(className, Model);
export default className;

61
src/app/title/title.ts

@ -1,61 +0,0 @@
import './title.less';
import {WidgetType, IconButton, LeftRightVerticalAdapt, LinearSegment} from '@ui/index';
import Model from './title.model';
import {isDesigner, closeWindow} from '@shared/crud/crud.request';
import {TAB_LINK_SET, TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.title';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const showCloseButton = isDesigner();
const that = this;
return {
type: LeftRightVerticalAdapt,
items: {
left: [
{
type: LinearSegment,
cls: 'bi-card',
height: 40,
width: 200,
items: [{
text: BI.i18nText('Dec-Dcm_Connection_Management'),
value: TAB_LINK_SET,
selected: true,
}, {
text: BI.i18nText('Dec-Dcm_Pool_Connection_Management'),
value: TAB_LINK_POOL,
}],
listeners: [{
eventName: 'EVENT_CHANGE',
action () {
that.store.setTab(this.getValue()[0]);
},
}],
},
],
right: [
showCloseButton ? {
type: IconButton,
cls: 'close-ha-font',
width: 30,
height: 30,
rgap: 10,
handler() {
closeWindow();
},
} : null,
],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

91
src/demo/plugin.redis.edit.ts

@ -1,91 +0,0 @@
import './style.scss';
import {TextEditor, Vertical, Left, Label} from '@ui/index';
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = {
url: '192.168.1.22',
port: 6379,
password: '123456',
};
const classNameEdit = 'dec.dcm.plugin.redis.edit';
const Widget = BI.inherit(BI.Widget, {
render() {
return {
type: Vertical,
cls: 'bi-plugin-redis',
bgap: 10,
items: [
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
value: form.url,
allowBlank: true,
width: 300,
height: 24,
}],
},
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
allowBlank: true,
width: 300,
height: 24,
value: form.port,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker (v: string) {
return /^\+?[1-9][0-9]*$/.test(v);
},
}],
},
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
inputType: 'password',
value: form.password,
allowBlank: true,
width: 300,
height: 24,
}],
},
],
};
},
});
BI.shortcut(classNameEdit, Widget);
export default classNameEdit;
export const ConstantName = 'dec.constant.database.conf.connect.list';
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']);
BI.constant(RedisConstantName, form);
BI.constant('dec.constant.database.conf.connect.form.redis.edit', classNameEdit);

68
src/demo/plugin.redis.preview.ts

@ -1,68 +0,0 @@
const classNamePreview = 'dec.dcm.plugin.redis.preview';
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = BI.Constants.getConstant(RedisConstantName);
const Widget = BI.inherit(BI.Widget, {
render() {
return {
type: 'bi.vertical',
cls: 'bi-plugin-redis',
bgap: 10,
items: [
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: form.url,
height: 24,
}],
},
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: form.port,
height: 24,
}],
},
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: '********',
height: 24,
}],
},
],
};
},
});
BI.shortcut(classNamePreview, Widget);
BI.constant('dec.constant.database.conf.connect.form.redis.preview', classNamePreview);

53
src/demo/plugin.tedis.pool.ts

@ -1,53 +0,0 @@
const classNamePool = 'dec.dcm.plugin.redis.pool';
const WidgetPool = BI.inherit(BI.Widget, {
render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options;
return {
type: 'bi.left',
items: [
{
type: 'bi.left',
cls: 'right-status-item',
items: [
{
type: 'bi.vertical',
cls: 'right-status-board',
items: [
{
type: 'bi.vertical',
cls: 'right-status-board-item',
items: [
{
type: 'bi.label',
cls: 'right-status-text',
text: numActive,
},
{
type: 'bi.label',
cls: 'right-status-text',
text: '/',
},
{
type: 'bi.label',
cls: 'right-status-text',
text: maxActive,
},
],
},
{
type: 'bi.label',
height: 20,
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'),
},
],
},
],
},
],
};
},
});
BI.shortcut(classNamePool, WidgetPool);
BI.constant('dec.constant.database.conf.connect.form.redis.pool', classNamePool);

3
src/demo/style.scss

@ -1,3 +0,0 @@
.bi-plugin-redis{
padding: 20px;
}

3
src/i18n.ts

@ -0,0 +1,3 @@
import i18n from '../private/i18n';
BI.addI18n(i18n);

BIN
src/img/ads.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
src/img/amazon-redshift.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
src/img/apache-impala.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/apache-kylin.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

BIN
src/img/apache-phoenix.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/database-selected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/img/derby.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/error.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

BIN
src/img/gbase-8a.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

BIN
src/img/gbase-8s.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

BIN
src/img/gbase-8t.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
src/img/h2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/hadoop-hive.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
src/img/hbase.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
src/img/hp-vertica.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hsql.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hw-dws.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/hw-elk.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
src/img/hw-fusioninsight-hd.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hw-libr-a.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/ibm-db2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/icon_close9x9_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

BIN
src/img/informix.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/kingbase.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
src/img/loading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
src/img/mysql.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
src/img/oracle.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
src/img/pivotal-greenplum-database.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/postgresql.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
src/img/presto.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save