Browse Source
* commit 'c55fe27149a2567204f84346d55c317b0ccc8d26': (44 commits) refactor: 使用bi.linear_segment替换掉自己实现的tab refactor: 修正不规范的写法 refactor: 修正不规范的写法 refactor: 修正不规范的写法 refactor: 优化代码结构 refactor: 逻辑代码放到model中 refactor: 修正不规范的写法 refactor: 优化布局的使用 refactor: 使用TextEditor替代Editor refactor: 修正不规范的写法 refactor: 清理不必要的 cursor-pointer, 使用 hover-visible refactor: 将样式放到组件同级 refactor: 把内部方法移出actions refactor: 应该是阻止冒泡 refactor: 优化BI.BasicButton的用法 refactor: 尽量使用通用样式 refactor: 去掉text_value_combo的boder样式,因为已经自带了 refactor: update refactor: 使用BI.Popovers.close(id)方式关闭Popovers refactor: 去掉 extraCls ...master
richie
6 years ago
99 changed files with 3018 additions and 2305 deletions
@ -0,0 +1,60 @@
|
||||
Dec-Dcm_Connection_Management= 数据连接管理 |
||||
Dec-Dcm_Pool_Connection_Management= 连接池管理 |
||||
Dec-Dcm_Data_Connections= 数据连接 |
||||
Dec-Dcm_Active_Connections_Number= 活动连接数 |
||||
Dec-Dcm_Leisure_Connections_Number= 空闲连接数 |
||||
Dec-Dcm_Connections= 连接 |
||||
Dec-Dcm_Default= 默认 |
||||
Dec-Dcm_Delete= 删除 |
||||
Dec-Dcm_Test_Connection= 测试连接 |
||||
Dec-Dcm_Copy= 复制 |
||||
Dec-Dcm_Edit= 编辑 |
||||
Dec-Dcm_Save= 保存 |
||||
Dec-Dcm_Yes= 是 |
||||
Dec-Dcm_No= 否 |
||||
Dec-Dcm_Search= 搜索 |
||||
Dec-Dcm_Type= 类型 |
||||
Dec-Dcm_Other= 其他 |
||||
Dec-Dcm_Tips= 提示 |
||||
Dec-Dcm_Back= 返回 |
||||
Dec-Dcm_Creator= 创建者 |
||||
Dec-Dcm_First_Step= 第一步 |
||||
Dec-Dcm_Second_Step= 第二步 |
||||
Dec-Dcm_Third_Step= 第三步 |
||||
Dec-Dcm_Connection_Detailed_Information= 详细信息 |
||||
Dec-Dcm_Connection_Handup_Information= 收起信息 |
||||
Dec-Dcm_Connection_Testing= 正在测试连接,请稍候... |
||||
Dec-Dcm_Connection_Test_Fail= 测试连接失败 |
||||
Dec-Dcm_Connection_Test_Success= 连接成功 |
||||
Dec-Dcm_Connection_Option_Cannot_Find= 找不到该连接的配置信息 |
||||
Dec-Dcm_Connection_Config_No_Save= 当前设置尚未保存,是否保存? |
||||
Dec-Dcm_Connection_New= 新建数据连接 |
||||
Dec-Dcm_Connection_More= 更多数据连接... |
||||
Dec-Dcm_Connection_More_Title= 更多数据连接 |
||||
Dec-Dcm_Connection_Other= 其他 |
||||
Dec-Dcm_Connection_Plase_Add_One= 请选择左侧数据连接或点击新建数据连接 |
||||
Dec-Dcm_Connection_Is_Existence= 数据连接名已存在 |
||||
Dec-Dcm_Connection_Form_ConnectionName= 数据连接名 |
||||
Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm= *修改数据连接名会影响相关数据表和仪表板 |
||||
Dec-Dcm_Connection_Form_Driver= 驱动器 |
||||
Dec-Dcm_Connection_Form_URL= URL |
||||
Dec-Dcm_Connection_Form_Place_Input= 请输入 |
||||
Dec-Dcm_Connection_Form_OriginalCharsetName= 编码 |
||||
Dec-Dcm_Connection_Form_Auto= 自动 |
||||
Dec-Dcm_Connection_Form_UserName= 用户名 |
||||
Dec-Dcm_Connection_Form_Password= 密码 |
||||
Dec-Dcm_Connection_Form_Pool_Properties= 连接池属性 |
||||
Dec-Dcm_Connection_Form_SQL_Validation_Query= SQL验证查询 |
||||
Dec-Dcm_Connection_Form_Connection-Check= 获取连接前校验 |
||||
Dec-Dcm_Connection_Form_Connection_Max_Number= 最大活动连接数 |
||||
Dec-Dcm_Connection_Form_Place_Input-Number= 请输入有效的正整数 |
||||
Dec-Dcm_Connection_Form_Pattern= 模式 |
||||
Dec-Dcm_Connection_Form_Database_Addr= 数据库地址 |
||||
Dec-Dcm_Connection_Form_Database_Port= 端口号 |
||||
Dec-Dcm_Connection_Make_Sure_Delete= 确定删除该数据连接? |
||||
Dec-Dcm_Connection_ReConnect= 重新连接 |
||||
Dec-Dcm_Connection_JNDI_Form_ConnectionName= JNDI的名字 |
||||
Dec-Dcm_Connection_Form_JNDI_Context= 上下文 |
||||
Dec-Dcm_Connection_Form_JNDI_Advanced= 高级 |
||||
Dec-Dcm_Connection_Form_JNDI_Other_Attributes= 其他属性 |
||||
Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes= 收起 |
@ -1,283 +1,373 @@
|
||||
import {LinkType} from '@ui/type'; |
||||
import pluginListConstant from '../../app.constant'; |
||||
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 databaseTyle = [ |
||||
{ |
||||
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', |
||||
}, |
||||
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:'MySQL', |
||||
databaseType: 'mysql', |
||||
text: 'ADS', |
||||
databaseType: 'ads', |
||||
driver: 'com.mysql.jdbc.Driver', |
||||
drivers:['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'], |
||||
url: 'jdbc:mysql://localhost/dbname', |
||||
url: 'jdbc:mysql://hostname:port/my_ads_db', |
||||
}, |
||||
{ |
||||
text:'其他', |
||||
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', |
||||
}, |
||||
{ |
||||
text:'ADS', |
||||
databaseType:'ads', |
||||
driver:'com.mysql.jdbc.Driver', |
||||
url:'jdbc:mysql://hostname:port/my_ads_db', |
||||
}, |
||||
{ |
||||
text:'Amazon Redshift', |
||||
databaseType:'amazon-redshift', |
||||
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', |
||||
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 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 KYLIN', |
||||
databaseType: 'apache-kylin', |
||||
driver: 'org.apache.kylin.jdbc.Driver', |
||||
url: 'jdbc:kylin://<hostname>:<port>/<kylin_project_name>', |
||||
}, |
||||
{ |
||||
text:'APACHE Phoenix', |
||||
text: 'APACHE Phoenix', |
||||
databaseType: 'apache-phoenix', |
||||
driver: 'org.apache.phoenix.jdbc.PhoenixDriver', |
||||
url: 'jdbc:phoenix:hostname:port/dbname', |
||||
}, |
||||
{ |
||||
text:'DERBY', |
||||
text: 'DERBY', |
||||
databaseType: 'derby', |
||||
driver: 'org.apache.derby.jdbc.ClientDriver', |
||||
url: 'jdbc:derby://localhost:1527/', |
||||
}, |
||||
{ |
||||
text:'Gbase 8A', |
||||
text: 'Gbase 8A', |
||||
databaseType: 'gbase-8a', |
||||
driver: 'com.gbase.jdbc.Driver', |
||||
url: 'jdbc:gbase://hostname:port/dbname', |
||||
}, |
||||
{ |
||||
text:'Gbase 8S', |
||||
text: 'Gbase 8S', |
||||
databaseType: 'gbase-8s', |
||||
driver: 'com.gbasedbt.jdbc.IfxDriver', |
||||
url: 'jdbc:gbasedbt-sqli://{host}:{port}/{database}', |
||||
}, |
||||
{ |
||||
text:'Gbase 8T', |
||||
text: 'Gbase 8T', |
||||
databaseType: 'gbase-8t', |
||||
driver: 'com.informix.jdbc.IfxDriver', |
||||
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}', |
||||
}, |
||||
{ |
||||
text:'H2', |
||||
text: 'H2', |
||||
databaseType: 'h2', |
||||
driver: 'org.h2.Driver', |
||||
url: 'jdbc:h2://${ENV_HOME}/../databaseName', |
||||
}, |
||||
{ |
||||
text:'华为云DWS', |
||||
text: '华为云DWS', |
||||
databaseType: 'hw-dws', |
||||
driver: 'org.postgresql.Driver', |
||||
url: 'jdbc:postgresql://hostname:port/dbname', |
||||
}, |
||||
{ |
||||
text:'FusionInsight elk', |
||||
text: 'FusionInsight elk', |
||||
databaseType: 'hw-elk', |
||||
driver: 'org.postgresql.Driver', |
||||
url: 'jdbc:postgresql://hostname:port/dbname', |
||||
}, |
||||
{ |
||||
text:'FusionInsight HD', |
||||
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', |
||||
text: 'GaussDB 200', |
||||
databaseType: 'hw-libr-a', |
||||
driver: 'org.postgresql.Driver', |
||||
url: 'jdbc:postgresql://hostname:port/dbname', |
||||
}, { |
||||
text:'Hadoop Hive', |
||||
text: 'Hadoop Hive', |
||||
databaseType: 'hadoop-hive', |
||||
driver: 'org.apache.hive.jdbc.HiveDriver', |
||||
url: 'jdbc:hive2://hostname:port/databasename', |
||||
}, { |
||||
text:'Hbase', |
||||
text: 'Hbase', |
||||
databaseType: 'hbase', |
||||
driver: 'org.apache.phoenix.jdbc.PhoenixDriver', |
||||
url: 'jdbc:phoenix:hostname:port/dbname', |
||||
}, { |
||||
text:'HP Vertica', |
||||
text: 'HP Vertica', |
||||
databaseType: 'hp-vertica', |
||||
driver: 'com.vertica.jdbc.Driver', |
||||
url: 'jdbc:vertica://ip:port/databaseName', |
||||
}, { |
||||
text:'Hsql', |
||||
text: 'Hsql', |
||||
databaseType: 'hsql', |
||||
driver: 'com.fr.third.org.hsqldb.jdbcDriver', |
||||
url: 'jdbc:hsqldb:file:[PATH_TO_DB_FILES]', |
||||
}, { |
||||
text:'IBM DB2', |
||||
text: 'IBM DB2', |
||||
databaseType: 'ibm-db2', |
||||
driver: 'com.ibm.db2.jcc.DB2Driver', |
||||
url: 'jdbc:db2://hostname:port/dbname', |
||||
}, { |
||||
text:'INFORMIX', |
||||
text: 'INFORMIX', |
||||
databaseType: 'informix', |
||||
driver: 'com.informix.jdbc.IfxDriver', |
||||
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}', |
||||
}, { |
||||
text:'KINGBASE', |
||||
text: 'KINGBASE', |
||||
databaseType: 'kingbase', |
||||
driver: 'com.kingbase.Driver', |
||||
url: 'jdbc:kingbase://hostname:port', |
||||
}, { |
||||
text:'Microsoft SQL Server', |
||||
text: 'Microsoft SQL Server', |
||||
databaseType: 'sql-server', |
||||
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver', |
||||
url: 'jdbc:sqlserver://localhost:1433;databaseName=', |
||||
}, { |
||||
text:'MySQL', |
||||
text: 'MySQL', |
||||
databaseType: 'mysql', |
||||
driver: 'com.mysql.jdbc.Driver', |
||||
drivers:['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'], |
||||
drivers: ['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'], |
||||
url: 'jdbc:mysql://localhost/dbname', |
||||
}, |
||||
{ |
||||
text:'Oracle', |
||||
text: 'Oracle', |
||||
databaseType: 'oracle', |
||||
driver: 'oracle.jdbc.driver.OracleDriver', |
||||
url: 'jdbc:oracle:thin:@localhost:1521:databaseName', |
||||
}, |
||||
{ |
||||
text:'Pivotal Greenplum Database', |
||||
text: 'Pivotal Greenplum Database', |
||||
databaseType: 'pivotal-greenplum-database', |
||||
driver: 'org.postgresql.Driver', |
||||
url: 'jdbc:postgresql://hostname:port/dbname', |
||||
}, { |
||||
text:'Postgresql', |
||||
text: 'Postgresql', |
||||
databaseType: 'postgresql', |
||||
driver: 'org.postgresql.Driver', |
||||
url: 'jdbc:postgresql://hostname:port/dbname', |
||||
}, { |
||||
text:'Presto', |
||||
text: 'Presto', |
||||
databaseType: 'presto', |
||||
driver: 'com.facebook.presto.jdbc.PrestoDriver', |
||||
url: 'jdbc:presto://host:port/catalog', |
||||
}, { |
||||
text:'SAP HANA', |
||||
text: 'SAP HANA', |
||||
databaseType: 'sap-hana', |
||||
driver: 'com.sap.db.jdbc.Driver', |
||||
url: 'jdbc:sap://hostname:port?reconnect=true', |
||||
}, { |
||||
text:'SAP Sybase', |
||||
text: 'SAP Sybase', |
||||
databaseType: 'sap-sybase', |
||||
driver: 'com.sybase.jdbc4.jdbc.SybDriver', |
||||
url: 'jdbc:sybase:Tds:hostname:2638/databasename', |
||||
}, { |
||||
text:'SPARK', |
||||
text: 'SPARK', |
||||
databaseType: 'spark', |
||||
driver: 'org.apache.hive.jdbc.HiveDriver', |
||||
url: 'jdbc:hive2://hostname:port/databasename', |
||||
}, { |
||||
text:'Sqlite', |
||||
text: 'Sqlite', |
||||
databaseType: 'sqlite', |
||||
driver: 'org.sqlite.JDBC', |
||||
url: 'jdbc:sqlite:[PATH_TO_DB_FILES]', |
||||
}, { |
||||
text:'TeraData', |
||||
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', |
||||
text: 'TRANSWARP INCEPTOR', |
||||
databaseType: 'transwarp-inceptor', |
||||
driver: 'org.apache.hive.jdbc.HiveDriver', |
||||
url: 'jdbc:hive2://hostname:port/databasename', |
||||
}, |
||||
]; |
||||
|
||||
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 : '数据连接'; |
||||
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', |
||||
}, |
||||
]; |
||||
|
||||
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 : ''}`; |
||||
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,63 @@
|
||||
export default { |
||||
'Dec-Dcm_Connection_Management': '数据连接管理', |
||||
'Dec-Dcm_Pool_Connection_Management': '连接池管理', |
||||
'Dec-Dcm_Data_Connections': '数据连接', |
||||
'Dec-Dcm_Active_Connections_Number': '活动连接数', |
||||
'Dec-Dcm_Leisure_Connections_Number': '空闲连接数', |
||||
'Dec-Dcm_Connections': '连接', |
||||
'Dec-Dcm_Default': '默认', |
||||
'Dec-Dcm_Delete': '删除', |
||||
'Dec-Dcm_Test_Connection': '测试连接', |
||||
'Dec-Dcm_Copy': '复制', |
||||
'Dec-Dcm_Edit': '编辑', |
||||
'Dec-Dcm_Save': '保存', |
||||
'Dec-Dcm_Yes': '是', |
||||
'Dec-Dcm_No': '否', |
||||
'Dec-Dcm_Search': '搜索', |
||||
'Dec-Dcm_Type': '类型', |
||||
'Dec-Dcm_Other': '其他', |
||||
'Dec-Dcm_Tips': '提示', |
||||
'Dec-Dcm_Back': '返回', |
||||
'Dec-Dcm_Creator': '创建者', |
||||
'Dec-Dcm_First_Step': '第一步', |
||||
'Dec-Dcm_Second_Step': '第二步', |
||||
'Dec-Dcm_Third_Step': '第三步', |
||||
'Dec-Dcm_Connection_Detailed_Information': '详细信息', |
||||
'Dec-Dcm_Connection_Handup_Information': '收起信息', |
||||
'Dec-Dcm_Connection_Testing': '正在测试连接,请稍候...', |
||||
'Dec-Dcm_Connection_Test_Fail': '测试连接失败', |
||||
'Dec-Dcm_Connection_Test_Success': '连接成功', |
||||
'Dec-Dcm_Connection_Option_Cannot_Find': '找不到该连接的配置信息', |
||||
'Dec-Dcm_Connection_Config_No_Save': '当前设置尚未保存,是否保存?', |
||||
'Dec-Dcm_Connection_New': '新建数据连接', |
||||
'Dec-Dcm_Connection_More': '更多数据连接...', |
||||
'Dec-Dcm_Connection_More_Title': '更多数据连接', |
||||
'Dec-Dcm_Connection_Other': '其他', |
||||
'Dec-Dcm_Connection_Plase_Add_One': '请选择左侧数据连接或点击新建数据连接', |
||||
'Dec-Dcm_Connection_Is_Existence': '数据连接名已存在', |
||||
'Dec-Dcm_Connection_Form_ConnectionName': '数据连接名', |
||||
'Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm': '*修改数据连接名会影响相关数据表和仪表板', |
||||
'Dec-Dcm_Connection_Form_Driver': '驱动器', |
||||
'Dec-Dcm_Connection_Form_URL': 'URL', |
||||
'Dec-Dcm_Connection_Form_Place_Input': '请输入', |
||||
'Dec-Dcm_Connection_Form_OriginalCharsetName': '编码', |
||||
'Dec-Dcm_Connection_Form_Auto': '自动', |
||||
'Dec-Dcm_Connection_Form_UserName': '用户名', |
||||
'Dec-Dcm_Connection_Form_Password': '密码', |
||||
'Dec-Dcm_Connection_Form_Pool_Properties': '连接池属性', |
||||
'Dec-Dcm_Connection_Form_SQL_Validation_Query': 'SQL验证查询', |
||||
'Dec-Dcm_Connection_Form_Connection-Check': '获取连接前校验', |
||||
'Dec-Dcm_Connection_Form_Connection_Max_Number': '最大活动连接数', |
||||
'Dec-Dcm_Connection_Form_Place_Input-Number': '请输入有效的正整数', |
||||
'Dec-Dcm_Connection_Form_Pattern': '模式', |
||||
'Dec-Dcm_Connection_Form_Database_Addr': '数据库地址', |
||||
'Dec-Dcm_Connection_Form_Database_Port': '端口号', |
||||
'Dec-Dcm_Connection_Make_Sure_Delete': '确定删除该数据连接?', |
||||
'Dec-Dcm_Connection_ReConnect': '重新连接', |
||||
'Dec-Dcm_Connection_JNDI_Form_ConnectionName': 'JNDI的名字', |
||||
'Dec-Dcm_Connection_Form_JNDI_Context': '上下文', |
||||
'Dec-Dcm_Connection_Form_JNDI_Advanced': '高级', |
||||
'Dec-Dcm_Connection_Form_JNDI_Other_Attributes': '其他属性', |
||||
'Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes': '收起', |
||||
'Dec-Dcm_Connection_Form_JNDI_Notice': '注意:需要把包含INITIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下.', |
||||
}; |
@ -1,325 +0,0 @@
|
||||
.database-connection-layout{ |
||||
width: 100%; |
||||
height: 100%; |
||||
background-color: #f7f8fa; |
||||
.title{ |
||||
background-color: #fff; |
||||
border-bottom: 1px solid #e8eaed; |
||||
.title-item{ |
||||
height: 39px; |
||||
line-height: 39px; |
||||
padding-left: 15px; |
||||
padding-right: 15px; |
||||
text-align: center; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
overflow: hidden; |
||||
position: relative; |
||||
flex-shrink: 0; |
||||
font-weight: 700; |
||||
cursor: pointer; |
||||
} |
||||
.close-button { |
||||
position: absolute !important; |
||||
right: 5px; |
||||
top: 5px; |
||||
width: 30px; |
||||
height: 30px; |
||||
cursor: pointer; |
||||
background-image: url("../img/icon_close9x9_normal.png"); |
||||
background-repeat: no-repeat; |
||||
background-position: center; |
||||
} |
||||
} |
||||
.linkset{ |
||||
margin: 10px; |
||||
bottom: 0px; |
||||
background-color: #ffffff; |
||||
} |
||||
.linkStatus{ |
||||
margin: 10px; |
||||
top: 40px; |
||||
background-color: #ffffff; |
||||
} |
||||
} |
||||
|
||||
.database-left{ |
||||
border-right: 1px solid #e8eaed; |
||||
.select-group{ |
||||
border-bottom: 1px solid #e8eaed; |
||||
.select{ |
||||
margin: 10px; |
||||
.database-link-items{ |
||||
padding-left:10px; |
||||
.link-item{ |
||||
border-top: 1px solid #e8eaed; |
||||
} |
||||
} |
||||
} |
||||
.status-title{ |
||||
font-weight: 700; |
||||
margin-left: 12px; |
||||
margin-top: 12px; |
||||
} |
||||
} |
||||
.left-list{ |
||||
margin: 10px; |
||||
.left-item{ |
||||
height: 24px; |
||||
line-height: 24px; |
||||
cursor: pointer; |
||||
&:hover{ |
||||
background-color: rgba(54,133,242,.05); |
||||
.icons{ |
||||
.action-icon{ |
||||
visibility: visible !important; |
||||
} |
||||
|
||||
} |
||||
} |
||||
.icons{ |
||||
float: right !important; |
||||
.action-icon{ |
||||
visibility: hidden; |
||||
} |
||||
.b-font{ |
||||
font-size: 16px; |
||||
} |
||||
} |
||||
} |
||||
.left-item-selected{ |
||||
background-color: rgba(54,133,242,.05); |
||||
.link-title{ |
||||
color: #3685f2; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.database-right{ |
||||
min-width: 400px; |
||||
overflow: auto; |
||||
.bi-flex-center-adapt-layout{ |
||||
height: 100%; |
||||
.data-connection-background{ |
||||
background: url(../img/resources.png) center center no-repeat; |
||||
background-size: contain; |
||||
} |
||||
} |
||||
.right-status-title{ |
||||
border-bottom: 1px solid #e8eaed; |
||||
color: #3d4d66; |
||||
line-height: 40px; |
||||
padding-left: 10px; |
||||
font-weight: 700; |
||||
} |
||||
.right-status-body{ |
||||
margin: 10px 30px 0px 30px; |
||||
height: 50%; |
||||
.right-status-item{ |
||||
height: 150px; |
||||
width: 50%; |
||||
top: 0; left: 0; |
||||
position: absolute !important; |
||||
.right-status-board { margin-left: 25px; position: relative !important; left: -25px;} |
||||
} |
||||
.right-status-right{ |
||||
height: 150px; |
||||
width: 50%; |
||||
top: 0; right:0; |
||||
position: absolute !important; |
||||
.right-status-board { margin-right: 25px; position: relative !important; left: 25px; } |
||||
} |
||||
.right-status-board{ |
||||
background-color: #f7f8fa; |
||||
color: #3d4d66; |
||||
width: 100%; |
||||
height: 100%; |
||||
.right-status-board-item{ |
||||
text-align: center; |
||||
margin-top: 38px; |
||||
.right-status-text{ |
||||
display: inline-block; |
||||
} |
||||
.card-font1{ |
||||
color: #13CD66; |
||||
font-size: 32px; |
||||
} |
||||
.card-font2{ |
||||
color: #3685F2; |
||||
font-size: 32px; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
.right-content{ |
||||
height: 100%; |
||||
.right-title{ |
||||
border-bottom: 1px solid #e8eaed; |
||||
color: #3d4d66; |
||||
line-height: 40px; |
||||
padding-left: 10px; |
||||
.right-title-text{ |
||||
font-weight: 700; |
||||
} |
||||
.right-title-button{ |
||||
float: right !important; |
||||
margin-right: 10px; |
||||
margin-top: 8px; |
||||
} |
||||
} |
||||
.right-show{ |
||||
margin: 10px; |
||||
.right-form{ |
||||
width: 100%; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.both-side{ |
||||
line-height: 24px; |
||||
margin-bottom: 10px; |
||||
.left{ |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
position: relative; |
||||
flex-shrink: 0; |
||||
font-weight: 700; |
||||
} |
||||
.hint{ |
||||
padding-left: 5px; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
overflow: hidden; |
||||
position: relative; |
||||
flex-shrink: 0; |
||||
margin-left: 5px; |
||||
color: #9ea6b2; |
||||
} |
||||
} |
||||
.shared-component-title{ |
||||
height: 24px; |
||||
line-height: 24px; |
||||
margin-bottom: 10px; |
||||
color: #9ea6b2; |
||||
border-bottom: 1px solid #e8eaed; |
||||
} |
||||
.comfirm-content{ |
||||
margin-top: 40px; |
||||
margin-left: 20px; |
||||
.comfirm-icon{ |
||||
background-image: url("../img/warning.png"); |
||||
background-size: contain; |
||||
margin-right: 12px; |
||||
} |
||||
.bi-text{ |
||||
height: 50px; |
||||
line-height: 50px; |
||||
margin-left: 12px; |
||||
} |
||||
} |
||||
.more-link{ |
||||
.more-link-item{ |
||||
width: 538px; |
||||
overflow: hidden auto; |
||||
left: -10px !important; |
||||
right: 0px; |
||||
top: 10px; |
||||
bottom: 0px; |
||||
position: absolute; |
||||
height: 380px; |
||||
.link-item{ |
||||
margin-left: 10px; |
||||
margin-bottom: 10px; |
||||
cursor: pointer; |
||||
border: solid 1px #fff; |
||||
&:hover{ |
||||
border: solid 1px #3480f2; |
||||
} |
||||
.selected{ |
||||
position: absolute !important; |
||||
right: -1px; |
||||
top: -1px; |
||||
height: 30px; |
||||
width: 30px; |
||||
background: url(../img/database-selected.png) center center no-repeat; |
||||
background-size: contain; |
||||
} |
||||
.text{ |
||||
height: 27px; |
||||
line-height: 27px; |
||||
padding-left: 2px; |
||||
padding-right: 2px; |
||||
text-align: center; |
||||
white-space: nowrap; |
||||
background: #F0F3F7; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
.popover-notitle{ |
||||
.bi-header-background{ |
||||
display: none; |
||||
} |
||||
.bi-absolute-layout{ |
||||
top:0px !important; |
||||
} |
||||
} |
||||
.bi-custom-show{ |
||||
.show-content{ |
||||
text-align: center; |
||||
.loading-icon{ |
||||
display: block; |
||||
background: url(../img/loading.gif) center center no-repeat; |
||||
background-size: contain; |
||||
margin: 0 auto; |
||||
margin-bottom: 18px; |
||||
} |
||||
.success-icon{ |
||||
display: block; |
||||
background: url(../img/success.png) center center no-repeat; |
||||
background-size: contain; |
||||
margin: 0 auto; |
||||
margin-bottom: 18px; |
||||
} |
||||
.error-icon{ |
||||
display: block; |
||||
background: url(../img/error.png) center center no-repeat; |
||||
background-size: contain; |
||||
margin: 0 auto; |
||||
margin-bottom: 18px; |
||||
} |
||||
.buttons{ |
||||
margin-top: 18px; |
||||
div{ |
||||
margin: 0 4px; |
||||
} |
||||
} |
||||
} |
||||
.show-more{ |
||||
text-align: left !important; |
||||
height: 73px; |
||||
background: #F2F4F7; |
||||
margin-bottom: 10px; |
||||
padding: 5px; |
||||
margin-top: 10px; |
||||
} |
||||
} |
||||
|
||||
.link-font .b-font:before { |
||||
content: "\e759"; |
||||
color: inherit; |
||||
} |
||||
.link-text-font .b-font:before { |
||||
content: "\e763"; |
||||
color: inherit; |
||||
} |
||||
.info-font .b-font:before { |
||||
content: "\e63c"; |
||||
color: inherit; |
||||
} |
||||
.delete-font .b-font:before { |
||||
content: "\e6c4"; |
||||
color: inherit; |
||||
} |
@ -1,48 +0,0 @@
|
||||
import {Vtape} from '../ui/index'; |
||||
import {LinkType} from '@ui/type'; |
||||
import appModel from './app.model'; |
||||
import title from './title/title.component'; |
||||
import linkSet from './link_set/link-set.component'; |
||||
import linkStatus from './link_status/link_status.component'; |
||||
import '../demo/plugin.redis.edit'; |
||||
import '../demo/plugin.redis.preview'; |
||||
import '../demo/plugin.tedis.pool'; |
||||
import {fetchLinkList} from '../shared/crud/crud.request'; |
||||
import './app.component.scss'; |
||||
|
||||
const className = 'fr.main'; |
||||
const Widget = BI.inherit(BI.Widget, { |
||||
_store() { |
||||
return BI.Models.getModel(appModel); |
||||
}, |
||||
render() { |
||||
return { |
||||
type: Vtape, |
||||
cls: 'database-connection-layout', |
||||
items: [{ |
||||
el: { |
||||
type: title, |
||||
}, |
||||
height: 40, |
||||
}, |
||||
{ |
||||
type:linkSet, |
||||
}, |
||||
{ |
||||
type: linkStatus, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
/** |
||||
* 获取数据连接列表 |
||||
*/ |
||||
fetchLinkList((linkList: LinkType[]) => { |
||||
this.store.setLinkList(linkList); |
||||
}); |
||||
}, |
||||
}); |
||||
BI.shortcut(className, Widget); |
||||
|
||||
export default className; |
@ -1,5 +1,4 @@
|
||||
export const ConstantName = 'dec.constant.database.conf.connect.list'; |
||||
export const links = ['APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200']; |
||||
BI.constant(ConstantName, [ |
||||
]); |
||||
export default ConstantName; |
||||
|
@ -0,0 +1,55 @@
|
||||
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; |
@ -0,0 +1,4 @@
|
||||
@import '../../../../less/index.less'; |
||||
.dec-webui-dcm-connection-left-item{ |
||||
.hover-visible(link-item-icon); |
||||
} |
@ -0,0 +1,77 @@
|
||||
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; |
@ -0,0 +1,43 @@
|
||||
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; |
@ -0,0 +1,26 @@
|
||||
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; |
@ -0,0 +1,39 @@
|
||||
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; |
@ -0,0 +1,50 @@
|
||||
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; |
@ -0,0 +1,154 @@
|
||||
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; |
@ -0,0 +1,6 @@
|
||||
@import '../../../../less/index.less'; |
||||
.dec-webui-dcm-connection-more-link-item{ |
||||
&:hover{ |
||||
border-color :@border-color-highlight; |
||||
} |
||||
} |
@ -0,0 +1,68 @@
|
||||
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; |
@ -0,0 +1,6 @@
|
||||
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; |
@ -0,0 +1,16 @@
|
||||
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; |
@ -0,0 +1,52 @@
|
||||
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; |
@ -0,0 +1,30 @@
|
||||
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; |
@ -0,0 +1,33 @@
|
||||
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; |
@ -0,0 +1,25 @@
|
||||
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; |
||||
} |
@ -0,0 +1,6 @@
|
||||
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; |
@ -0,0 +1,74 @@
|
||||
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; |
@ -0,0 +1,20 @@
|
||||
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; |
@ -0,0 +1,373 @@
|
||||
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; |
@ -0,0 +1,226 @@
|
||||
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; |
@ -0,0 +1,325 @@
|
||||
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; |
@ -0,0 +1,20 @@
|
||||
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; |
@ -0,0 +1,72 @@
|
||||
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; |
@ -0,0 +1,203 @@
|
||||
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; |
@ -0,0 +1,20 @@
|
||||
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; |
@ -0,0 +1,66 @@
|
||||
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; |
@ -0,0 +1,23 @@
|
||||
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,26 +0,0 @@
|
||||
import {WidgetType, Vertical} from '@ui'; |
||||
import Model from '../link-set.model'; |
||||
import {LinkType} from '@ui/type'; |
||||
import {getLinks} from './left.service'; |
||||
const className = 'fr.component.linkset.left'; |
||||
let leftContent: any = null; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
watch:{ |
||||
linkList(linkList: LinkType[]) { |
||||
leftContent.populate(BI.createItems(getLinks(linkList))); |
||||
}, |
||||
}, |
||||
render() { |
||||
return { |
||||
type: Vertical, |
||||
ref(_ref: any) { |
||||
leftContent = _ref; |
||||
}, |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,18 +0,0 @@
|
||||
import {LinkType} from '@ui/type'; |
||||
import LeftItem from './left_item/left.item.component'; |
||||
|
||||
export const getLinks = (linkList: LinkType[]): any => { |
||||
const links: any[] = []; |
||||
linkList.forEach((item: LinkType) => { |
||||
links.push({ |
||||
type: LeftItem, |
||||
extraCls: item.isSelected ? 'left-item-selected' : '', |
||||
title: item.connectionName, |
||||
id: item.connectionId, |
||||
creator: item.creator, |
||||
text: item.text ? item.text : '默认', |
||||
}); |
||||
}); |
||||
|
||||
return links; |
||||
}; |
@ -1,79 +0,0 @@
|
||||
import {WidgetType, Left, Label, Icon} from '@ui'; |
||||
import ItemIcon from './left.item.icon.component'; |
||||
import Model from '../../link-set.model'; |
||||
const className = 'fr.component.linkSet.left.item'; |
||||
const Widget: WidgetType = { |
||||
props: { |
||||
title:'', |
||||
id:'', |
||||
creator: '', |
||||
}, |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
render() { |
||||
const {title, extraCls, creator, text, id} = this.options; |
||||
|
||||
return { |
||||
type: Left, |
||||
cls: 'left-item', |
||||
extraCls, |
||||
items: [ |
||||
{ |
||||
type: Icon, |
||||
cls: 'link-font', |
||||
height: 24, |
||||
width: 26, |
||||
text: '连接', |
||||
title, |
||||
}, |
||||
{ |
||||
type: Label, |
||||
cls:'link-title', |
||||
textAlign: 'left', |
||||
text: title, |
||||
title, |
||||
}, |
||||
{ |
||||
type: Left, |
||||
cls: 'icons', |
||||
items: [ |
||||
{ |
||||
type: ItemIcon, |
||||
cls: 'link-text-font', |
||||
title: '测试连接', |
||||
id, |
||||
}, |
||||
{ |
||||
type: ItemIcon, |
||||
cls: 'copy-font', |
||||
title: '复制', |
||||
id, |
||||
}, |
||||
{ |
||||
type: ItemIcon, |
||||
cls: 'info-font', |
||||
title: `类型:${text === 'DESIGNER' ? '其他' : text} \r\n创建者:${creator}`, |
||||
id, |
||||
}, |
||||
{ |
||||
type: ItemIcon, |
||||
cls: 'delete-font', |
||||
title: '删除', |
||||
id, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {title} = this.options; |
||||
this.element.on('click', () => { |
||||
this.store.setLinkSelected(title); |
||||
}); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,86 +0,0 @@
|
||||
import {WidgetType, Icon, BubbleCombo, TextBubblePopupBarView} from '@ui/index'; |
||||
import Model from '../../link-set.model'; |
||||
const className = 'fr.component.linkSet.left.item.icon'; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
render() { |
||||
const {cls, title, id} = this.options; |
||||
const that = this; |
||||
let iconContent: any = null; |
||||
let combo: any = null; |
||||
if (title === '删除') { |
||||
return { |
||||
type: BubbleCombo, |
||||
direction: 'bottom', |
||||
ref () { |
||||
combo = this; |
||||
}, |
||||
el: { |
||||
type: Icon, |
||||
cls, |
||||
extraCls: 'action-icon', |
||||
height: 24, |
||||
width: 26, |
||||
title, |
||||
ref (ref: any) { |
||||
iconContent = ref; |
||||
}, |
||||
}, |
||||
popup: { |
||||
type: TextBubblePopupBarView, |
||||
text: '确定删除该数据连接?', |
||||
listeners: [{ |
||||
eventName: BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, |
||||
action (type: boolean) { |
||||
combo.hideView(); |
||||
if (type) { |
||||
that.store.onIconClick(title, id); |
||||
} |
||||
}, |
||||
}], |
||||
}, |
||||
listeners: [{ |
||||
eventName: BI.BubbleCombo.EVENT_EXPAND, |
||||
action () { |
||||
iconContent.element.css({ |
||||
visibility:'visible', |
||||
}); |
||||
}, |
||||
}, { |
||||
eventName: BI.BubbleCombo.EVENT_AFTER_HIDEVIEW, |
||||
action () { |
||||
iconContent.element.css({ |
||||
visibility:'hidden', |
||||
}); |
||||
}, |
||||
}], |
||||
}; |
||||
} |
||||
|
||||
return { |
||||
type: Icon, |
||||
cls, |
||||
extraCls: 'action-icon', |
||||
height: 24, |
||||
width: 26, |
||||
title, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {title, id} = this.options; |
||||
if (title !== '删除') { |
||||
this.element.on('click', (event: any) => { |
||||
event.stopPropagation(); |
||||
this.store.onIconClick(title, id); |
||||
}); |
||||
} else { |
||||
this.element.on('click', (event: any) => { |
||||
event.stopPropagation(); |
||||
}); |
||||
} |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,195 +0,0 @@
|
||||
import {ModelType} from '@ui/index'; |
||||
import {LinkType} from '@ui/type'; |
||||
import {deleteConnection, testConnection} from '@shared/crud/crud.request'; |
||||
import {databaseTyle, getCnnectionName} from './select/select.service'; |
||||
import dialog from '@shared/service/dialog.service'; |
||||
import {saveConnection} from './link-set.service'; |
||||
|
||||
const className = 'fr.model.linkset'; |
||||
const Model: ModelType = { |
||||
context: ['tab', 'linkList', 'linkSelected', 'linkUpdate', 'connectionNameErr'], |
||||
actions: { |
||||
/** |
||||
* 左侧点击链接选中 |
||||
* @param name |
||||
*/ |
||||
setLinkSelected(name: string) { |
||||
this.noSaveConfirm(() => { |
||||
this._setLinkSelected(name); |
||||
}); |
||||
}, |
||||
_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; |
||||
}, |
||||
onIconClick(title: string, id: string) { |
||||
switch (title) { |
||||
case '删除': |
||||
deleteConnection(id, () => { |
||||
this.model.linkList = [...this.model.linkList.filter((item: LinkType) => item.connectionId !== id)]; |
||||
this.model.linkSelected = {}; |
||||
this.model.linkUpdate = {}; |
||||
}); |
||||
break; |
||||
case '测试连接': |
||||
this._textLink(id); |
||||
break; |
||||
case '复制': |
||||
this.noSaveConfirm(() => { |
||||
this.copyLink(id); |
||||
}); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
}, |
||||
_textLink(id: string) { |
||||
const loadingId = dialog.loading('正在测试连接,请稍候...'); |
||||
const link = this.model.linkList.find((item: LinkType) => item.connectionId === id); |
||||
testConnection(link, (res: any) => { |
||||
dialog.close(loadingId); |
||||
if (res && res.errorCode) { |
||||
dialog.linkFail(`${link.connectionName}测试连接失败`, res.errorMsg, () => { |
||||
this._textLink(id); |
||||
}); |
||||
} else { |
||||
dialog.success('连接成功'); |
||||
} |
||||
}); |
||||
}, |
||||
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; |
||||
}, |
||||
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; |
||||
} |
||||
}, |
||||
setNewLink(value: string) { |
||||
if (!databaseTyle.some(item => item.text === value) && !BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${value.toLowerCase()}.edit`)) { |
||||
dialog.error('找不到该连接的配置信息'); |
||||
|
||||
return; |
||||
} |
||||
this.noSaveConfirm(() => { |
||||
this._setNewLink(value); |
||||
}); |
||||
}, |
||||
_setNewLink(value: string) { |
||||
const name = getCnnectionName(this.model.linkList, value); |
||||
let data = {}; |
||||
databaseTyle.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, |
||||
}; |
||||
}, |
||||
setConnectionNameErr(err: string) { |
||||
this.model.connectionNameErr = err; |
||||
}, |
||||
noSaveConfirm(cb: Function) { |
||||
if (this.model.linkSelected && this.model.linkSelected.isSelected) { |
||||
dialog.confirm('当前设置尚未保存,是否保存?', (isConfirm: boolean) => { |
||||
if (isConfirm) { |
||||
this.saveLink(); |
||||
} else { |
||||
this.setCancel(); |
||||
} |
||||
cb(); |
||||
}); |
||||
} else { |
||||
cb(); |
||||
} |
||||
}, |
||||
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); |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
BI.model(className, BI.inherit(Fix.Model, Model)); |
||||
export default className; |
@ -1,61 +0,0 @@
|
||||
import {WidgetType, Vertical, SearchEditor, Left, Vtape} from '@ui/index'; |
||||
import {databaseTyle} from '../select/select.service'; |
||||
import MoreLinkItem from './more.link.item.component'; |
||||
const className = 'fr.component.linkSet.morelink'; |
||||
let morkLinkItem: any = null; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
return { |
||||
type: Vtape, |
||||
cls: 'more-link', |
||||
items: [ |
||||
{ |
||||
el:{ |
||||
type: Vertical, |
||||
items:[{ |
||||
type: SearchEditor, |
||||
width: 300, |
||||
watermark: '搜索', |
||||
}], |
||||
}, |
||||
height: 30, |
||||
}, |
||||
{ |
||||
type: Left, |
||||
cls:'more-link-item', |
||||
ref(ref: any) { |
||||
morkLinkItem = ref; |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this._renderItems(); |
||||
}, |
||||
_renderItems(text = '') { |
||||
const databaseLink = databaseTyle.slice(12, 12 + 33); |
||||
const items: any[] = []; |
||||
const that = this; |
||||
databaseLink.forEach(item => { |
||||
items.push({ |
||||
type: MoreLinkItem, |
||||
text: item.text, |
||||
name: item.databaseType, |
||||
selected: text === item.text, |
||||
listeners: [ |
||||
{ |
||||
eventName: 'EVENT_SELECT', |
||||
action (text: string) { |
||||
that._renderItems(text); |
||||
that.fireEvent('EVENT_SELECT', text); |
||||
}, |
||||
}, |
||||
], |
||||
}); |
||||
}); |
||||
morkLinkItem.populate(BI.createItems(items)); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,40 +0,0 @@
|
||||
import {WidgetType, Vertical, Img, Label, Layout} from '@ui/index'; |
||||
const className = 'fr.component.linkSet.morelink.item'; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
const {text, name, selected} = this.options; |
||||
|
||||
return { |
||||
type: Vertical, |
||||
cls:'link-item', |
||||
width: 120, |
||||
height: 117, |
||||
items:[ |
||||
{ |
||||
type: Img, |
||||
width: 120, |
||||
height: 90, |
||||
src:`./img/${name}.jpg`, |
||||
}, { |
||||
type: Layout, |
||||
cls: 'selected', |
||||
invisible: !selected, |
||||
width:30, |
||||
height: 30, |
||||
}, { |
||||
type: Label, |
||||
cls:'text', |
||||
text, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {text} = this.options; |
||||
this.element.on('click', () => { |
||||
this.fireEvent('EVENT_SELECT', text); |
||||
}); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,37 +0,0 @@
|
||||
import {WidgetType, CenterAdapt, Vertical, Layout, Label} from '@ui/index'; |
||||
const className = 'fr.component.right.nothing'; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
return { |
||||
type: CenterAdapt, |
||||
items: [{ |
||||
type: Vertical, |
||||
width: 260, |
||||
height: 180, |
||||
items:[ |
||||
{ |
||||
type: Layout, |
||||
cls: 'data-connection-background', |
||||
width: 260, |
||||
height: 130, |
||||
}, |
||||
{ |
||||
type:Label, |
||||
cls: 'bi-tips', |
||||
height: 20, |
||||
text:'请选择左侧数据连接或点击新建数据连接', |
||||
}, |
||||
{ |
||||
type:Label, |
||||
cls: 'bi-tips', |
||||
height: 20, |
||||
text:'平台仅支持使用JDBC的数据连接的管理', |
||||
}, |
||||
], |
||||
|
||||
}], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,39 +0,0 @@
|
||||
import {WidgetType, Vertical} from '@ui'; |
||||
import {LinkType} from '@ui/type'; |
||||
import Nothing from './nothing.component'; |
||||
import RightDetail from './right_detail/right.detail.component'; |
||||
import Model from '../link-set.model'; |
||||
let rightContent: any = null; |
||||
const className = 'fr.component.right'; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
watch:{ |
||||
linkSelected(linkSelected: LinkType) { |
||||
rightContent.populate(BI.createItems([ |
||||
{ |
||||
type: (linkSelected && linkSelected.connectionName) ? RightDetail : Nothing, |
||||
}, |
||||
])); |
||||
}, |
||||
}, |
||||
render() { |
||||
return { |
||||
type:Vertical, |
||||
cls:'database-right', |
||||
ref(_ref: any) { |
||||
rightContent = _ref; |
||||
}, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
rightContent.populate(BI.createItems([ |
||||
{ |
||||
type: Nothing, |
||||
}, |
||||
])); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,54 +0,0 @@
|
||||
import {WidgetType, Vertical} from '@ui/index'; |
||||
import Model from '../../link-set.model'; |
||||
import Title from '../right_title/right.title.component'; |
||||
import RightShow from '../right_show/right.show.component'; |
||||
import RightEdit from '../right_edit/right.edit.component'; |
||||
import RightEditMysql from '../right_edit/right.edit.mysql.component'; |
||||
import {LinkType} from '@ui/type'; |
||||
import pluginListConstant from '../../../app.constant'; |
||||
const className = 'fr.component.right.detail'; |
||||
let rightDetail: any = null; |
||||
const renderEdit = (linkSelected: LinkType): void => { |
||||
const plugins: string[] = BI.Constants.getConstant(pluginListConstant); |
||||
const isPlugin = BI.some(plugins, (index: number, item: string) => item === linkSelected.text); |
||||
let typeEdit = linkSelected.databaseType === 'mysql' ? RightEditMysql : RightEdit; |
||||
if (isPlugin) { |
||||
typeEdit = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.edit`); |
||||
} |
||||
const showPage = !isPlugin ? RightShow : BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.preview`); |
||||
rightDetail.populate(BI.createItems([ |
||||
{ |
||||
type: Title, |
||||
isEdit: linkSelected.isSelected, |
||||
linkSelected, |
||||
}, { |
||||
type: linkSelected.isSelected ? typeEdit : showPage, |
||||
linkSelected, |
||||
}, |
||||
])); |
||||
}; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
watch:{ |
||||
linkSelected(linkSelected: LinkType) { |
||||
renderEdit(linkSelected); |
||||
}, |
||||
}, |
||||
render() { |
||||
return { |
||||
type: Vertical, |
||||
cls:'right-content', |
||||
ref(_ref: any) { |
||||
rightDetail = _ref; |
||||
}, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const linkSelected: LinkType = this.model.linkSelected; |
||||
renderEdit(linkSelected); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,278 +0,0 @@
|
||||
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Editor, Button, TextValueCombo} from '@ui/index'; |
||||
import {LinkType} from '@ui/type'; |
||||
import charset from './right.edit.constant'; |
||||
import Model from '../../link-set.model'; |
||||
import FormItem from '@shared/components/form.item.component'; |
||||
import Title from '@shared/components/title.component'; |
||||
import {getDrivers} from './right.edit.service'; |
||||
let ConnectionName: any = null; |
||||
const className = 'fr.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, |
||||
cls: 'right-show', |
||||
items: [ |
||||
{ |
||||
type: FormItem, |
||||
text: '数据连接名', |
||||
hint: '*修改数据连接名会影响相关数据表和仪表板', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
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: FormItem, |
||||
text: '第一步', |
||||
height: 400, |
||||
form:{ |
||||
type: Vertical, |
||||
cls: 'right-form', |
||||
items:[ |
||||
{ |
||||
type: FormItem, |
||||
text: '驱动器', |
||||
form:{ |
||||
type: TextValueCombo, |
||||
cls: 'bi-border', |
||||
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: FormItem, |
||||
text: 'URL', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.url, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
url: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '编码', |
||||
form:{ |
||||
type: TextValueCombo, |
||||
cls: 'bi-border', |
||||
width: 300, |
||||
text: linkSelected.originalCharsetName === '' ? '自动' : linkSelected.originalCharsetName, |
||||
items: BI.Constants.getConstant(charset), |
||||
listeners: [{ |
||||
eventName: BI.TextValueCombo.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
originalCharsetName: this.getValue()[0], |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '用户名', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.user, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
user: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '密码', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
inputType:'password', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.password, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
password: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: Title, |
||||
text: '连接池属性', |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: 'SQL验证查询', |
||||
height: 100, |
||||
form:{ |
||||
type: TextAreaEditor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
height:100, |
||||
value: linkSelected.validationQuery, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
validationQuery: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '获取连接前校验', |
||||
form:{ |
||||
type: MultiSelectItem, |
||||
text: '是', |
||||
selected: linkSelected.testOnBorrow, |
||||
width: 60, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
testOnBorrow: this.isSelected(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '最大活动连接数', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 60, |
||||
value: linkSelected.maxActive, |
||||
errorText: '请输入有效的正整数', |
||||
validationChecker (v: string) { |
||||
if (/^\+?[1-9][0-9]*$/.test(v)) { |
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
}, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
maxActive: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '第二步', |
||||
form: { |
||||
type: Button, |
||||
text: '测试连接', |
||||
level: 'ignore', |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '第三步', |
||||
form: { |
||||
type: FormItem, |
||||
text: '模式', |
||||
form: { |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
width: 300, |
||||
disabled: true, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,41 +0,0 @@
|
||||
export const ConstantName = 'bi.constant.database.conf.charset.list'; |
||||
export const Constant = BI.constant(ConstantName, [ |
||||
{ |
||||
text: '自动', |
||||
value: '', |
||||
}, |
||||
{ |
||||
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', |
||||
}, |
||||
]); |
||||
|
||||
export default ConstantName; |
@ -1,233 +0,0 @@
|
||||
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Editor, Button, TextValueCombo} from '@ui/index'; |
||||
import {LinkType} from '@ui/type'; |
||||
import charset from './right.edit.constant'; |
||||
import Model from '../../link-set.model'; |
||||
import FormItem from '@shared/components/form.item.component'; |
||||
import Title from '@shared/components/title.component'; |
||||
import {getDrivers} from './right.edit.service'; |
||||
const className = 'fr.component.right.edit.mysql'; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
render() { |
||||
const linkSelected: LinkType = this.model.linkSelected; |
||||
const that = this; |
||||
|
||||
return { |
||||
type: Vertical, |
||||
cls: 'right-show', |
||||
items: [ |
||||
{ |
||||
type: FormItem, |
||||
text: '数据连接名', |
||||
hint: '*修改数据连接名会影响相关数据表和仪表板', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
width: 300, |
||||
value: linkSelected.connectionName, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
connectionName: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '驱动器', |
||||
form:{ |
||||
type: TextValueCombo, |
||||
cls: 'bi-border', |
||||
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: FormItem, |
||||
text: 'URL', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.url, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
url: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '编码', |
||||
form:{ |
||||
type: TextValueCombo, |
||||
cls: 'bi-border', |
||||
width: 300, |
||||
text: linkSelected.originalCharsetName === '' ? '自动' : linkSelected.originalCharsetName, |
||||
items: BI.Constants.getConstant(charset), |
||||
listeners: [{ |
||||
eventName: BI.TextValueCombo.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
originalCharsetName: this.getValue()[0], |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '用户名', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.user, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
user: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '密码', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
inputType:'password', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
value: linkSelected.password, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
password: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: Title, |
||||
text: '连接池属性', |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: 'SQL验证查询', |
||||
height: 100, |
||||
form:{ |
||||
type: TextAreaEditor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 300, |
||||
height:100, |
||||
value: linkSelected.validationQuery, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
validationQuery: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '获取连接前校验', |
||||
form:{ |
||||
type: MultiSelectItem, |
||||
text: '是', |
||||
selected: linkSelected.testOnBorrow, |
||||
width: 60, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
testOnBorrow: this.isSelected(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '最大活动连接数', |
||||
form:{ |
||||
type: Editor, |
||||
cls: 'bi-border', |
||||
allowBlank:true, |
||||
watermark:'请输入', |
||||
width: 60, |
||||
value: linkSelected.maxActive, |
||||
errorText: '请输入有效的正整数', |
||||
validationChecker (v: string) { |
||||
if (/^\+?[1-9][0-9]*$/.test(v)) { |
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
}, |
||||
listeners: [{ |
||||
eventName: BI.Editor.EVENT_CHANGE, |
||||
action() { |
||||
that.store.setLinkUpdate({ |
||||
...that.model.linkUpdate, |
||||
maxActive: this.getValue(), |
||||
}); |
||||
}, |
||||
}], |
||||
}, |
||||
}, |
||||
{ |
||||
type: FormItem, |
||||
text: '测试连接', |
||||
form: { |
||||
type: Button, |
||||
text: '测试连接', |
||||
level: 'ignore', |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
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.component'; |
||||
import Title from '@shared/components/title.component'; |
||||
import {LinkType} from '@ui/type'; |
||||
const className = 'fr.component.right.show'; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(RightShowModel); |
||||
}, |
||||
render() { |
||||
const linkSelected: LinkType = this.model.linkSelected; |
||||
|
||||
return { |
||||
type: Vertical, |
||||
cls: 'right-show', |
||||
items: [ |
||||
{ |
||||
type: BothSide, |
||||
leftText: '数据连接名', |
||||
rightText: linkSelected.connectionName, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '驱动器', |
||||
rightText: linkSelected.driver, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: 'URL', |
||||
rightText: linkSelected.url, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '编码', |
||||
rightText: linkSelected.originalCharsetName === '' ? '自动' : linkSelected.originalCharsetName, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '用户名', |
||||
rightText: linkSelected.user, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '密码', |
||||
rightText: linkSelected.password, |
||||
}, |
||||
{ |
||||
type: Title, |
||||
text: '连接池属性', |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: 'SQL验证查询', |
||||
rightText: linkSelected.validationQuery, |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '获取连接前校验', |
||||
rightText: linkSelected.testOnBorrow ? '是' : '否', |
||||
}, |
||||
{ |
||||
type: BothSide, |
||||
leftText: '最大连接数量', |
||||
rightText: linkSelected.maxActive, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,64 +0,0 @@
|
||||
import {WidgetType, Left, Label, Button} from '@ui/index'; |
||||
import RightTitleModel from '../../link-set.model'; |
||||
import {LinkType} from '@ui/type'; |
||||
import {saveConnection} from '../../link-set.service'; |
||||
const className = 'fr.component.right.title'; |
||||
const Widget: WidgetType = { |
||||
_store() { |
||||
return BI.Models.getModel(RightTitleModel); |
||||
}, |
||||
render() { |
||||
const linkSelected: LinkType = this.model.linkSelected; |
||||
const linkList: LinkType[] = this.model.linkList; |
||||
const that = this; |
||||
const {isEdit} = this.options; |
||||
|
||||
return { |
||||
type: Left, |
||||
height: 40, |
||||
cls: 'right-title', |
||||
items: [ |
||||
{ |
||||
type: Label, |
||||
cls: 'right-title-text', |
||||
text: `数据连接(${linkSelected.text ? linkSelected.text : '默认'})`, |
||||
}, |
||||
{ |
||||
type: Button, |
||||
cls:'right-title-button', |
||||
invisible: isEdit, |
||||
text: '编辑', |
||||
handler() { |
||||
that.store.setEdit(true); |
||||
}, |
||||
}, |
||||
{ |
||||
type: Button, |
||||
cls:'right-title-button', |
||||
invisible: !isEdit, |
||||
text: '保存', |
||||
handler() { |
||||
const result = BI.find(linkList, (idx: number, value: LinkType) => that.model.linkUpdate.connectionName === value.connectionName && value.connectionId !== that.model.linkUpdate.connectionId); |
||||
if (result) { |
||||
that.store.setConnectionNameErr('数据连接名已存在'); |
||||
} else { |
||||
that.store.saveLink(); |
||||
} |
||||
}, |
||||
}, |
||||
{ |
||||
type: Button, |
||||
cls:'right-title-button', |
||||
invisible: !isEdit, |
||||
level: 'ignore', |
||||
text: '取消', |
||||
handler() { |
||||
that.store.setCancel(); |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,31 +0,0 @@
|
||||
import {WidgetType, Vertical} from '@ui'; |
||||
import Model from './left.model'; |
||||
import {LinkType} from '@ui/type'; |
||||
import {getLinks} from './left.service'; |
||||
const className = 'fr.component.linkStatus.left'; |
||||
let leftContent: any = null; |
||||
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; |
||||
leftContent.populate(BI.createItems(getLinks(linkList, title))); |
||||
}, |
||||
}, |
||||
render() { |
||||
return { |
||||
type: Vertical, |
||||
ref(_ref: any) { |
||||
leftContent = _ref; |
||||
}, |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,39 +0,0 @@
|
||||
import {WidgetType, Left, Label} from '@ui'; |
||||
import Model from './left.model'; |
||||
const className = 'fr.component.linkStatus.left.item'; |
||||
const Widget: WidgetType = { |
||||
props: { |
||||
title:'', |
||||
id:'', |
||||
creator: '', |
||||
}, |
||||
_store() { |
||||
return BI.Models.getModel(Model); |
||||
}, |
||||
render() { |
||||
const {title, extraCls, creator, text, id} = this.options; |
||||
|
||||
return { |
||||
type: Left, |
||||
cls: 'left-item', |
||||
extraCls, |
||||
items: [ |
||||
{ |
||||
type: Label, |
||||
cls:'link-title', |
||||
textAlign: 'left', |
||||
text: title, |
||||
title, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {title} = this.options; |
||||
this.element.on('click', () => { |
||||
this.store.setStatusSelected(title); |
||||
}); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,18 +0,0 @@
|
||||
import {LinkType} from '@ui/type'; |
||||
import LeftItem from './left.item.component'; |
||||
|
||||
export const getLinks = (linkList: LinkType[], selectTitle = ''): any => { |
||||
const links: any[] = []; |
||||
linkList.forEach((item: LinkType) => { |
||||
links.push({ |
||||
type: LeftItem, |
||||
extraCls: item.connectionName === selectTitle ? 'left-item-selected' : '', |
||||
title: item.connectionName, |
||||
id: item.connectionId, |
||||
creator: item.creator, |
||||
text: item.text ? item.text : '默认', |
||||
}); |
||||
}); |
||||
|
||||
return links; |
||||
}; |
@ -1,10 +1,10 @@
|
||||
import {ModelType} from '@ui'; |
||||
const className = 'fr.model.linkstatus.left'; |
||||
const className = 'dec.dcm.model.linkstatus.left'; |
||||
const Model: ModelType = { |
||||
context: ['tab', 'linkList', 'statusSelected'], |
||||
state () { |
||||
return { |
||||
selected:'', |
||||
selected: '', |
||||
}; |
||||
}, |
||||
actions: { |
@ -0,0 +1,44 @@
|
||||
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; |
@ -0,0 +1,39 @@
|
||||
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,5 +1,5 @@
|
||||
import {ModelType} from '@ui'; |
||||
const className = 'fr.model.linkstatus'; |
||||
const className = 'dec.dcm.model.linkstatus'; |
||||
const Model: ModelType = { |
||||
context: ['tab', 'linkList'], |
||||
actions: { |
@ -1,10 +1,10 @@
|
||||
import {ModelType} from '@ui'; |
||||
const className = 'fr.model.linkstatus.right'; |
||||
const className = 'dec.dcm.model.linkstatus.right'; |
||||
const Model: ModelType = { |
||||
context: ['linkList', 'statusSelected'], |
||||
state () { |
||||
return { |
||||
selected:'', |
||||
selected: '', |
||||
}; |
||||
}, |
||||
actions: { |
@ -1,65 +1,68 @@
|
||||
import {WidgetType, Vertical, Left, Label} from '@ui/index'; |
||||
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.component'; |
||||
import RightCard from './right_card'; |
||||
import {InfoType} from './right.typings'; |
||||
import {LinkType} from '@ui/type'; |
||||
import pluginListConstant from '../../app.constant'; |
||||
|
||||
const className = 'fr.component.linkStatus.right'; |
||||
let Title: any = null; |
||||
let Group: any = null; |
||||
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:{ |
||||
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) => { |
||||
Group.populate(BI.createItems([{ |
||||
this.statusGroup.populate(BI.createItems([{ |
||||
type: Pool, |
||||
...res, |
||||
}])); |
||||
}); |
||||
Title.setText(`数据连接(${title})`); |
||||
this.statusTitle.setText(`${BI.i18nText('Dec-Dcm_Data_Connections')}(${title})`); |
||||
}, |
||||
}, |
||||
render() { |
||||
return { |
||||
type:Vertical, |
||||
cls:'database-right', |
||||
items:[ |
||||
type: Vtape, |
||||
items: [ |
||||
{ |
||||
type: Left, |
||||
height: 40, |
||||
cls: 'right-status-title', |
||||
items:[ |
||||
{ |
||||
type: Label, |
||||
text:'数据连接', |
||||
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; |
||||
}, |
||||
], |
||||
ref(ref: any) { |
||||
Title = ref; |
||||
}, |
||||
height: 40, |
||||
}, { |
||||
type: Vertical, |
||||
type: ListView, |
||||
cls: 'right-status-body', |
||||
ref(ref: any) { |
||||
Group = ref; |
||||
vgap: 10, |
||||
hgap: 10, |
||||
ref: _ref => { |
||||
this.statusGroup = _ref; |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
|
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -0,0 +1,9 @@
|
||||
@import '../../../less/index.less'; |
||||
.dec-webui-dcm-status-right-card{ |
||||
.card-font-success{ |
||||
font-size: @font-size-30; |
||||
} |
||||
.card-font-heighlight{ |
||||
font-size: @font-size-30; |
||||
} |
||||
} |
@ -1,88 +1,86 @@
|
||||
import {WidgetType, Left, Label, Vertical} from '@ui/index'; |
||||
const className = 'fr.component.linkStatus.right.card'; |
||||
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: Left, |
||||
type: FloatCenter, |
||||
height: 150, |
||||
hgap: 20, |
||||
items: [ |
||||
{ |
||||
type: Left, |
||||
cls: 'right-status-item', |
||||
type: Vertical, |
||||
cls: 'bi-background', |
||||
items: [ |
||||
{ |
||||
type: Vertical, |
||||
cls:'right-status-board', |
||||
type: CenterAdapt, |
||||
cls: 'right-status-board-item', |
||||
tgap: 40, |
||||
items: [ |
||||
{ |
||||
type: Vertical, |
||||
cls:'right-status-board-item', |
||||
type: VerticalAdapt, |
||||
items: [ |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
extraCls: 'card-font1', |
||||
cls: 'bi-high-light card-font-success', |
||||
text: numActive, |
||||
}, |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
text: '/', |
||||
}, |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
text: maxActive, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
type: Label, |
||||
height: 20, |
||||
text: '活动连接数', |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
type: Label, |
||||
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'), |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
type: Left, |
||||
cls: 'right-status-right', |
||||
type: Vertical, |
||||
cls: 'bi-background', |
||||
items: [ |
||||
{ |
||||
type: Vertical, |
||||
cls:'right-status-board', |
||||
type: CenterAdapt, |
||||
tgap: 40, |
||||
cls: 'right-status-board-item', |
||||
items: [ |
||||
{ |
||||
type: Vertical, |
||||
cls:'right-status-board-item', |
||||
type: VerticalAdapt, |
||||
items: [ |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
extraCls: 'card-font2', |
||||
cls: 'bi-high-light card-font-heighlight', |
||||
text: numIdle, |
||||
}, |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
text: '/', |
||||
}, |
||||
{ |
||||
type: Label, |
||||
cls: 'right-status-text', |
||||
text: maxIdle, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
type: Label, |
||||
height: 20, |
||||
text: '空闲连接数', |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
type: Label, |
||||
text: BI.i18nText('Dec-Dcm_Leisure_Connections_Number'), |
||||
}, |
||||
], |
||||
}, |
||||
], |
@ -1,40 +0,0 @@
|
||||
import {Left, WidgetType, IconButton} from '@ui/index'; |
||||
import TitleItem from './title_item/title_item.component'; |
||||
import {isDesigner, closeWindow} from '@shared/crud/crud.request'; |
||||
const tabs = ['数据连接管理', '连接池状态']; |
||||
const className = 'fr.title'; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
return { |
||||
type: Left, |
||||
cls: 'title', |
||||
items: [ |
||||
...BI.map(tabs, (index: number, text: string) => { |
||||
return { |
||||
type: TitleItem, |
||||
text, |
||||
}; |
||||
}), |
||||
{ |
||||
type:IconButton, |
||||
cls:'close-button', |
||||
handler() { |
||||
closeWindow(); |
||||
}, |
||||
invisible: true, |
||||
ref: _ref => { |
||||
this.CloseButton = _ref; |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
if (isDesigner()) { |
||||
this.CloseButton.setVisible(true); |
||||
} |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
|
||||
export default className; |
@ -0,0 +1,8 @@
|
||||
@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,4 +1,4 @@
|
||||
const className = 'fr.model.title.item'; |
||||
const className = 'dec.dcm.model.title.item'; |
||||
const Model = BI.inherit(Fix.Model, { |
||||
context: ['tab'], |
||||
actions: { |
@ -0,0 +1,61 @@
|
||||
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,37 +0,0 @@
|
||||
import {Label} from '@ui'; |
||||
import tableItemModel from './title_item.model'; |
||||
import {getSelectStyle} from './title_item.service'; |
||||
const className = 'fr.title.item'; |
||||
const Widget = BI.inherit(BI.Widget, { |
||||
props: { |
||||
text:'', |
||||
}, |
||||
_store() { |
||||
return BI.Models.getModel(tableItemModel); |
||||
}, |
||||
watch:{ |
||||
tab(tab: string) { |
||||
const {text} = this.options; |
||||
this.element.css(getSelectStyle(text, tab)); |
||||
}, |
||||
}, |
||||
render() { |
||||
const {text} = this.options; |
||||
|
||||
return { |
||||
type: Label, |
||||
cls: 'title-item', |
||||
text, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {text} = this.options; |
||||
this.element.css(getSelectStyle('数据连接管理', text)); |
||||
this.element.on('click', () => { |
||||
this.store.setTab(text); |
||||
}); |
||||
}, |
||||
}); |
||||
BI.shortcut(className, Widget); |
||||
|
||||
export default className; |
@ -1,13 +0,0 @@
|
||||
export function getSelectStyle(status: string, nowStatus: string): any { |
||||
if (status === nowStatus) { |
||||
return { |
||||
color: '#3685f2', |
||||
'border-bottom': 'solid 2px #3685f2', |
||||
}; |
||||
} |
||||
|
||||
return { |
||||
color: '#3d4d66', |
||||
'border-bottom': 'none', |
||||
}; |
||||
} |
@ -0,0 +1,4 @@
|
||||
@import "lib/background"; |
||||
@import "lib/color"; |
||||
@import "resource/background"; |
||||
@import "resource/font"; |
@ -0,0 +1,6 @@
|
||||
@background-resources: "resources.png"; |
||||
@background-warning: "warning.png"; |
||||
@background-database-selected: "database-selected.png"; |
||||
@background-loading-gif: "loading.gif"; |
||||
@background-success: "success.png"; |
||||
@background-error: "error.png"; |
@ -0,0 +1,2 @@
|
||||
@import "../../../node_modules/fineui/src/less/lib/colors"; |
||||
@background-color-blue-transparent: @color-bi-blue-5; |
@ -0,0 +1,4 @@
|
||||
@font-link: "e759"; |
||||
@font-link-test: "e763"; |
||||
@font-link-info: "e63c"; |
||||
@font-link-delete: "e6c4"; |
@ -0,0 +1,23 @@
|
||||
@import "../lib/background"; |
||||
@import "../var"; |
||||
|
||||
.data-connection-background { |
||||
.image2xPath(@background-resources) |
||||
} |
||||
|
||||
.dcm-comfirm-icon{ |
||||
.image2xPath(@background-warning) |
||||
} |
||||
.dcm-link-more-selected{ |
||||
.image2xPath(@background-database-selected) |
||||
} |
||||
|
||||
.dcm-loading-icon{ |
||||
.image2xPath(@background-loading-gif) |
||||
} |
||||
.dcm-success-icon{ |
||||
.image2xPath(@background-success) |
||||
} |
||||
.dcm-error-icon{ |
||||
.image2xPath(@background-error) |
||||
} |
@ -0,0 +1,7 @@
|
||||
@import "../../../node_modules/fineui/src/less/image.less"; |
||||
@import "../lib/font.less"; |
||||
|
||||
.font(dcm-link-font, @font-link); |
||||
.font(dcm-info-font, @font-link-info); |
||||
.font(dcm-test-font, @font-link-test); |
||||
.font(dcm-delete-font, @font-link-delete); |
@ -0,0 +1,4 @@
|
||||
@import "../../node_modules/fineui/src/less/var"; |
||||
@import '../../node_modules/fineui/src/less/visual.less'; |
||||
@imageUrl: '/img/'; |
||||
@image2xUrl: '/img/'; |
@ -1,17 +1,18 @@
|
||||
import {WidgetType, Htape, Label} from '@ui/index'; |
||||
const BothSide = 'fr.shared.component.both.side'; |
||||
const BothSide = 'dec.dcm.shared.component.both.side'; |
||||
const Widget: WidgetType = { |
||||
props: { |
||||
height: 24, |
||||
}, |
||||
render() { |
||||
const {leftText, rightText} = this.options; |
||||
|
||||
return { |
||||
type: Htape, |
||||
cls: 'both-side', |
||||
height:24, |
||||
items: [{ |
||||
el: { |
||||
type: Label, |
||||
cls: 'left', |
||||
cls: 'bi-font-bold', |
||||
textAlign: 'left', |
||||
text: leftText, |
||||
}, |
@ -1,29 +0,0 @@
|
||||
import {WidgetType, Htape, Label} from '@ui/index'; |
||||
const className = 'fr.shared.component.form.item'; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
const {text, form, hint, height} = this.options; |
||||
|
||||
return { |
||||
type: Htape, |
||||
cls: 'both-side', |
||||
height:height ? height : 24, |
||||
items: [{ |
||||
el: { |
||||
type: Label, |
||||
cls: 'left', |
||||
textAlign: 'left', |
||||
text, |
||||
}, |
||||
width: 115, |
||||
}, form, { |
||||
type: Label, |
||||
cls: 'hint', |
||||
textAlign: 'left', |
||||
text: hint, |
||||
}], |
||||
}; |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -1,12 +1,16 @@
|
||||
import {WidgetType, Label} from '@ui/index'; |
||||
const className = 'fr.shared.component.title'; |
||||
const className = 'dec.dcm.shared.component.title'; |
||||
const Widget: WidgetType = { |
||||
props: { |
||||
baseCls: 'bi-tips bi-border-bottom', |
||||
}, |
||||
render() { |
||||
const {text} = this.options; |
||||
|
||||
return { |
||||
type: Label, |
||||
cls: 'shared-component-title', |
||||
height: 24, |
||||
bgap: 10, |
||||
textAlign: 'left', |
||||
text, |
||||
}; |
Loading…
Reference in new issue