* commit '9df46cb46ccddff9ddbaee4aca27fa9fd7fd1d9c': fix: 这个用不到 refactor: 重构页面qufenxi
@ -1,5 +1,5 @@
|
||||
dist/*.js |
||||
src/assets/* |
||||
src/lib/* |
||||
webpack.config.js |
||||
curd.mock.ts |
||||
types |
||||
node_modules/ |
||||
dist/ |
||||
assets/ |
||||
webpack/ |
@ -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 |
@ -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/ |
@ -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, |
||||
}; |
||||
}; |
@ -0,0 +1,6 @@
|
||||
!(function () { |
||||
// 先把准备环境准备好
|
||||
while (BI.prepares && BI.prepares.length > 0) { |
||||
BI.prepares.shift()(); |
||||
} |
||||
}()); |
@ -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; |
||||
}, |
||||
}; |
||||
}()); |
@ -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; |
@ -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> |
@ -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'], |
||||
}, |
||||
}, |
||||
}, |
||||
}; |
@ -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}}; |
||||
`);
|
@ -0,0 +1,7 @@
|
||||
const { execSync } = require('child_process'); |
||||
|
||||
const repositories = ['fineui', 'fineui-materials']; |
||||
|
||||
repositories.forEach(repository => { |
||||
execSync(`yarn upgrade ${repository}`); |
||||
}); |
@ -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" |
||||
} |
||||
} |
||||
} |
||||
|
@ -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; |
@ -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); |
||||
}); |
@ -1,4 +0,0 @@
|
||||
export const ConstantName = 'dec.constant.database.conf.connect.list'; |
||||
BI.constant(ConstantName, [ |
||||
]); |
||||
export default ConstantName; |
@ -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; |
@ -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; |
@ -1,4 +0,0 @@
|
||||
@import '../../../../less/index.less'; |
||||
.dec-webui-dcm-connection-left-item{ |
||||
.hover-visible(link-item-icon); |
||||
} |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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); |
||||
} |
||||
})); |
||||
} |
@ -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; |
@ -1,6 +0,0 @@
|
||||
@import '../../../../less/index.less'; |
||||
.dec-webui-dcm-connection-more-link-item{ |
||||
&:hover{ |
||||
border-color :@border-color-highlight; |
||||
} |
||||
} |
@ -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; |
@ -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; |
@ -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; |
@ -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); |
||||
}; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
||||
} |
@ -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; |
@ -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; |
@ -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; |
@ -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); |
||||
} |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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 : ''}`; |
||||
}; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -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; |
@ -1,6 +0,0 @@
|
||||
export interface InfoType{ |
||||
maxActive: number; |
||||
maxIdle: number; |
||||
numActive: number; |
||||
numIdle: number; |
||||
} |
@ -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; |
@ -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; |
||||
} |
||||
} |
@ -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; |
@ -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; |
@ -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); |
@ -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); |
@ -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); |
@ -0,0 +1,3 @@
|
||||
import i18n from '../private/i18n'; |
||||
|
||||
BI.addI18n(i18n); |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB |