|
|
|
@ -92,13 +92,13 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理SAP HANA数据连接url
|
|
|
|
|
const sapHanaUrl = url.match(/^jdbc:(sap):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?([^]+)?(.*)/i); |
|
|
|
|
const sapHanaUrl = url.match(/^jdbc:(sap):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\?databaseName=)?([^&]+)([^]+)?(.*)/i); |
|
|
|
|
if (sapHanaUrl) { |
|
|
|
|
return { |
|
|
|
|
host: sapHanaUrl[5], |
|
|
|
|
port: sapHanaUrl[7] === 'port' ? '' : sapHanaUrl[7], |
|
|
|
|
databaseName: '', |
|
|
|
|
urlInfo: sapHanaUrl[9], |
|
|
|
|
databaseName: sapHanaUrl[9] || '', |
|
|
|
|
urlInfo: sapHanaUrl[10], |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -135,6 +135,16 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function filterPluginDataTypeByPriority() { |
|
|
|
|
const originTypes = [...BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES)]; |
|
|
|
|
const sortDataTypes = BI.sortBy(originTypes, (index, value: any) => { |
|
|
|
|
return value.priority || 0; |
|
|
|
|
}) |
|
|
|
|
return BI.uniqWith(sortDataTypes, (current, other) => { |
|
|
|
|
return current.text == other.text; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.registerDatabaseType = (config: any) => { |
|
|
|
|
if (coverBaseDatabase(config)) return; |
|
|
|
|
|
|
|
|
@ -162,6 +172,6 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
} |
|
|
|
|
return this.resolves[type] || jdbcResolve |
|
|
|
|
}, |
|
|
|
|
customDatabaseType: BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES), |
|
|
|
|
customDatabaseType: filterPluginDataTypeByPriority(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|