diff --git a/datax-admin/pom.xml b/datax-admin/pom.xml
index b2dbf255d..e033370ff 100644
--- a/datax-admin/pom.xml
+++ b/datax-admin/pom.xml
@@ -195,6 +195,14 @@
${mysql-connector.version}
+
+ com.dameng
+ Dm8JdbcDriver18
+ 8.1.1.193
+ system
+ ${basedir}/src/main/lib/DmJdbcDriver18-8.1.1.193.jar
+
+
com.wugui
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/DataxJsonHelper.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/DataxJsonHelper.java
index dd121016d..7e5105da9 100644
--- a/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/DataxJsonHelper.java
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/DataxJsonHelper.java
@@ -127,9 +127,13 @@ public void initReader(DataXJsonBuildDto dataxJsonDto, JobDatasource readerDatas
} else if (MONGODB.equals(datasource)) {
readerPlugin = new MongoDBReader();
buildReader = buildMongoDBReader();
+ } else if (DM.equals(datasource)) {
+ readerPlugin = new RdbmsReader();
+ buildReader = buildReader();
}
}
+
public void initWriter(DataXJsonBuildDto dataxJsonDto, JobDatasource readerDatasource) {
this.writerDatasource = readerDatasource;
this.writerTables = dataxJsonDto.getWriterTables();
@@ -165,6 +169,9 @@ public void initWriter(DataXJsonBuildDto dataxJsonDto, JobDatasource readerDatas
} else if (JdbcConstants.MONGODB.equals(datasource)) {
writerPlugin = new MongoDBWriter();
buildWriter = this.buildMongoDBWriter();
+ } else if (DM.equals(datasource)) {
+ writerPlugin = new RdbmsWriter();
+ buildWriter = this.buildWriter();
}
}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/reader/RdbmsReader.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/reader/RdbmsReader.java
new file mode 100644
index 000000000..d984eb706
--- /dev/null
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/reader/RdbmsReader.java
@@ -0,0 +1,24 @@
+package com.wugui.datax.admin.tool.datax.reader;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ *
+ * rdbms 构建类
+ *
+ *
+ * @author Listenabe
+ * @since 2024/06/02
+ */
+public class RdbmsReader extends BaseReaderPlugin implements DataxReaderInterface{
+ @Override
+ public String getName() {
+ return "rdbmsreader";
+ }
+
+ @Override
+ public Map sample() {
+ return Collections.emptyMap();
+ }
+}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/writer/RdbmsWriter.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/writer/RdbmsWriter.java
new file mode 100644
index 000000000..0653ca91f
--- /dev/null
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/datax/writer/RdbmsWriter.java
@@ -0,0 +1,24 @@
+package com.wugui.datax.admin.tool.datax.writer;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ *
+ * rdbms构建类
+ *
+ *
+ * @author Listenabe
+ * @since 2024/06/02
+ */
+public class RdbmsWriter extends BaseWriterPlugin implements DataxWriterInterface{
+ @Override
+ public String getName() {
+ return "rdbmswriter";
+ }
+
+ @Override
+ public Map sample() {
+ return Collections.emptyMap();
+ }
+}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DatabaseMetaFactory.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DatabaseMetaFactory.java
index 905856079..af0ec3d3e 100644
--- a/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DatabaseMetaFactory.java
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DatabaseMetaFactory.java
@@ -28,6 +28,8 @@ public static DatabaseInterface getByDbType(String dbType) {
return ClickHouseDataBaseMeta.getInstance();
} else if(JdbcConstants.HBASE20XSQL.equals(dbType)) {
return Hbase20xsqlMeta.getInstance();
+ }else if(JdbcConstants.DM.equals(dbType)) {
+ return DmDatabaseMeta.getInstance();
} else {
throw new UnsupportedOperationException("暂不支持的类型:".concat(dbType));
}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DmDatabaseMeta.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DmDatabaseMeta.java
new file mode 100644
index 000000000..b83d01e84
--- /dev/null
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/meta/DmDatabaseMeta.java
@@ -0,0 +1,56 @@
+package com.wugui.datax.admin.tool.meta;
+
+import cn.hutool.core.util.StrUtil;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ *
+ * dm数据库meta信息查询
+ *
+ *
+ * @author Listenabe
+ * @since 2024/06/02
+ */
+public class DmDatabaseMeta extends BaseDatabaseMeta implements DatabaseInterface{
+
+ private volatile static DmDatabaseMeta single;
+
+ public static DmDatabaseMeta getInstance() {
+ if (single == null) {
+ synchronized (DmDatabaseMeta.class) {
+ if (single == null) {
+ single = new DmDatabaseMeta();
+ }
+ }
+ }
+ return single;
+ }
+
+ /**
+ * 根据条件返回表字段注释
+ * @param schemaName schemaName
+ * @param tableName 达梦数据库目前返回的是schema.tableName, 所以需要截取tableName
+ * @param columnName 表字段名
+ * @return
+ */
+ @Override
+ public String getSQLQueryComment(String schemaName, String tableName, String columnName) {
+ tableName = StringUtils.substringAfterLast(tableName, StrUtil.DOT).replace("\"", "");
+ return String.format("SELECT comments FROM USER_COL_COMMENTS where OWNER = '%s' and TABLE_NAME = '%s' and COLUMN_NAME = '%s'", schemaName, tableName, columnName);
+ }
+
+ public static void main(String[] args) {
+ String tableName = "TEST_SYNC.aaaa.TEST_USER";
+ System.out.println(StringUtils.substringAfterLast(tableName, StrUtil.DOT).replace("\"", ""));
+ }
+
+ @Override
+ public String getSQLQueryTables() {
+ return "select CONCAT(OWNER, '.\"', table_name, '\"') from all_tables";
+ }
+
+ @Override
+ public String getSQLQueryTables(String... tableSchema) {
+ return "select CONCAT(OWNER, '.\"', table_name, '\"') from all_tables where OWNER = '%s'";
+ }
+}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/DmQueryTool.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/DmQueryTool.java
new file mode 100644
index 000000000..ab3c58e17
--- /dev/null
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/DmQueryTool.java
@@ -0,0 +1,23 @@
+package com.wugui.datax.admin.tool.query;
+
+
+import com.wugui.datax.admin.entity.JobDatasource;
+
+import java.sql.SQLException;
+
+
+/**
+ *
+ * 达梦数据库使用的查询工具
+ *
+ *
+ * @author Listenabe
+ * @since 2024/06/02
+ */
+public class DmQueryTool extends BaseQueryTool implements QueryToolInterface {
+
+
+ DmQueryTool(JobDatasource jobDatasource) throws SQLException {
+ super(jobDatasource);
+ }
+}
diff --git a/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/QueryToolFactory.java b/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/QueryToolFactory.java
index 2e9b1d1cd..763f92112 100644
--- a/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/QueryToolFactory.java
+++ b/datax-admin/src/main/java/com/wugui/datax/admin/tool/query/QueryToolFactory.java
@@ -33,6 +33,8 @@ public static BaseQueryTool getByDbType(JobDatasource jobDatasource) {
return getClickHouseQueryToolInstance(jobDatasource);
}else if (JdbcConstants.HBASE20XSQL.equals(datasource)) {
return getHbase20XsqlQueryToolQueryToolInstance(jobDatasource);
+ } else if (JdbcConstants.DM.equals(datasource)) {
+ return getDmQueryToolInstance(jobDatasource);
}
throw new UnsupportedOperationException("找不到该类型: ".concat(datasource));
}
@@ -73,6 +75,15 @@ private static BaseQueryTool getSqlserverQueryToolInstance(JobDatasource jdbcDat
}
}
+ private static BaseQueryTool getDmQueryToolInstance(JobDatasource jdbcDatasource) {
+ try {
+ return new DmQueryTool(jdbcDatasource);
+ } catch (SQLException e) {
+ throw RdbmsException.asConnException(JdbcConstants.DM,
+ e,jdbcDatasource.getJdbcUsername(),jdbcDatasource.getDatasourceName());
+ }
+ }
+
private static BaseQueryTool getHiveQueryToolInstance(JobDatasource jdbcDatasource) {
try {
return new HiveQueryTool(jdbcDatasource);
diff --git a/datax-admin/src/main/lib/DmJdbcDriver18-8.1.1.193.jar b/datax-admin/src/main/lib/DmJdbcDriver18-8.1.1.193.jar
new file mode 100644
index 000000000..97bceb412
Binary files /dev/null and b/datax-admin/src/main/lib/DmJdbcDriver18-8.1.1.193.jar differ
diff --git a/datax-admin/src/main/resources/static/static/js/chunk-60797987.7c6e2fb0.js b/datax-admin/src/main/resources/static/static/js/chunk-60797987.7c6e2fb0.js
index fe2a3b3ad..7412031ad 100644
--- a/datax-admin/src/main/resources/static/static/js/chunk-60797987.7c6e2fb0.js
+++ b/datax-admin/src/main/resources/static/static/js/chunk-60797987.7c6e2fb0.js
@@ -1 +1 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60797987"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),Math.easeInOutQuad=function(e,t,a,s){return e/=s/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var s=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function i(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,a){var l=i(),o=e-l,n=20,c=0;t="undefined"===typeof t?500:t;var d=function e(){c+=n;var i=Math.easeInOutQuad(c,l,o,t);r(i),c0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),a("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"800px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"100px"}},[a("el-form-item",{attrs:{label:"数据源",prop:"datasource"}},[a("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"数据源"},on:{change:function(t){return e.selectDataSource(e.temp.datasource)}},model:{value:e.temp.datasource,callback:function(t){e.$set(e.temp,"datasource",t)},expression:"temp.datasource"}},e._l(e.dataSources,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"数据源名称",prop:"datasourceName"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"数据源名称"},model:{value:e.temp.datasourceName,callback:function(t){e.$set(e.temp,"datasourceName",t)},expression:"temp.datasourceName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"数据源分组",prop:"datasourceGroup"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"数据源分组"},model:{value:e.temp.datasourceGroup,callback:function(t){e.$set(e.temp,"datasourceGroup",t)},expression:"temp.datasourceGroup"}})],1),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"用户名"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"用户名"},model:{value:e.temp.jdbcUsername,callback:function(t){e.$set(e.temp,"jdbcUsername",t)},expression:"temp.jdbcUsername"}})],1):e._e(),e._v(" "),e.visible?a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.jdbc,expression:"jdbc"}],attrs:{label:"密码"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{type:"password",placeholder:"密码"},model:{value:e.temp.jdbcPassword,callback:function(t){e.$set(e.temp,"jdbcPassword",t)},expression:"temp.jdbcPassword"}},[a("i",{staticClass:"el-icon-view",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix",title:"显示密码"},on:{click:function(t){return e.changePass("show")}},slot:"suffix"})])],1):a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.jdbc,expression:"jdbc"}],attrs:{label:"密码"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{type:"text",placeholder:"密码"},model:{value:e.temp.jdbcPassword,callback:function(t){e.$set(e.temp,"jdbcPassword",t)},expression:"temp.jdbcPassword"}},[a("i",{staticClass:"el-icon-check",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix",title:"隐藏密码"},on:{click:function(t){return e.changePass("hide")}},slot:"suffix"})])],1),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"jdbc url",prop:"jdbcUrl"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"jdbc url"},model:{value:e.temp.jdbcUrl,callback:function(t){e.$set(e.temp,"jdbcUrl",t)},expression:"temp.jdbcUrl"}})],1):e._e(),e._v(" "),e.mongodb?a("el-form-item",{attrs:{label:"地址",prop:"jdbcUrl"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"127.0.0.1:27017"},model:{value:e.temp.jdbcUrl,callback:function(t){e.$set(e.temp,"jdbcUrl",t)},expression:"temp.jdbcUrl"}})],1):e._e(),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"jdbc驱动类",prop:"jdbcDriverClass"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"jdbc驱动类"},model:{value:e.temp.jdbcDriverClass,callback:function(t){e.$set(e.temp,"jdbcDriverClass",t)},expression:"temp.jdbcDriverClass"}})],1):e._e(),e._v(" "),e.hbase?a("el-form-item",{attrs:{label:"ZK地址",prop:"zkAdress"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"127.0.0.1:2181"},model:{value:e.temp.zkAdress,callback:function(t){e.$set(e.temp,"zkAdress",t)},expression:"temp.zkAdress"}})],1):e._e(),e._v(" "),e.mongodb?a("el-form-item",{attrs:{label:"数据库名称",prop:"databaseName"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"数据库名称"},model:{value:e.temp.databaseName,callback:function(t){e.$set(e.temp,"databaseName",t)},expression:"temp.databaseName"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"注释"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"Please input"},model:{value:e.temp.comments,callback:function(t){e.$set(e.temp,"comments",t)},expression:"temp.comments"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.testDataSource()}}},[e._v("\n 测试连接\n ")])],1)],1),e._v(" "),a("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},r=[],i=a("7e39"),l=a("6724"),o=a("ed08"),n=a("333d"),c={name:"JdbcDatasource",components:{Pagination:n["a"]},directives:{waves:l["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,dialogStatus:"",textMap:{update:"Edit",create:"Create"},rules:{datasourceName:[{required:!0,message:"this is required",trigger:"blur"}],jdbcUsername:[{required:!0,message:"this is required",trigger:"blur"}],jdbcPassword:[{required:!0,message:"this is required",trigger:"blur"}],jdbcUrl:[{required:!0,message:"this is required",trigger:"blur"}],jdbcDriverClass:[{required:!0,message:"this is required",trigger:"blur"}],datasource:[{required:!0,message:"this is required",trigger:"change"}],zkAdress:[{required:!0,message:"this is required",trigger:"blur"}],databaseName:[{required:!0,message:"this is required",trigger:"blur"}]},temp:{id:void 0,datasourceName:"",datasourceGroup:"Default",jdbcUsername:"",jdbcPassword:"",jdbcUrl:"",jdbcDriverClass:"",comments:"",datasource:"",zkAdress:"",databaseName:""},visible:!0,dataSources:[{value:"mysql",label:"mysql"},{value:"oracle",label:"oracle"},{value:"postgresql",label:"postgresql"},{value:"sqlserver",label:"sqlserver"},{value:"hive",label:"hive"},{value:"hbase",label:"hbase"},{value:"mongodb",label:"mongodb"},{value:"clickhouse",label:"clickhouse"}],jdbc:!0,hbase:!1,mongodb:!1}},created:function(){this.fetchData()},methods:{selectDataSource:function(e){"mysql"===e?(this.temp.jdbcUrl="jdbc:mysql://{host}:{port}/{database}",this.temp.jdbcDriverClass="com.mysql.jdbc.Driver"):"oracle"===e?(this.temp.jdbcUrl="jdbc:oracle:thin:@//{host}:{port}/{database}",this.temp.jdbcDriverClass="oracle.jdbc.OracleDriver"):"postgresql"===e?(this.temp.jdbcUrl="jdbc:postgresql://{host}:{port}/{database}",this.temp.jdbcDriverClass="org.postgresql.Driver"):"sqlserver"===e?(this.temp.jdbcUrl="jdbc:sqlserver://{host}:{port};DatabaseName={database}",this.temp.jdbcDriverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"):"clickhouse"===e?(this.temp.jdbcUrl="jdbc:clickhouse://{host}:{port}/{database}",this.temp.jdbcDriverClass="ru.yandex.clickhouse.ClickHouseDriver"):"hive"===e&&(this.temp.jdbcUrl="jdbc:hive2://{host}:{port}/{database}",this.temp.jdbcDriverClass="org.apache.hive.jdbc.HiveDriver",this.hbase=this.mongodb=!1,this.jdbc=!0),this.getShowStrategy(e)},fetchData:function(){var e=this;this.listLoading=!0,i["e"](this.listQuery).then((function(t){var a=t.records,s=t.total;e.total=s,e.list=a,e.listLoading=!1}))},resetTemp:function(){this.temp={id:void 0,datasourceName:"",datasourceGroup:"Default",jdbcUsername:"",jdbcPassword:"",jdbcUrl:"",jdbcDriverClass:"",comments:""}},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&i["a"](e.temp).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Created Successfully",type:"success",duration:2e3})}))}))},testDataSource:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&i["f"](e.temp).then((function(t){!1===t.data?e.$notify({title:"Fail",message:t.data.msg,type:"fail",duration:2e3}):e.$notify({title:"Success",message:"Tested Successfully",type:"success",duration:2e3})}))}))},handleUpdate:function(e){var t=this;this.getShowStrategy(e.datasource),this.temp=Object.assign({},e),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var a=Object.assign({},e.temp);i["g"](a).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Update Successfully",type:"success",duration:2e3})}))}}))},getShowStrategy:function(e){"hbase"===e?(this.jdbc=this.mongodb=!1,this.hbase=!0):"mongodb"===e?(this.jdbc=this.hbase=!1,this.mongodb=!0,this.temp.jdbcUrl="mongodb://[username:password@]host1[:port1][,...hostN[:portN]]][/[database][?options]]"):(this.hbase=this.mongodb=!1,this.jdbc=!0)},handleDelete:function(e){var t=this;console.log("删除");var a=[];a.push(e.id),i["b"]({idList:e.id}).then((function(e){t.fetchData(),t.$notify({title:"Success",message:"Delete Successfully",type:"success",duration:2e3})}))},handleFetchPv:function(e){var t=this;i["c"](e).then((function(e){t.pluginData=e,t.dialogPvVisible=!0}))},formatJson:function(e,t){return t.map((function(t){return e.map((function(e){return"timestamp"===e?Object(o["f"])(t[e]):t[e]}))}))},changePass:function(e){this.visible=!("show"===e)}}},d=c,u=a("2877"),m=Object(u["a"])(d,s,r,!1,null,null,null);t["default"]=m.exports},6724:function(e,t,a){"use strict";a("8d41");var s="@@wavesContext";function r(e,t){function a(a){var s=Object.assign({},t.value),r=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},s),i=r.ele;if(i){i.style.position="relative",i.style.overflow="hidden";var l=i.getBoundingClientRect(),o=i.querySelector(".waves-ripple");switch(o?o.className="waves-ripple":(o=document.createElement("span"),o.className="waves-ripple",o.style.height=o.style.width=Math.max(l.width,l.height)+"px",i.appendChild(o)),r.type){case"center":o.style.top=l.height/2-o.offsetHeight/2+"px",o.style.left=l.width/2-o.offsetWidth/2+"px";break;default:o.style.top=(a.pageY-l.top-o.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",o.style.left=(a.pageX-l.left-o.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return o.style.backgroundColor=r.color,o.className="waves-ripple z-active",!1}}return e[s]?e[s].removeHandle=a:e[s]={removeHandle:a},a}var i={bind:function(e,t){e.addEventListener("click",r(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[s].removeHandle,!1),e.addEventListener("click",r(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[s].removeHandle,!1),e[s]=null,delete e[s]}},l=function(e){e.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(l)),i.install=l;t["a"]=i},"7e39":function(e,t,a){"use strict";a.d(t,"e",(function(){return r})),a.d(t,"c",(function(){return i})),a.d(t,"g",(function(){return l})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return n})),a.d(t,"f",(function(){return c})),a.d(t,"d",(function(){return d}));var s=a("b775");function r(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"get",params:e})}function i(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/"+e,method:"get"})}function l(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"put",data:e})}function o(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"post",data:e})}function n(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"delete",params:e})}function c(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/test",method:"post",data:e})}function d(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/all",method:"get",params:e})}},"8d41":function(e,t,a){}}]);
\ No newline at end of file
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60797987"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),Math.easeInOutQuad=function(e,t,a,s){return e/=s/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var s=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function i(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,a){var l=i(),o=e-l,n=20,c=0;t="undefined"===typeof t?500:t;var d=function e(){c+=n;var i=Math.easeInOutQuad(c,l,o,t);r(i),c0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),a("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"800px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"100px"}},[a("el-form-item",{attrs:{label:"数据源",prop:"datasource"}},[a("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"数据源"},on:{change:function(t){return e.selectDataSource(e.temp.datasource)}},model:{value:e.temp.datasource,callback:function(t){e.$set(e.temp,"datasource",t)},expression:"temp.datasource"}},e._l(e.dataSources,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"数据源名称",prop:"datasourceName"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"数据源名称"},model:{value:e.temp.datasourceName,callback:function(t){e.$set(e.temp,"datasourceName",t)},expression:"temp.datasourceName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"数据源分组",prop:"datasourceGroup"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"数据源分组"},model:{value:e.temp.datasourceGroup,callback:function(t){e.$set(e.temp,"datasourceGroup",t)},expression:"temp.datasourceGroup"}})],1),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"用户名"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"用户名"},model:{value:e.temp.jdbcUsername,callback:function(t){e.$set(e.temp,"jdbcUsername",t)},expression:"temp.jdbcUsername"}})],1):e._e(),e._v(" "),e.visible?a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.jdbc,expression:"jdbc"}],attrs:{label:"密码"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{type:"password",placeholder:"密码"},model:{value:e.temp.jdbcPassword,callback:function(t){e.$set(e.temp,"jdbcPassword",t)},expression:"temp.jdbcPassword"}},[a("i",{staticClass:"el-icon-view",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix",title:"显示密码"},on:{click:function(t){return e.changePass("show")}},slot:"suffix"})])],1):a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.jdbc,expression:"jdbc"}],attrs:{label:"密码"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{type:"text",placeholder:"密码"},model:{value:e.temp.jdbcPassword,callback:function(t){e.$set(e.temp,"jdbcPassword",t)},expression:"temp.jdbcPassword"}},[a("i",{staticClass:"el-icon-check",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix",title:"隐藏密码"},on:{click:function(t){return e.changePass("hide")}},slot:"suffix"})])],1),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"jdbc url",prop:"jdbcUrl"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"jdbc url"},model:{value:e.temp.jdbcUrl,callback:function(t){e.$set(e.temp,"jdbcUrl",t)},expression:"temp.jdbcUrl"}})],1):e._e(),e._v(" "),e.mongodb?a("el-form-item",{attrs:{label:"地址",prop:"jdbcUrl"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"127.0.0.1:27017"},model:{value:e.temp.jdbcUrl,callback:function(t){e.$set(e.temp,"jdbcUrl",t)},expression:"temp.jdbcUrl"}})],1):e._e(),e._v(" "),e.jdbc?a("el-form-item",{attrs:{label:"jdbc驱动类",prop:"jdbcDriverClass"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"jdbc驱动类"},model:{value:e.temp.jdbcDriverClass,callback:function(t){e.$set(e.temp,"jdbcDriverClass",t)},expression:"temp.jdbcDriverClass"}})],1):e._e(),e._v(" "),e.hbase?a("el-form-item",{attrs:{label:"ZK地址",prop:"zkAdress"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"127.0.0.1:2181"},model:{value:e.temp.zkAdress,callback:function(t){e.$set(e.temp,"zkAdress",t)},expression:"temp.zkAdress"}})],1):e._e(),e._v(" "),e.mongodb?a("el-form-item",{attrs:{label:"数据库名称",prop:"databaseName"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{placeholder:"数据库名称"},model:{value:e.temp.databaseName,callback:function(t){e.$set(e.temp,"databaseName",t)},expression:"temp.databaseName"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"注释"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"Please input"},model:{value:e.temp.comments,callback:function(t){e.$set(e.temp,"comments",t)},expression:"temp.comments"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.testDataSource()}}},[e._v("\n 测试连接\n ")])],1)],1),e._v(" "),a("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},r=[],i=a("7e39"),l=a("6724"),o=a("ed08"),n=a("333d"),c={name:"JdbcDatasource",components:{Pagination:n["a"]},directives:{waves:l["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,dialogStatus:"",textMap:{update:"Edit",create:"Create"},rules:{datasourceName:[{required:!0,message:"this is required",trigger:"blur"}],jdbcUsername:[{required:!0,message:"this is required",trigger:"blur"}],jdbcPassword:[{required:!0,message:"this is required",trigger:"blur"}],jdbcUrl:[{required:!0,message:"this is required",trigger:"blur"}],jdbcDriverClass:[{required:!0,message:"this is required",trigger:"blur"}],datasource:[{required:!0,message:"this is required",trigger:"change"}],zkAdress:[{required:!0,message:"this is required",trigger:"blur"}],databaseName:[{required:!0,message:"this is required",trigger:"blur"}]},temp:{id:void 0,datasourceName:"",datasourceGroup:"Default",jdbcUsername:"",jdbcPassword:"",jdbcUrl:"",jdbcDriverClass:"",comments:"",datasource:"",zkAdress:"",databaseName:""},visible:!0,dataSources:[{value:"mysql",label:"mysql"},{value:"oracle",label:"oracle"},{value:"postgresql",label:"postgresql"},{value:"sqlserver",label:"sqlserver"},{value:"hive",label:"hive"},{value:"hbase",label:"hbase"},{value:"mongodb",label:"mongodb"},{value:"dm",label:"dm"},{value:"clickhouse",label:"clickhouse"}],jdbc:!0,hbase:!1,mongodb:!1}},created:function(){this.fetchData()},methods:{selectDataSource:function(e){"mysql"===e?(this.temp.jdbcUrl="jdbc:mysql://{host}:{port}/{database}",this.temp.jdbcDriverClass="com.mysql.jdbc.Driver"):"oracle"===e?(this.temp.jdbcUrl="jdbc:oracle:thin:@//{host}:{port}/{database}",this.temp.jdbcDriverClass="oracle.jdbc.OracleDriver"):"postgresql"===e?(this.temp.jdbcUrl="jdbc:postgresql://{host}:{port}/{database}",this.temp.jdbcDriverClass="org.postgresql.Driver"):"sqlserver"===e?(this.temp.jdbcUrl="jdbc:sqlserver://{host}:{port};DatabaseName={database}",this.temp.jdbcDriverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"):"clickhouse"===e?(this.temp.jdbcUrl="jdbc:clickhouse://{host}:{port}/{database}",this.temp.jdbcDriverClass="ru.yandex.clickhouse.ClickHouseDriver"):"hive"===e&&(this.temp.jdbcUrl="jdbc:hive2://{host}:{port}/{database}",this.temp.jdbcDriverClass="org.apache.hive.jdbc.HiveDriver",this.hbase=this.mongodb=!1,this.jdbc=!0),this.getShowStrategy(e)},fetchData:function(){var e=this;this.listLoading=!0,i["e"](this.listQuery).then((function(t){var a=t.records,s=t.total;e.total=s,e.list=a,e.listLoading=!1}))},resetTemp:function(){this.temp={id:void 0,datasourceName:"",datasourceGroup:"Default",jdbcUsername:"",jdbcPassword:"",jdbcUrl:"",jdbcDriverClass:"",comments:""}},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&i["a"](e.temp).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Created Successfully",type:"success",duration:2e3})}))}))},testDataSource:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&i["f"](e.temp).then((function(t){!1===t.data?e.$notify({title:"Fail",message:t.data.msg,type:"fail",duration:2e3}):e.$notify({title:"Success",message:"Tested Successfully",type:"success",duration:2e3})}))}))},handleUpdate:function(e){var t=this;this.getShowStrategy(e.datasource),this.temp=Object.assign({},e),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var a=Object.assign({},e.temp);i["g"](a).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Update Successfully",type:"success",duration:2e3})}))}}))},getShowStrategy:function(e){"hbase"===e?(this.jdbc=this.mongodb=!1,this.hbase=!0):"mongodb"===e?(this.jdbc=this.hbase=!1,this.mongodb=!0,this.temp.jdbcUrl="mongodb://[username:password@]host1[:port1][,...hostN[:portN]]][/[database][?options]]"):(this.hbase=this.mongodb=!1,this.jdbc=!0)},handleDelete:function(e){var t=this;console.log("删除");var a=[];a.push(e.id),i["b"]({idList:e.id}).then((function(e){t.fetchData(),t.$notify({title:"Success",message:"Delete Successfully",type:"success",duration:2e3})}))},handleFetchPv:function(e){var t=this;i["c"](e).then((function(e){t.pluginData=e,t.dialogPvVisible=!0}))},formatJson:function(e,t){return t.map((function(t){return e.map((function(e){return"timestamp"===e?Object(o["f"])(t[e]):t[e]}))}))},changePass:function(e){this.visible=!("show"===e)}}},d=c,u=a("2877"),m=Object(u["a"])(d,s,r,!1,null,null,null);t["default"]=m.exports},6724:function(e,t,a){"use strict";a("8d41");var s="@@wavesContext";function r(e,t){function a(a){var s=Object.assign({},t.value),r=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},s),i=r.ele;if(i){i.style.position="relative",i.style.overflow="hidden";var l=i.getBoundingClientRect(),o=i.querySelector(".waves-ripple");switch(o?o.className="waves-ripple":(o=document.createElement("span"),o.className="waves-ripple",o.style.height=o.style.width=Math.max(l.width,l.height)+"px",i.appendChild(o)),r.type){case"center":o.style.top=l.height/2-o.offsetHeight/2+"px",o.style.left=l.width/2-o.offsetWidth/2+"px";break;default:o.style.top=(a.pageY-l.top-o.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",o.style.left=(a.pageX-l.left-o.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return o.style.backgroundColor=r.color,o.className="waves-ripple z-active",!1}}return e[s]?e[s].removeHandle=a:e[s]={removeHandle:a},a}var i={bind:function(e,t){e.addEventListener("click",r(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[s].removeHandle,!1),e.addEventListener("click",r(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[s].removeHandle,!1),e[s]=null,delete e[s]}},l=function(e){e.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(l)),i.install=l;t["a"]=i},"7e39":function(e,t,a){"use strict";a.d(t,"e",(function(){return r})),a.d(t,"c",(function(){return i})),a.d(t,"g",(function(){return l})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return n})),a.d(t,"f",(function(){return c})),a.d(t,"d",(function(){return d}));var s=a("b775");function r(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"get",params:e})}function i(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/"+e,method:"get"})}function l(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"put",data:e})}function o(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"post",data:e})}function n(e){return Object(s["a"])({url:"/api/jobJdbcDatasource",method:"delete",params:e})}function c(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/test",method:"post",data:e})}function d(e){return Object(s["a"])({url:"/api/jobJdbcDatasource/all",method:"get",params:e})}},"8d41":function(e,t,a){}}]);
\ No newline at end of file