|
|
@ -27,6 +27,9 @@ export function getPluginWidgetEdit(plugin: string) { |
|
|
|
|
|
|
|
|
|
|
|
// 由于database可能为空,所以为了兼容平台和设计器,需要根据driver来判断数据库类型
|
|
|
|
// 由于database可能为空,所以为了兼容平台和设计器,需要根据driver来判断数据库类型
|
|
|
|
export function getJdbcDatabaseType(database: string, driver: string): DatabaseType { |
|
|
|
export function getJdbcDatabaseType(database: string, driver: string): DatabaseType { |
|
|
|
|
|
|
|
if (!database && !driver) { |
|
|
|
|
|
|
|
return DATA_BASE_TYPES_OTHER; |
|
|
|
|
|
|
|
} |
|
|
|
let databaseType = null; |
|
|
|
let databaseType = null; |
|
|
|
// KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型
|
|
|
|
// KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型
|
|
|
|
// DEC-10872 不能过滤other,因为新版数据连接创建的其他jdbc也是other类型,会混淆,需要和后端讨论一个最佳的解决方案。
|
|
|
|
// DEC-10872 不能过滤other,因为新版数据连接创建的其他jdbc也是other类型,会混淆,需要和后端讨论一个最佳的解决方案。
|
|
|
@ -56,7 +59,7 @@ export function resolveUrlInfo (url: string) { |
|
|
|
urlInfo: greenplumUrl[9], |
|
|
|
urlInfo: greenplumUrl[9], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
const result = url.match(/^jdbc:(oracle|mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/|;DatabaseName=)([^]+)(.*)/i); |
|
|
|
const result = url.match(/^jdbc:(oracle|mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/|;DatabaseName=)([^\\?]+)(.*)/i); |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
host: result[5], |
|
|
|
host: result[5], |
|
|
|