diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index c1b83e2..3662b4a 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -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; diff --git a/src/modules/app.ts b/src/modules/app.ts index d909040..46cd7b7 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -10,6 +10,7 @@ import { ConnectionPool } from './pages/connection_pool/connection_pool'; import { TimeOutSetting } from './pages/setting/setting'; import './app.provider'; import '../less/index.less'; +import "./pages/__point__/connect.point"; @shortcut() @store(AppModel) diff --git a/src/modules/pages/__point__/connect.point.ts b/src/modules/pages/__point__/connect.point.ts new file mode 100644 index 0000000..576f153 --- /dev/null +++ b/src/modules/pages/__point__/connect.point.ts @@ -0,0 +1,24 @@ +BI.point("dec.dcm.model.connection", "createNewConnection", () => { + Dec.Utils.saveFocusPoint({ + id: "E73325", + title: "新建数据连接", + }); +}); + +BI.point("dec.dcm.model.title_maintain", "setTestEvent", () => { + Dec.Utils.saveFocusPoint({ + id: "E73328", + title: "测试数据连接", + }); +}); + +BI.point("dec.dcm.model.maintain_form", "addConnection", function () { + Dec.Utils.saveFocusPoint({ + id: "E8827", + title: "保存数据连接", + body: { + datebaseType: this.model.datebaseTypeSelected, + databaseName: this.model.connectionSelected, + }, + }); +}); \ No newline at end of file