From fd2b9d440d736ec55d4734d95fba58ceec6d329b Mon Sep 17 00:00:00 2001 From: May Lin Date: Thu, 21 Nov 2019 16:25:30 +0800 Subject: fix: topic table and mockup data Issue-ID: DCAEGEN2-1715 Signed-off-by: May Lin Change-Id: I9fa6c05244454620b54601c1efdc6eb7f6b0f73e --- .../admin/src/src/app/core/models/topic.model.ts | 6 +- .../src/src/app/core/services/rest-api.service.ts | 16 +- .../admin/src/src/app/mockup/db.json | 205 +++++-- .../admin/src/src/app/mockup/index.js | 41 +- .../app/shared/modules/table/table.component.html | 44 +- .../admin/src/src/app/views/test/test.component.ts | 62 +- .../new-topic-model/new-topic-model.component.ts | 4 +- .../topics/topic-list/topic-list.component.html | 656 ++------------------- .../topics/topic-list/topic-list.component.ts | 119 ++-- .../admin/src/src/assets/i18n/en-us.json | 6 +- 10 files changed, 407 insertions(+), 752 deletions(-) diff --git a/components/datalake-handler/admin/src/src/app/core/models/topic.model.ts b/components/datalake-handler/admin/src/src/app/core/models/topic.model.ts index 7abc18b6..d8f7fe70 100644 --- a/components/datalake-handler/admin/src/src/app/core/models/topic.model.ts +++ b/components/datalake-handler/admin/src/src/app/core/models/topic.model.ts @@ -28,6 +28,7 @@ export class Topic { name: string; login: string; password: string; + enabledSinkdbs: any; sinkdbs: any; saveRaw: boolean; dataFormat: string; @@ -36,5 +37,6 @@ export class Topic { messageIdPath: string; // for UI display type: boolean; // 1: Configure 0: Unconfiure -} - + //id: number; //todo + //kafkas: any; //todo +} \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts b/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts index 9d10fdde..aa34b517 100644 --- a/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts +++ b/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts @@ -116,8 +116,8 @@ export class RestApiService { ); } - getTopicDetail(name: string): Observable { - return this.http.get(prefix + "topics/" + name).pipe( + getTopicDetail(id): Observable { + return this.http.get(prefix + "topics/" + id).pipe( retry(1), map(this.extractData), catchError(this.handleError) @@ -181,8 +181,8 @@ export class RestApiService { ); } - getDbDetail(name: string): Observable { - return this.http.get(prefix + "dbs/" + name).pipe( + getDbDetail(id): Observable { + return this.http.get(prefix + "dbs/" + id).pipe( retry(1), map(this.extractData), catchError(this.handleError) @@ -217,6 +217,14 @@ export class RestApiService { ); } + getDbTypeList(): Observable { + return this.http.get(prefix + "db_type").pipe( + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + /* Feeder */ diff --git a/components/datalake-handler/admin/src/src/app/mockup/db.json b/components/datalake-handler/admin/src/src/app/mockup/db.json index b45287bb..040b8924 100644 --- a/components/datalake-handler/admin/src/src/app/mockup/db.json +++ b/components/datalake-handler/admin/src/src/app/mockup/db.json @@ -1,9 +1,10 @@ { "dbs": [ { - "name": "Couchbase", + "id": 1, + "name": "Couchbase 1", "enabled": true, - "host": "dl_couchbase1", + "host": "dl_couchbase", "port": 567, "login": "admin", "pass": null, @@ -11,12 +12,14 @@ "encrypt": false, "property1": null, "property2": null, - "property3": null + "property3": null, + "type": "CB" }, { - "name": "Druid", + "id": 2, + "name": "Elasticsearch", "enabled": false, - "host": "dl_druid", + "host": "dl_es", "port": null, "login": null, "pass": null, @@ -24,12 +27,14 @@ "encrypt": null, "property1": null, "property2": null, - "property3": null + "property3": null, + "type": "ES" }, { - "name": "Elasticsearch", + "id": 3, + "name": "MongoDB 1", "enabled": false, - "host": "dl_es", + "host": "dl_mongodb", "port": null, "login": null, "pass": null, @@ -37,12 +42,14 @@ "encrypt": null, "property1": null, "property2": null, - "property3": null + "property3": null, + "type": "MONGO" }, { - "name": "HDFS", + "id": 4, + "name": "Druid", "enabled": false, - "host": "dlhdfs", + "host": "dl_druid", "port": null, "login": "dl", "pass": null, @@ -50,12 +57,14 @@ "encrypt": null, "property1": null, "property2": null, - "property3": null + "property3": null, + "type": "DRUID" }, { - "name": "MongoDB", + "id": 5, + "name": "Hadoop Cluster", "enabled": false, - "host": "dl_mongodb", + "host": "dl_hadoop", "port": 27017, "login": null, "pass": null, @@ -63,21 +72,81 @@ "encrypt": null, "property1": null, "property2": null, - "property3": null + "property3": null, + "type": "HDFS" + }, + { + "id": 6, + "name": "Kibana demo", + "enabled": false, + "host": "dl_kibana", + "port": 27017, + "login": null, + "pass": null, + "database": "datalake", + "encrypt": null, + "property1": null, + "property2": null, + "property3": null, + "type": "KIBANA" + }, + { + "id": 7, + "name": "Superset demo", + "enabled": false, + "host": "dl_superset", + "port": 27017, + "login": null, + "pass": null, + "database": "datalake", + "encrypt": null, + "property1": null, + "property2": null, + "property3": null, + "type": "SUPERSET" + }, + { + "id": 8, + "name": "Couchbase 2", + "enabled": true, + "host": "dl_couchbase", + "port": 567, + "login": "admin", + "pass": null, + "database": "datalake", + "encrypt": false, + "property1": null, + "property2": null, + "property3": null, + "type": "CB" } ], "topics": [ { + "id":1, + "name": "_DL_DEFAULT_", + "login": null, + "password": null, + "enabledSinkdbs": [ 1, 2, 3, 4, 5 ], + "sinkdbs": [ 1, 2, 3, 4, 5, 6, 7, 8 ], + "enabled": true, + "saveRaw": false, + "dataFormat": "JSON", + "ttl": 3650, + "correlateClearedMessage": false, + "messageIdPath": null, + "aggregateArrayPath": "/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray", + "flattenArrayPath": "/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface", + "kafkas": [ 1 ], + "type": false + }, + { + "id":2, "name": "unauthenticated.VES_MEASUREMENT_OUTPUT", "login": null, "password": null, - "sinkdbs": [ - "Druid", - "Couchbase", - "Elasticsearch", - "HDFS", - "MongoDB" - ], + "enabledSinkdbs": [ 1, 2, 3, 4, 5 ], + "sinkdbs": [ 1, 2, 3, 4, 5, 6, 7, 8 ], "enabled": true, "saveRaw": false, "dataFormat": "JSON", @@ -86,28 +155,16 @@ "messageIdPath": null, "aggregateArrayPath": "/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray", "flattenArrayPath": "/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface", - "dataFormat2": "JSON", - "aggregateArrayPath2": [ - "/event/measurementsForVfScalingFields/memoryUsageArray", - "/event/measurementsForVfScalingFields/diskUsageArray", - "/event/measurementsForVfScalingFields/cpuUsageArray", - "/event/measurementsForVfScalingFields/vNicPerformanceArray" - ], - "flattenArrayPath2": [ - "/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface" - ] + "kafkas": [ 1 ], + "type": false }, { + "id":3, "name": "AAI-EVENT", "login": null, "password": null, - "sinkdbs": [ - "Druid", - "Couchbase", - "Elasticsearch", - "HDFS", - "MongoDB" - ], + "enabledSinkdbs": [ 1, 2, 8 ], + "sinkdbs": [ 1, 2, 3, 4, 5, 6, 7, 8 ], "enabled": true, "saveRaw": false, "dataFormat": "JSON", @@ -116,24 +173,78 @@ "messageIdPath": null, "aggregateArrayPath": "", "flattenArrayPath": "", - "dataFormat2": "JSON", - "aggregateArrayPath2": [], - "flattenArrayPath2": [] + "kafkas": [ 1 ], + "type": true }, { + "id":4, "name": "AAI-EVENT2", "login": null, "password": null, - "sinkdbs": [ - "Druid", - "Couchbase" - ], + "enabledSinkdbs": [ 2 ], + "sinkdbs": [ 1, 2, 3, 4, 5, 6, 7, 8 ], "enabled": true, "saveRaw": true, "dataFormat": "JSON", "ttl": 256, "correlateClearedMessage": true, - "messageIdPath": "/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName" + "messageIdPath": "/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName", + "aggregateArrayPath": "", + "flattenArrayPath": "", + "kafkas": [ 1, 2 ], + "type": true + } + ], + "dmaap": [ + { + "kafkaId":1, + "name":[ + "unauthenticated.VES_MEASUREMENT_OUTPUT", + "AAI-EVENT", + "AAI-EVENT2" + ] + }, + { + "kafkaId":2, + "name":[ + "unauthenticated.DCAE_CL_OUTPUT", + "AAI-EVENT", + "unauthenticated.SEC_FAULT_OUTPUT", + "msgrtr.apinode.metrics.dmaap" + ] + } + ], + "kafka":[ + { + "id":1, + "name":"main Kafka cluster" + }, + { + "id":2, + "name":"QCT Kafka" + } + ], + "db_type":[ + { + "id":"CB" + }, + { + "id":"DRUID" + }, + { + "id":"ES" + }, + { + "id":"HDFS" + }, + { + "id":"KIBANA" + }, + { + "id":"MONGO" + }, + { + "id":"SUPERSET" } ] } \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/mockup/index.js b/components/datalake-handler/admin/src/src/app/mockup/index.js index f92c9a96..84095ab7 100644 --- a/components/datalake-handler/admin/src/src/app/mockup/index.js +++ b/components/datalake-handler/admin/src/src/app/mockup/index.js @@ -1,3 +1,29 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DataLake + * ================================================================================ + * Copyright 2019 QCT + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +/** + * + * @author Ekko Chang + * + */ + // Database const low = require("lowdb"); const FileSync = require("lowdb/adapters/FileSync"); @@ -92,11 +118,11 @@ server.post(endpoint + "/topics", async (req, res) => { postData("topics", req, res); }); -server.put(endpoint + "/topics/:name", async (req, res) => { +server.put(endpoint + "/topics/:id", async (req, res) => { putData("topics", req, res); }); -server.delete(endpoint + "/topics/:name", async (req, res) => { +server.delete(endpoint + "/topics/:id", async (req, res) => { deleteData("topics", req, res); }); // End REST API: /topics @@ -141,12 +167,12 @@ router.render = (req, res) => { let obj = res.locals.data; let data = []; for (let i = 0; i < obj.length; i++) { - data.push(obj[i].name); + data.push(obj[i].id); } res.jsonp(data); break; default: - res.jsonp(res.locals.data); + res.jsonp(res.locals.data[0]); } } }; @@ -155,9 +181,10 @@ router.render = (req, res) => { // Add this before server.use(router) server.use( jsonServer.rewriter({ - "/datalake/v1/dbs/:name": "/dbs?name=:name", - "/datalake/v1/topics/dmaap": "/topics", - "/datalake/v1/topics/:name": "/topics?name=:name" + "/datalake/v1/dbs/:id": "/dbs?id=:id", + "/datalake/v1/topics/_DL_DEFAULT_": "/topics?name=_DL_DEFAULT_", + "/datalake/v1/topics/:id": "/topics?id=:id", + "/datalake/v1/db_type": "/db_type" }) ); diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html index 80be23dd..cf9be50c 100644 --- a/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html +++ b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html @@ -1,8 +1,25 @@ + +
- + + + {{ column.name | translate}} + + Icon + + + - {{row[column.dataIndex]}} + {{row[column.dataIndex]}} + + + + + + + + + @@ -37,4 +71,4 @@
-
+ \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/test/test.component.ts b/components/datalake-handler/admin/src/src/app/views/test/test.component.ts index d7dbc962..b8a67fb5 100644 --- a/components/datalake-handler/admin/src/src/app/views/test/test.component.ts +++ b/components/datalake-handler/admin/src/src/app/views/test/test.component.ts @@ -1,3 +1,23 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DataLake + * ================================================================================ + * Copyright 2019 QCT + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + import { Component, OnInit } from "@angular/core"; import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; @@ -45,7 +65,11 @@ export class TestComponent implements OnInit { dataIndex: "name", sortable: true }, - { name: "TEMPLATE_TYPE", width: "180", dataIndex: "type" }, + { + name: "TEMPLATE_TYPE", + width: "180", + dataIndex: "type" + }, { name: "TOPICS_NAME", width: "220", @@ -53,28 +77,52 @@ export class TestComponent implements OnInit { renderText: "3" }, { - name: "DEPLOY_TO_DASHBOARD", + name: "", + src: "assets/icons/couchbase_able.svg", width: "220", + dataIndex: "cc", + }, + { + name: "DEPLOY_TO_DASHBOARD", + width: "100", dataIndex: "", - icontext: "DEPLOY" + icontext: "DEPLOY", + }, + { + name: "", + width: "20", + icon: "trash" + }, + { + name: "Configured", + width: "100", + dataIndex: "configured", + svgicon: "assets/icons/add.svg" + // icontext: "DEPLOY", + //svg: "assets/icons/add.svg", // TODO: icon }, - { name: "", width: "20", dataIndex: "", icon: "trash" } ]; this.mocktabledata = [ { name: "aaaa", type: "333", - topic: "尽快尽快" + topic: "尽快尽快", + cc: "123", + configured: true }, { name: "ccccc", type: "666", - topic: "2222" + topic: "2222", + cc: "222", + configured: true }, { name: "bbbbb", type: "77777", - topic: "555" + topic: "555", + cc: "5", + configured: false } ]; diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts index 82bbcb69..04bd331d 100644 --- a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts @@ -62,6 +62,7 @@ export class NewTopicModelComponent implements OnInit { login: "", password: "", sinkdbs: [], + enabledSinkdbs: [], enabled: false, saveRaw: false, dataFormat: this.dataFormats[0], @@ -76,6 +77,7 @@ export class NewTopicModelComponent implements OnInit { login: this.newTopic.login, password: this.newTopic.password, sinkdbs: this.newTopic.sinkdbs, + enabledSinkdbs: this.newTopic.sinkdbs, enabled: this.newTopic.enabled, saveRaw: this.newTopic.saveRaw, dataFormat: this.newTopic.dataFormat, @@ -154,4 +156,4 @@ export class NewTopicModelComponent implements OnInit { this.passEntry.emit(this.newTopic); } -} +} \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html index 519cc9da..e4596f68 100644 --- a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html @@ -34,7 +34,6 @@ limitations under the License. -
-
@@ -56,7 +54,7 @@ limitations under the License. [loadingIndicator]="loadingIndicator" [messages]="mesgNoData" [limit]="10" (activate)="onActivate($event)"> -
@@ -70,634 +68,84 @@ limitations under the License.
- + {{ row.name }} - - - - - - - - - - - - - - + +
+ + + + + + +
+
- - - - - - - - - - - - - - - - - - + + + Icon + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Icon + + - - - - - - - - - - - - - - - - - - - - + + + Icon + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Icon + + -
+ + + Icon + - + + Icon + + + + {{ row.ttl }} - -
- - - - - - - - -
-
- -
- - - + + +
- - -   {{ 'CONFIGURED' | translate }}   -   {{ 'UNCONFIGURED' | translate }}   - - - - +
- + \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts index 7f2b6f04..dbb2706c 100644 --- a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts @@ -103,9 +103,6 @@ export class TopicListComponent { } async initData() { - this.topicListDmaap = []; - this.topicListDmaap = await this.getTopicList("dmaap"); - this.topicListFeeder = []; this.topicListFeeder = await this.getTopicList("feeder"); @@ -119,10 +116,6 @@ export class TopicListComponent { var data: any; switch (type) { - case "dmaap": { - data = this.restApiService.getTopicsFromDmaap().toPromise(); - break; - } case "feeder": { data = this.restApiService.getTopicsFromFeeder().toPromise(); break; @@ -138,70 +131,36 @@ export class TopicListComponent { async initTopicList(dmaapList: [], feederList: []) { var t: Topic[] = []; - // dmaap has topics - if (dmaapList.length > 0) { - let listLength = dmaapList.length > feederList.length ? dmaapList.length : feederList.length; - for (var i = 0; i < listLength; i++) { - if (feederList.includes(dmaapList[i])) { - let data = await this.getTopicDetail(dmaapList[i]); - let feed = { - name: dmaapList[i], - login: data.login, - password: data.password, - sinkdbs: data.sinkdbs, - enabled: data.enabled, - saveRaw: data.saveRaw, - dataFormat: data.dataFormat, - ttl: data.ttl, - correlateClearedMessage: data.correlateClearedMessage, - messageIdPath: data.messageIdPath, - type: true - }; - t.push(feed); - } else if (!feederList.includes(dmaapList[i]) && dmaapList[i] != undefined) { - let feed = { - name: dmaapList[i], - login: this.topicDefaultConfig.login, - password: this.topicDefaultConfig.password, - sinkdbs: this.topicDefaultConfig.sinkdbs, - enabled: this.topicDefaultConfig.enabled, - saveRaw: this.topicDefaultConfig.saveRaw, - dataFormat: this.topicDefaultConfig.dataFormat, - ttl: this.topicDefaultConfig.ttl, - correlateClearedMessage: this.topicDefaultConfig - .correlateClearedMessage, - messageIdPath: this.topicDefaultConfig.messageIdPath, - type: false - }; - t.push(feed); - } - if (!dmaapList.includes(feederList[i]) && feederList[i] != undefined) { - let data = await this.getTopicDetail(feederList[i]); - let feed = { - name: feederList[i], - login: data.login, - password: data.password, - sinkdbs: data.sinkdbs, - enabled: data.enabled, - saveRaw: data.saveRaw, - dataFormat: data.dataFormat, - ttl: data.ttl, - correlateClearedMessage: data.correlateClearedMessage, - messageIdPath: data.messageIdPath, - type: true, - topicDb: true - }; - t.push(feed); - } - } - } else { // dmaap has no topics, only show topic in db for (var i = 0; i < feederList.length; i++) { let data = await this.getTopicDetail(feederList[i]); + let dbinfo = []; + var totalCB = 0; + var totalDRUID = 0; + var totalES = 0; + var totalHDFS = 0; + var totalMONGO = 0; + for (var x = 0; x < data.enabledSinkdbs.length; x++) { + let dbdata = await this.getDbDetail(data.enabledSinkdbs[x]); + dbinfo.push(dbdata); + if (dbinfo!=undefined && dbinfo[x].type=="CB"){ + totalCB = totalCB + 1; + }if (dbinfo!=undefined && dbinfo[x].type=="DRUID"){ + totalDRUID = totalDRUID + 1; + }if (dbinfo!=undefined && dbinfo[x].type=="ES"){ + totalES = totalES + 1; + }if (dbinfo!=undefined && dbinfo[x].type=="HDFS"){ + totalHDFS = totalHDFS + 1; + }if (dbinfo!=undefined && dbinfo[x].type=="MONGO"){ + totalMONGO = totalMONGO + 1; + } + } + let feed = { - name: feederList[i], + name: data.name, login: data.login, password: data.password, + enabledSinkdbs: data.enabledSinkdbs, sinkdbs: data.sinkdbs, enabled: data.enabled, saveRaw: data.saveRaw, @@ -209,12 +168,16 @@ export class TopicListComponent { ttl: data.ttl, correlateClearedMessage: data.correlateClearedMessage, messageIdPath: data.messageIdPath, - type: true + kafkas: data.kafkas.length, + type: data.type, + CB: totalCB, + DRUID: totalDRUID, + ES: totalES, + HDFS: totalHDFS, + MONGO: totalMONGO }; t.push(feed); } - } - return t; } @@ -274,7 +237,8 @@ export class TopicListComponent { // Unconfigure topics t.login = this.topicDefaultConfig.login; t.password = this.topicDefaultConfig.password; - t.sinkdbs = this.topicDefaultConfig.sinkdbs; + t.enabledSinkdbs = this.topicDefaultConfig.enabledSinkdbs; + // t.sinkdbs = this.topicDefaultConfig.sinkdbs; //todo t.enabled = this.topicDefaultConfig.enabled; t.saveRaw = this.topicDefaultConfig.saveRaw; t.dataFormat = this.topicDefaultConfig.dataFormat; @@ -389,10 +353,21 @@ export class TopicListComponent { }) } - getTopicDetail(name: string) { - return this.restApiService.getTopicDetail(name).toPromise(); + getTopicDetail(id) { + return this.restApiService.getTopicDetail(id).toPromise(); } + getDbDetail(id) { + return this.restApiService.getDbDetail(id).toPromise(); + } + + GroupByDbType = (array, key) => { + return array.reduce((result, currentValue) => { + (result[currentValue.type] = result[currentValue.type] || []).push(currentValue); + return result; + }, {}); + }; + updateFilter(searchValue) { const val = searchValue.toLowerCase(); @@ -404,4 +379,4 @@ export class TopicListComponent { // update the rows this.topics = temp; } -} +} \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json index 05730d9d..233f1377 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json @@ -14,8 +14,8 @@ "SINK": "Sink", "AUTHENTICATION": "Authentication", "DATA_FORMAT": "Data format", - "TTL": "TTL(days)", - "SAVE_RAW_DATA": "Save raw data", + "TTL": "TTL", + "SAVE_RAW_DATA": "Save raw", "CORRELATE_CLEARED_MESSAGE": "Correlate cleared message", "DEFAULT_CONFIGURATIONS": "Default configurations", "ID_EXTRACTION": "ID extraction", @@ -28,7 +28,7 @@ "PORT": "Port", "ENABLE_SSL": "Encrypt Communication", "VERIFY": "Verify", - "SETTING": "Setting", + "SETTING": "Configured", "DOCUMENT_STORE": "Document store", "SEARCH_ENGINE": "Search engine", "DELETE": "Delete", -- cgit 1.2.3-korg