From f7619096578c002d34dbf670348ce2fd0d799614 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Fri, 19 Jul 2019 10:21:22 +0800 Subject: feat: change the structure of the project Change-Id: I68dc566780aa26f7d4de7488705adcb3fec2f782 Signed-off-by: cyuamber Issue-ID: DCAEGEN2-1671 --- components/datalake-handler/admin/src/README.md | 44 ++ .../admin/src/src/app/about/about.component.css | 44 -- .../admin/src/src/app/about/about.component.html | 189 ------ .../src/src/app/about/about.component.spec.ts | 44 -- .../admin/src/src/app/about/about.component.ts | 52 -- .../admin/src/src/app/app-routing.module.ts | 24 +- .../admin/src/src/app/app.component.html | 2 +- .../admin/src/src/app/app.module.ts | 70 +- .../src/src/app/core/alert/alert.component.css | 31 - .../src/src/app/core/alert/alert.component.html | 66 -- .../src/src/app/core/alert/alert.component.spec.ts | 44 -- .../src/src/app/core/alert/alert.component.ts | 46 -- .../services/toastr-notification.service.spec.ts | 34 - .../core/services/toastr-notification.service.ts | 94 --- .../toastr-notification.component.css | 252 ------- .../toastr-notification.component.html | 29 - .../toastr-notification.component.spec.ts | 44 -- .../toastr-notification.component.ts | 81 --- .../create-dashboard.component.css | 18 - .../create-dashboard.component.html | 129 ---- .../create-dashboard.component.spec.ts | 40 -- .../create-dashboard/create-dashboard.component.ts | 77 --- .../dashboard-list/dashboard-list.component.css | 70 -- .../dashboard-list/dashboard-list.component.html | 181 ----- .../dashboard-list.component.spec.ts | 40 -- .../dashboard-list/dashboard-list.component.ts | 162 ----- .../dashboard-setting.component.css | 15 - .../dashboard-setting.component.html | 24 - .../dashboard-setting.component.spec.ts | 40 -- .../dashboard-setting.component.ts | 29 - .../edit-template-modal.component.css | 22 - .../edit-template-modal.component.html | 156 ----- .../edit-template-modal.component.spec.ts | 40 -- .../edit-template-modal.component.ts | 160 ----- .../new-template-modal.component.css | 22 - .../new-template-modal.component.html | 157 ----- .../new-template-modal.component.spec.ts | 40 -- .../new-template-modal.component.ts | 148 ----- .../template-list/template-list.component.css | 20 - .../template-list/template-list.component.html | 112 ---- .../template-list/template-list.component.spec.ts | 40 -- .../template-list/template-list.component.ts | 248 ------- .../template/template.component.css | 15 - .../template/template.component.html | 23 - .../template/template.component.spec.ts | 40 -- .../template/template.component.ts | 34 - .../database-add-modal.component.css | 40 -- .../database-add-modal.component.html | 123 ---- .../database-add-modal.component.spec.ts | 44 -- .../database-add-modal.component.ts | 50 -- .../database-list/database-list.component.css | 63 -- .../database-list/database-list.component.html | 235 ------- .../database-list/database-list.component.spec.ts | 44 -- .../database-list/database-list.component.ts | 229 ------- .../dbs-modal/couchbase/couchbase.component.css | 19 - .../dbs-modal/couchbase/couchbase.component.html | 146 ----- .../couchbase/couchbase.component.spec.ts | 44 -- .../dbs-modal/couchbase/couchbase.component.ts | 67 -- .../dbs-modal/druid/druid.component.css | 19 - .../dbs-modal/druid/druid.component.html | 146 ----- .../dbs-modal/druid/druid.component.spec.ts | 44 -- .../dbs-modal/druid/druid.component.ts | 67 -- .../elasticsearch/elasticsearch.component.css | 19 - .../elasticsearch/elasticsearch.component.html | 136 ---- .../elasticsearch/elasticsearch.component.spec.ts | 44 -- .../elasticsearch/elasticsearch.component.ts | 67 -- .../dbs-modal/hdfs/hdfs.component.css | 19 - .../dbs-modal/hdfs/hdfs.component.html | 136 ---- .../dbs-modal/hdfs/hdfs.component.spec.ts | 44 -- .../database-list/dbs-modal/hdfs/hdfs.component.ts | 67 -- .../dbs-modal/mongodb/mongodb.component.css | 19 - .../dbs-modal/mongodb/mongodb.component.html | 146 ----- .../dbs-modal/mongodb/mongodb.component.spec.ts | 44 -- .../dbs-modal/mongodb/mongodb.component.ts | 67 -- .../src/src/app/database/database.component.css | 19 - .../src/src/app/database/database.component.html | 28 - .../src/app/database/database.component.spec.ts | 44 -- .../src/src/app/database/database.component.ts | 41 -- .../admin/src/src/app/feeder/feeder.component.css | 47 -- .../admin/src/src/app/feeder/feeder.component.html | 56 -- .../src/src/app/feeder/feeder.component.spec.ts | 44 -- .../admin/src/src/app/feeder/feeder.component.ts | 81 --- .../admin/src/src/app/header/header.component.css | 19 - .../admin/src/src/app/header/header.component.html | 43 -- .../src/src/app/header/header.component.spec.ts | 44 -- .../admin/src/src/app/header/header.component.ts | 126 ---- .../shared/components/alert/alert.component.css | 31 + .../shared/components/alert/alert.component.html | 66 ++ .../components/alert/alert.component.spec.ts | 44 ++ .../app/shared/components/alert/alert.component.ts | 46 ++ .../toastr-notification.component.css | 252 +++++++ .../toastr-notification.component.html | 29 + .../toastr-notification.component.spec.ts | 44 ++ .../toastr-notification.component.ts | 81 +++ .../toastr-notification.service.spec.ts | 34 + .../toastr-notification.service.ts | 94 +++ .../app/shared/layout/header/header.component.css | 19 + .../app/shared/layout/header/header.component.html | 43 ++ .../shared/layout/header/header.component.spec.ts | 44 ++ .../app/shared/layout/header/header.component.ts | 126 ++++ .../shared/layout/sidebar/sidebar.component.css | 25 + .../shared/layout/sidebar/sidebar.component.html | 80 +++ .../layout/sidebar/sidebar.component.spec.ts | 44 ++ .../app/shared/layout/sidebar/sidebar.component.ts | 40 ++ .../src/app/shared/modules/card/card.component.css | 0 .../app/shared/modules/card/card.component.html | 3 + .../app/shared/modules/card/card.component.spec.ts | 25 + .../src/app/shared/modules/card/card.component.ts | 15 + .../app/shared/modules/modal/modal.component.css | 0 .../app/shared/modules/modal/modal.component.html | 3 + .../shared/modules/modal/modal.component.spec.ts | 25 + .../app/shared/modules/modal/modal.component.ts | 15 + .../app/shared/modules/search/search.component.css | 0 .../shared/modules/search/search.component.html | 3 + .../shared/modules/search/search.component.spec.ts | 25 + .../app/shared/modules/search/search.component.ts | 15 + .../app/shared/modules/table/table.component.css | 0 .../app/shared/modules/table/table.component.html | 3 + .../shared/modules/table/table.component.spec.ts | 25 + .../app/shared/modules/table/table.component.ts | 15 + .../admin/src/src/app/shared/utils/utils.js | 1 + .../src/src/app/sidebar/sidebar.component.css | 25 - .../src/src/app/sidebar/sidebar.component.html | 80 --- .../src/src/app/sidebar/sidebar.component.spec.ts | 44 -- .../admin/src/src/app/sidebar/sidebar.component.ts | 40 -- .../new-topic-model/new-topic-model.component.css | 15 - .../new-topic-model/new-topic-model.component.html | 229 ------- .../new-topic-model.component.spec.ts | 40 -- .../new-topic-model/new-topic-model.component.ts | 157 ----- .../topic-config-modal.component.css | 0 .../topic-config-modal.component.html | 164 ----- .../topic-config-modal.component.spec.ts | 25 - .../topic-config-modal.component.ts | 110 ---- .../topic-detail-modal.component.css | 0 .../topic-detail-modal.component.html | 223 ------- .../topic-detail-modal.component.spec.ts | 25 - .../topic-detail-modal.component.ts | 152 ----- .../app/topics/topic-list/topic-list.component.css | 5 - .../topics/topic-list/topic-list.component.html | 728 --------------------- .../topics/topic-list/topic-list.component.spec.ts | 24 - .../app/topics/topic-list/topic-list.component.ts | 407 ------------ .../admin/src/src/app/topics/topics.component.css | 0 .../admin/src/src/app/topics/topics.component.html | 9 - .../src/src/app/topics/topics.component.spec.ts | 25 - .../admin/src/src/app/topics/topics.component.ts | 16 - .../src/src/app/views/about/about.component.css | 44 ++ .../src/src/app/views/about/about.component.html | 189 ++++++ .../src/app/views/about/about.component.spec.ts | 44 ++ .../src/src/app/views/about/about.component.ts | 52 ++ .../create-dashboard.component.css | 18 + .../create-dashboard.component.html | 129 ++++ .../create-dashboard.component.spec.ts | 40 ++ .../create-dashboard/create-dashboard.component.ts | 77 +++ .../dashboard-list/dashboard-list.component.css | 70 ++ .../dashboard-list/dashboard-list.component.html | 181 +++++ .../dashboard-list.component.spec.ts | 40 ++ .../dashboard-list/dashboard-list.component.ts | 162 +++++ .../dashboard-setting.component.css | 15 + .../dashboard-setting.component.html | 24 + .../dashboard-setting.component.spec.ts | 40 ++ .../dashboard-setting.component.ts | 29 + .../edit-template-modal.component.css | 22 + .../edit-template-modal.component.html | 156 +++++ .../edit-template-modal.component.spec.ts | 40 ++ .../edit-template-modal.component.ts | 160 +++++ .../new-template-modal.component.css | 22 + .../new-template-modal.component.html | 157 +++++ .../new-template-modal.component.spec.ts | 40 ++ .../new-template-modal.component.ts | 148 +++++ .../template-list/template-list.component.css | 20 + .../template-list/template-list.component.html | 112 ++++ .../template-list/template-list.component.spec.ts | 40 ++ .../template-list/template-list.component.ts | 248 +++++++ .../template/template.component.css | 15 + .../template/template.component.html | 23 + .../template/template.component.spec.ts | 40 ++ .../template/template.component.ts | 34 + .../database-add-modal.component.css | 40 ++ .../database-add-modal.component.html | 123 ++++ .../database-add-modal.component.spec.ts | 44 ++ .../database-add-modal.component.ts | 50 ++ .../database-list/database-list.component.css | 63 ++ .../database-list/database-list.component.html | 235 +++++++ .../database-list/database-list.component.spec.ts | 44 ++ .../database-list/database-list.component.ts | 229 +++++++ .../dbs-modal/couchbase/couchbase.component.css | 19 + .../dbs-modal/couchbase/couchbase.component.html | 146 +++++ .../couchbase/couchbase.component.spec.ts | 44 ++ .../dbs-modal/couchbase/couchbase.component.ts | 67 ++ .../dbs-modal/druid/druid.component.css | 19 + .../dbs-modal/druid/druid.component.html | 146 +++++ .../dbs-modal/druid/druid.component.spec.ts | 44 ++ .../dbs-modal/druid/druid.component.ts | 67 ++ .../elasticsearch/elasticsearch.component.css | 19 + .../elasticsearch/elasticsearch.component.html | 136 ++++ .../elasticsearch/elasticsearch.component.spec.ts | 44 ++ .../elasticsearch/elasticsearch.component.ts | 67 ++ .../dbs-modal/hdfs/hdfs.component.css | 19 + .../dbs-modal/hdfs/hdfs.component.html | 136 ++++ .../dbs-modal/hdfs/hdfs.component.spec.ts | 44 ++ .../database-list/dbs-modal/hdfs/hdfs.component.ts | 67 ++ .../dbs-modal/mongodb/mongodb.component.css | 19 + .../dbs-modal/mongodb/mongodb.component.html | 146 +++++ .../dbs-modal/mongodb/mongodb.component.spec.ts | 44 ++ .../dbs-modal/mongodb/mongodb.component.ts | 67 ++ .../src/app/views/database/database.component.css | 19 + .../src/app/views/database/database.component.html | 28 + .../app/views/database/database.component.spec.ts | 44 ++ .../src/app/views/database/database.component.ts | 41 ++ .../src/src/app/views/feeder/feeder.component.css | 47 ++ .../src/src/app/views/feeder/feeder.component.html | 56 ++ .../src/app/views/feeder/feeder.component.spec.ts | 44 ++ .../src/src/app/views/feeder/feeder.component.ts | 81 +++ .../src/src/app/views/test/test.component.css | 0 .../src/src/app/views/test/test.component.html | 20 + .../src/src/app/views/test/test.component.spec.ts | 25 + .../admin/src/src/app/views/test/test.component.ts | 15 + .../new-topic-model/new-topic-model.component.css | 15 + .../new-topic-model/new-topic-model.component.html | 229 +++++++ .../new-topic-model.component.spec.ts | 40 ++ .../new-topic-model/new-topic-model.component.ts | 157 +++++ .../topic-config-modal.component.css | 0 .../topic-config-modal.component.html | 164 +++++ .../topic-config-modal.component.spec.ts | 25 + .../topic-config-modal.component.ts | 110 ++++ .../topic-detail-modal.component.css | 0 .../topic-detail-modal.component.html | 223 +++++++ .../topic-detail-modal.component.spec.ts | 25 + .../topic-detail-modal.component.ts | 152 +++++ .../topics/topic-list/topic-list.component.css | 5 + .../topics/topic-list/topic-list.component.html | 728 +++++++++++++++++++++ .../topics/topic-list/topic-list.component.spec.ts | 24 + .../topics/topic-list/topic-list.component.ts | 407 ++++++++++++ .../src/src/app/views/topics/topics.component.css | 0 .../src/src/app/views/topics/topics.component.html | 9 + .../src/app/views/topics/topics.component.spec.ts | 25 + .../src/src/app/views/topics/topics.component.ts | 16 + 237 files changed, 8807 insertions(+), 8516 deletions(-) delete mode 100644 components/datalake-handler/admin/src/src/app/about/about.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/about/about.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/about/about.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/about/about.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/alert/alert.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/core/alert/alert.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/core/alert/alert.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/database/database.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/database/database.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/database/database.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/feeder/feeder.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/feeder/feeder.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/feeder/feeder.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/header/header.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/header/header.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/header/header.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/header/header.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.css create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/shared/utils/utils.js delete mode 100644 components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topics.component.css delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topics.component.html delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topics.component.spec.ts delete mode 100644 components/datalake-handler/admin/src/src/app/topics/topics.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/about/about.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/about/about.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/about/about.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/about/about.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/database/database.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/test/test.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/test/test.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/test/test.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/test/test.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topics.component.css create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topics.component.html create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topics.component.spec.ts create mode 100644 components/datalake-handler/admin/src/src/app/views/topics/topics.component.ts (limited to 'components/datalake-handler/admin') diff --git a/components/datalake-handler/admin/src/README.md b/components/datalake-handler/admin/src/README.md index 8b137891..7f3764cf 100644 --- a/components/datalake-handler/admin/src/README.md +++ b/components/datalake-handler/admin/src/README.md @@ -1 +1,45 @@ + + +### Directory Layout + The source code layout is as follow: + -- app + -- shared -----> container of pubilc parts + -- components -----> container of pubilc components + -- alert + -- toastr-notification + -- ...more components + -- modules -----> container of public business modules + -- card + -- modal + -- search + -- table + -- layout -----> container of basic layout of all pages + -- header + -- sidebar + -- utils -----> container of general functions + -- core -----> container of core functions + -- models + -- services + -- views -----> container of all business pages + -- about + -- dashboard-setting + -- database + -- feeder + -- topics + -- ...more modules + -- app-routing.module.ts -----> container of all pages routers + -- app-component.css + -- app-component.html + -- app-component.ts + -- app-module.ts + -- assets + -- i18n + -- index.html + -- main.ts + -- styles.css + -- ...other config documents + +> The layout is used for organizing a new module, **PLEASE** take care of the difference between ```components``` and ``` modules```. Make sure that all parts added in the ``` components``` are ``` dump components``` and all the parts which are related to the **business** should be added in the ``` modules```. Good luck 🙂. + +> The service folder is used for created some reused services. **PLEASE** put the specific services into the related folders. For example, put the toastr-notification service into the ```components/toastr-notification``` folder. diff --git a/components/datalake-handler/admin/src/src/app/about/about.component.css b/components/datalake-handler/admin/src/src/app/about/about.component.css deleted file mode 100644 index c8173515..00000000 --- a/components/datalake-handler/admin/src/src/app/about/about.component.css +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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========================================================= - */ - -.about-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; - padding: 30px 30px; -} - -.about-title { - color: #5DBEBB; - font-weight: 800; - padding-bottom: 20px; -} - -.about-bold { - color: #313032; - font-weight: 800; -} - -.about-info { - font-family: "Open Sans", sans-serif; - font-weight: 400; - font-size: 14px; - color: #A8A9AC; -} diff --git a/components/datalake-handler/admin/src/src/app/about/about.component.html b/components/datalake-handler/admin/src/src/app/about/about.component.html deleted file mode 100644 index accab817..00000000 --- a/components/datalake-handler/admin/src/src/app/about/about.component.html +++ /dev/null @@ -1,189 +0,0 @@ - -
-
- Home > About -
-
- -
- -
-
-
- ONAP DataLake Admin Platform -
-
- {{ this.feeder.version }} -
-
- -
-
-
- - - - - - - - -
-
- - - - - - - - - - - - - - - - - -
-
- -
-
-
diff --git a/components/datalake-handler/admin/src/src/app/about/about.component.spec.ts b/components/datalake-handler/admin/src/src/app/about/about.component.spec.ts deleted file mode 100644 index b2be756c..00000000 --- a/components/datalake-handler/admin/src/src/app/about/about.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { AboutComponent } from "./about.component"; - -describe("AboutComponent", () => { - let component: AboutComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AboutComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AboutComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/about/about.component.ts b/components/datalake-handler/admin/src/src/app/about/about.component.ts deleted file mode 100644 index adf65a2a..00000000 --- a/components/datalake-handler/admin/src/src/app/about/about.component.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, OnInit } from "@angular/core"; -import { AdminService } from "src/app/core/services/admin.service"; -import { RestApiService } from "src/app/core/services/rest-api.service"; - -@Component({ - selector: "app-about", - templateUrl: "./about.component.html", - styleUrls: ["./about.component.css"] -}) -export class AboutComponent implements OnInit { - feeder: any = []; - - constructor( - private adminService: AdminService, - private restApiService: RestApiService - ) { - this.adminService.setTitle("SIDEBAR.ABOUT"); - } - - ngOnInit() { - // Get datalake feeder version - this.restApiService.getFeederstatus().subscribe(data => { - this.feeder = data; - }); - } -} diff --git a/components/datalake-handler/admin/src/src/app/app-routing.module.ts b/components/datalake-handler/admin/src/src/app/app-routing.module.ts index 37ed0401..e96f5d17 100644 --- a/components/datalake-handler/admin/src/src/app/app-routing.module.ts +++ b/components/datalake-handler/admin/src/src/app/app-routing.module.ts @@ -27,22 +27,26 @@ import { NgModule } from "@angular/core"; import { Routes, RouterModule } from "@angular/router"; -import { FeederComponent } from "./feeder/feeder.component"; -import { TopicsComponent } from "./topics/topics.component"; -import { DatabaseComponent } from "./database/database.component"; -import { AboutComponent } from "./about/about.component"; -import { DashboardSettingComponent } from './dashboard-setting/dashboard-setting.component'; -import { DashboardListComponent } from './dashboard-setting/dashboard-list/dashboard-list.component'; -import { TemplateComponent } from './dashboard-setting/template/template.component'; +//test components for module testing +import { TestComponent } from './views/test/test.component'; + +import { FeederComponent } from "./views/feeder/feeder.component"; +import { TopicsComponent } from "./views/topics/topics.component"; +import { DatabaseComponent } from "./views/database/database.component"; +import { AboutComponent } from "./views/about/about.component"; +import { DashboardSettingComponent } from './views/dashboard-setting/dashboard-setting.component'; +import { DashboardListComponent } from './views/dashboard-setting/dashboard-list/dashboard-list.component'; +import { TemplateComponent } from './views/dashboard-setting/template/template.component'; const routes: Routes = [ { path: "", redirectTo: "/feeder", pathMatch: "full" }, + { path: "test", component: TestComponent }, { path: "feeder", component: FeederComponent }, { path: "topics", component: TopicsComponent }, { path: "database", component: DatabaseComponent }, { path: "about", component: AboutComponent }, - { path: 'dashboard-setting/dashboard-list', component: DashboardListComponent}, - { path: 'dashboard-setting/template', component: TemplateComponent}, + { path: 'dashboard-setting/dashboard-list', component: DashboardListComponent }, + { path: 'dashboard-setting/template', component: TemplateComponent }, ]; @NgModule({ @@ -53,4 +57,4 @@ const routes: Routes = [ ], exports: [RouterModule] }) -export class AppRoutingModule {} +export class AppRoutingModule { } diff --git a/components/datalake-handler/admin/src/src/app/app.component.html b/components/datalake-handler/admin/src/src/app/app.component.html index d4f2c173..f6727cae 100644 --- a/components/datalake-handler/admin/src/src/app/app.component.html +++ b/components/datalake-handler/admin/src/src/app/app.component.html @@ -51,4 +51,4 @@ limitations under the License. - + \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/app.module.ts b/components/datalake-handler/admin/src/src/app/app.module.ts index 1c73cfd2..ecab9a7b 100644 --- a/components/datalake-handler/admin/src/src/app/app.module.ts +++ b/components/datalake-handler/admin/src/src/app/app.module.ts @@ -32,18 +32,18 @@ import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; import { AppRoutingModule } from "./app-routing.module"; import { AppComponent } from "./app.component"; -import { HeaderComponent } from "./header/header.component"; -import { SidebarComponent } from "./sidebar/sidebar.component"; +import { HeaderComponent } from "./shared/layout/header/header.component"; +import { SidebarComponent } from "./shared/layout/sidebar/sidebar.component"; -import { FeederComponent } from "./feeder/feeder.component"; -import { TopicsComponent } from "./topics/topics.component"; -import { DatabaseComponent } from "./database/database.component"; -import { TopicListComponent } from "./topics/topic-list/topic-list.component"; +import { FeederComponent } from "./views/feeder/feeder.component"; +import { TopicsComponent } from "./views/topics/topics.component"; +import { DatabaseComponent } from "./views/database/database.component"; +import { TopicListComponent } from "./views/topics/topic-list/topic-list.component"; // Service import { AdminService } from "./core/services/admin.service"; import { RestApiService } from "./core/services/rest-api.service"; -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; // i18n import { TranslateModule, TranslateLoader } from "@ngx-translate/core"; @@ -57,32 +57,37 @@ export function createLoader(http: HttpClient) { import { HttpClientModule } from "@angular/common/http"; import { HttpClient } from "@angular/common/http"; -import { DatabaseListComponent } from "./database/database-list/database-list.component"; +import { DatabaseListComponent } from "./views/database/database-list/database-list.component"; import { NgxDatatableModule } from "@swimlane/ngx-datatable"; -import { CouchbaseComponent } from "./database/database-list/dbs-modal/couchbase/couchbase.component"; -import { MongodbComponent } from "./database/database-list/dbs-modal/mongodb/mongodb.component"; -import { HdfsComponent } from "./database/database-list/dbs-modal/hdfs/hdfs.component"; -import { DatabaseAddModalComponent } from "./database/database-list/database-add-modal/database-add-modal.component"; -import { ElasticsearchComponent } from "./database/database-list/dbs-modal/elasticsearch/elasticsearch.component"; -import { DruidComponent } from "./database/database-list/dbs-modal/druid/druid.component"; +import { CouchbaseComponent } from "./views/database/database-list/dbs-modal/couchbase/couchbase.component"; +import { MongodbComponent } from "./views/database/database-list/dbs-modal/mongodb/mongodb.component"; +import { HdfsComponent } from "./views/database/database-list/dbs-modal/hdfs/hdfs.component"; +import { DatabaseAddModalComponent } from "./views/database/database-list/database-add-modal/database-add-modal.component"; +import { ElasticsearchComponent } from "./views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component"; +import { DruidComponent } from "./views/database/database-list/dbs-modal/druid/druid.component"; // Modals -import { TopicDetailModalComponent } from "./topics/topic-list/topic-detail-modal/topic-detail-modal.component"; -import { TopicConfigModalComponent } from "./topics/topic-list/topic-config-modal/topic-config-modal.component"; -import { ToastrNotificationComponent } from "./core/toastr-notification/toastr-notification.component"; -import { AlertComponent } from "./core/alert/alert.component"; -import { AboutComponent } from "./about/about.component"; +import { TopicDetailModalComponent } from "./views/topics/topic-list/topic-detail-modal/topic-detail-modal.component"; +import { TopicConfigModalComponent } from "./views/topics/topic-list/topic-config-modal/topic-config-modal.component"; +import { ToastrNotificationComponent } from "./shared/components/toastr-notification/toastr-notification.component"; +import { AlertComponent } from "./shared/components/alert/alert.component"; +import { AboutComponent } from "./views/about/about.component"; // Loading spinner import { NgxSpinnerModule } from "ngx-spinner"; -import { DashboardSettingComponent } from './dashboard-setting/dashboard-setting.component'; -import { DashboardListComponent } from './dashboard-setting/dashboard-list/dashboard-list.component'; -import { TemplateComponent } from './dashboard-setting/template/template.component'; -import { CreateDashboardComponent } from './dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component'; -import { TemplateListComponent } from './dashboard-setting/template/template-list/template-list.component'; -import { NewTemplateModalComponent } from './dashboard-setting/template/template-list/new-template-modal/new-template-modal.component'; -import { EditTemplateModalComponent } from './dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component'; -import { NewTopicModelComponent } from './topics/topic-list/new-topic-model/new-topic-model.component'; +import { DashboardSettingComponent } from './views/dashboard-setting/dashboard-setting.component'; +import { DashboardListComponent } from './views/dashboard-setting/dashboard-list/dashboard-list.component'; +import { TemplateComponent } from './views/dashboard-setting/template/template.component'; +import { CreateDashboardComponent } from './views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component'; +import { TemplateListComponent } from './views/dashboard-setting/template/template-list/template-list.component'; +import { NewTemplateModalComponent } from './views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component'; +import { EditTemplateModalComponent } from './views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component'; +import { NewTopicModelComponent } from './views/topics/topic-list/new-topic-model/new-topic-model.component'; +import { TestComponent } from './views/test/test.component'; +import { ModalComponent } from './shared/modules/modal/modal.component'; +import { TableComponent } from './shared/modules/table/table.component'; +import { SearchComponent } from './shared/modules/search/search.component'; +import { CardComponent } from './shared/modules/card/card.component'; @NgModule({ declarations: [ @@ -108,11 +113,16 @@ import { NewTopicModelComponent } from './topics/topic-list/new-topic-model/new- DashboardSettingComponent, DashboardListComponent, CreateDashboardComponent, - TemplateComponent, + TemplateComponent, TemplateListComponent, NewTemplateModalComponent, EditTemplateModalComponent, NewTopicModelComponent, + TestComponent, + ModalComponent, + TableComponent, + SearchComponent, + CardComponent, ], imports: [ @@ -145,8 +155,8 @@ import { NewTopicModelComponent } from './topics/topic-list/new-topic-model/new- TopicConfigModalComponent, NewTopicModelComponent, CreateDashboardComponent, - NewTemplateModalComponent, + NewTemplateModalComponent, EditTemplateModalComponent ] }) -export class AppModule {} +export class AppModule { } diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.css b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.css deleted file mode 100644 index 46d72a44..00000000 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.css +++ /dev/null @@ -1,31 +0,0 @@ -/* -* ============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========================================================= -*/ - - -.alert-msg { - font-family: "Open Sans", sans-serif; - font-weight: 600; - font-size: 14px; - text-align: center; -} - -.alert-icon { - color: rgb(244, 166, 10); -} diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html deleted file mode 100644 index 75c5b9d5..00000000 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html +++ /dev/null @@ -1,66 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.spec.ts b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.spec.ts deleted file mode 100644 index b1f05154..00000000 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { AlertComponent } from "./alert.component"; - -describe("AlertComponent", () => { - let component: AlertComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AlertComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AlertComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts deleted file mode 100644 index 3774ec35..00000000 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============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========================================================= - */ - -/** - * This component is a modal window to alert message. - * - * @author Ekko Chang - * - */ - -import { Component, EventEmitter, Input, Output } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; - -@Component({ - selector: "app-alert", - templateUrl: "./alert.component.html", - styleUrls: ["./alert.component.css"] -}) -export class AlertComponent { - @Input() message: string; - @Input() dashboardDeteleModelShow; - @Output() passEntry: EventEmitter = new EventEmitter(); - - constructor(public activeModal: NgbActiveModal) { } - - passBack() { - this.passEntry.emit(true); - } -} diff --git a/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.spec.ts b/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.spec.ts deleted file mode 100644 index 1cda6a51..00000000 --- a/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.spec.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * ============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 { TestBed } from "@angular/core/testing"; - -import { ToastrNotificationService } from "./toastr-notification.service"; - -describe("ToastrNotificationService", () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it("should be created", () => { - const service: ToastrNotificationService = TestBed.get( - ToastrNotificationService - ); - expect(service).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.ts b/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.ts deleted file mode 100644 index 5419d070..00000000 --- a/components/datalake-handler/admin/src/src/app/core/services/toastr-notification.service.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * ============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 { Injectable } from "@angular/core"; -import { Router, NavigationStart } from "@angular/router"; -import { Observable, Subject } from "rxjs"; -import { - Notification, - NotificationType -} from "src/app/core/models/toastr-notification.model"; - -@Injectable({ - providedIn: "root" -}) -export class ToastrNotificationService { - public subject = new Subject(); - public keepAfterRouteChange = true; - - constructor(public router: Router) { - router.events.subscribe(event => { - if (event instanceof NavigationStart) { - if (this.keepAfterRouteChange) { - // only keep for a single route change - this.keepAfterRouteChange = false; - } else { - // clear alert messages - this.clear(); - } - } - }); - } - - getAlert(): Observable { - return this.subject.asObservable(); - } - - success(message: string, keepAfterRouteChange = false) { - this.showNotification( - NotificationType.Success, - message, - keepAfterRouteChange - ); - } - - error(message: string, keepAfterRouteChange = false) { - this.showNotification( - NotificationType.Error, - message, - keepAfterRouteChange - ); - } - - info(message: string, keepAfterRouteChange = false) { - this.showNotification(NotificationType.Info, message, keepAfterRouteChange); - } - - warn(message: string, keepAfterRouteChange = false) { - this.showNotification( - NotificationType.Warning, - message, - keepAfterRouteChange - ); - } - - showNotification( - type: NotificationType, - message: string, - keepAfterRouteChange = false - ) { - this.keepAfterRouteChange = keepAfterRouteChange; - this.subject.next({ type: type, message: message }); - } - - clear() { - this.subject.next(); - } -} diff --git a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.css b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.css deleted file mode 100644 index d28364f4..00000000 --- a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.css +++ /dev/null @@ -1,252 +0,0 @@ -/* -* ============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========================================================= -*/ - - - -.toast-title { - font-weight: bold; -} - -.toast-message { - word-wrap: break-word; -} - -.toast-message a, -.toast-message label { - color: #FFFFFF; -} - -.toast-message a:hover { - color: #CCCCCC; - text-decoration: none; -} - -.toast-close-button { - position: relative; - right: -0.3em; - top: -0.3em; - float: right; - font-size: 20px; - font-weight: bold; - color: #FFFFFF; - -webkit-text-shadow: 0 1px 0 #ffffff; - text-shadow: 0 1px 0 #ffffff; - opacity: 0.8; -} - -.toast-close-button:hover, -.toast-close-button:focus { - color: #000000; - text-decoration: none; - cursor: pointer; - opacity: 0.4; -} - -/*Additional properties for button version -iOS requires the button element instead of an anchor tag. -If you want the anchor version, it requires `href="#"`.*/ -button.toast-close-button { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; -} - -.toast-top-center { - top: 0; - right: 0; - width: 100%; -} - -.toast-bottom-center { - bottom: 0; - right: 0; - width: 100%; -} - -.toast-top-full-width { - top: 0; - right: 0; - width: 100%; -} - -.toast-bottom-full-width { - bottom: 0; - right: 0; - width: 100%; -} - -.toast-top-left { - top: 12px; - left: 12px; -} - -.toast-top-right { - top: 12px; - right: 12px; -} - -.toast-bottom-right { - right: 12px; - bottom: 12px; -} - -.toast-bottom-left { - bottom: 12px; - left: 12px; -} - -#toast-container { - pointer-events: none; - position: fixed; - z-index: 99999; -} - -#toast-container * { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -#toast-container>div { - position: relative; - overflow: hidden; - margin: 0 0 6px; - padding: 15px 15px 15px 50px; - width: 300px; - -moz-border-radius: 3px 3px 3px 3px; - -webkit-border-radius: 3px 3px 3px 3px; - border-radius: 3px 3px 3px 3px; - background-position: 15px center; - background-repeat: no-repeat; - -moz-box-shadow: 0 0 12px #999999; - -webkit-box-shadow: 0 0 12px #999999; - box-shadow: 0 0 12px #999999; - color: #FFFFFF; - opacity: 0.8; -} - -#toast-container>div.toast-custom { - padding: 15px; - color: #030303; -} - -#toast-container>div.toast-custom .toast-close-button { - color: #999999 !important; -} - -#toast-container> :hover { - -moz-box-shadow: 0 0 12px #000000; - -webkit-box-shadow: 0 0 12px #000000; - box-shadow: 0 0 12px #000000; - opacity: 1; - cursor: pointer; -} - -#toast-container>.toast-info { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; -} - -#toast-container>.toast-error { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; -} - -#toast-container>.toast-success { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; -} - -#toast-container>.toast-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; -} - -#toast-container.toast-top-center>div, -#toast-container.toast-bottom-center>div { - width: 300px; - margin: auto; -} - -#toast-container.toast-top-full-width>div, -#toast-container.toast-bottom-full-width>div { - width: 96%; - margin: auto; -} - -.toast { - background-color: #FFFFFF; - pointer-events: auto; -} - -.toast-success { - background-color: #51A351; -} - -.toast-error { - background-color: #BD362F; -} - -.toast-info { - background-color: #2F96B4; -} - -.toast-warning { - background-color: #F89406; -} - -.toast-progress { - position: absolute; - left: 0; - bottom: 0; - height: 4px; - background-color: #000000; - opacity: 0.4; -} - -/*Responsive Design*/ -@media all and (max-width: 240px) { - #toast-container>div { - padding: 8px 8px 8px 50px; - width: 11em; - } - - #toast-container .toast-close-button { - right: -0.2em; - top: -0.2em; - } -} - -@media all and (min-width: 241px) and (max-width: 480px) { - #toast-container>div { - padding: 8px 8px 8px 50px; - width: 18em; - } - - #toast-container .toast-close-button { - right: -0.2em; - top: -0.2em; - } -} - -@media all and (min-width: 481px) and (max-width: 768px) { - #toast-container>div { - padding: 15px 15px 15px 50px; - width: 25em; - } -} diff --git a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html deleted file mode 100644 index 026ce9c3..00000000 --- a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -
-
- -
- {{item.message | translate}} -
-
-
diff --git a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.spec.ts b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.spec.ts deleted file mode 100644 index 23ca1a46..00000000 --- a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { ToastrNotificationComponent } from "./toastr-notification.component"; - -describe("ToastrNotificationComponent", () => { - let component: ToastrNotificationComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ToastrNotificationComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ToastrNotificationComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.ts b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.ts deleted file mode 100644 index 1d4f526a..00000000 --- a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ============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========================================================= - */ - -/** - * This component is to display the notification. - * - * @author Ekko Chang - * - */ - -import { Component, OnInit } from "@angular/core"; -import { - Notification, - NotificationType -} from "src/app/core/models/toastr-notification.model"; -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -@Component({ - selector: "app-toastr-notification", - templateUrl: "./toastr-notification.component.html", - styleUrls: ["./toastr-notification.component.css"] -}) -export class ToastrNotificationComponent implements OnInit { - notifications: Notification[] = []; - - constructor(public _notificationService: ToastrNotificationService) {} - - ngOnInit() { - this._notificationService.getAlert().subscribe((alert: Notification) => { - this.notifications = []; - if (!alert) { - this.notifications = []; - return; - } - this.notifications.push(alert); - setTimeout(() => { - this.notifications = this.notifications.filter(x => x !== alert); - }, 5000); - }); - } - - removeNotification(notification: Notification) { - this.notifications = this.notifications.filter(x => x !== notification); - } - - /* - Set css class for Alert -- Called from alert component - */ - cssClass(notification: Notification) { - if (!notification) { - return; - } - switch (notification.type) { - case NotificationType.Success: - return "toast-success"; - case NotificationType.Error: - return "toast-error"; - case NotificationType.Info: - return "toast-info"; - case NotificationType.Warning: - return "toast-warning"; - } - } -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css deleted file mode 100644 index 7af4051a..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -input::-webkit-input-placeholder{ - color: #A8A9AC; -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html deleted file mode 100644 index 5fdc45a1..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html +++ /dev/null @@ -1,129 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts deleted file mode 100644 index 6fa809d5..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CreateDashboardComponent } from './create-dashboard.component'; - -describe('CreateDashboardComponent', () => { - let component: CreateDashboardComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CreateDashboardComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CreateDashboardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts deleted file mode 100644 index 991826cc..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import {Component, OnInit, Input, Output, ViewChild, EventEmitter, ElementRef} from '@angular/core'; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Dashboard } from "src/app/core/models/dashboard.model"; -import { AdminService } from "src/app/core/services/admin.service"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -@Component({ - selector: 'app-create-dashboard', - templateUrl: './create-dashboard.component.html', - styleUrls: ['./create-dashboard.component.css'] -}) -export class CreateDashboardComponent implements OnInit { - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService, - public restApiService: RestApiService, - ) {} - - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() dashboard: Dashboard; - @Input() nameArr; - tempDb: Dashboard; - - selectshow = false; - tempDbNameTitle = null; - - @ViewChild("t_dataDashboardName") t_dataDashboardName: ElementRef; - - ngOnInit() { - // cache for display - - console.log(this.dashboard); - this.tempDb = new Dashboard(); - if(this.dashboard.enabled==undefined){ - this.dashboard.enabled = true; - } - const feeds = { - name: this.dashboard.name, - host: this.dashboard.host, - port: this.dashboard.port, - login: this.dashboard.login, - pass: this.dashboard.pass, - enabled: this.dashboard.enabled, - }; - console.log(feeds); - this.tempDb = feeds; - this.tempDbNameTitle = this.dashboard.host - } - - - - passBack() { - if(this.tempDb.host == null && this.tempDb.port == null && this.tempDb.login == null && this.tempDb.pass == null){ - return false; - } - this.dashboard = this.tempDb; - this.dashboard.name = this.t_dataDashboardName.nativeElement.value; - console.log(this.dashboard,"this.dashboard output"); - this.passEntry.emit(this.dashboard); - } - -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css deleted file mode 100644 index 69d9710a..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -.db-block { - min-width: 180px; - min-height: 180px; - padding: 10px; -} -.db-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; - position: relative; - font-family: "Open Sans", sans-serif; - font-weight: 600; - font-size: 18px; - color: #313032; - text-align: center; - padding: 10px; -} -.db-dropdown { - background-color: #ffffff; -} - -.db-dropdown:hover { - background-color: #ffffff; -} - -.db-config-icon { - color: #5DBEBB; - background-color: #ffffff; -} - -.db-config-icon:hover { - background-color: #D2D3D5; -} - -.dropdown-item { - font-family: "Open Sans", sans-serif; - font-weight: 400; - font-size: 14px; -} -.dropdown-menu.action-btn{ - min-width: 2rem!important; - left: -70px!important; -} -.truecheck{ - color:#5DBEBB -} -.falsecheck{ - color:#BDBEC0 -} -.maskShow{ - position: absolute; -} -.deleteDisplay{ -background: rgba(222, 222, 222, 0.48); -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html deleted file mode 100644 index 316dee54..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html +++ /dev/null @@ -1,181 +0,0 @@ - -
-
- {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.DASHBOARDLIST" | translate}} -
-
- -
- - -
-
-
- - -
-
- -
- - - - - - - - - - -
- -
- - - - - -
- -
- - - - - - - - -
- - -
- - - - - - - - - - - - - -
- - -
- - - - - - - - - -
-
- -
- - {{ db.name }} -
-
- -
-
-
-
diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts deleted file mode 100644 index d0e59ce4..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DashboardListComponent } from './dashboard-list.component'; - -describe('DashboardListComponent', () => { - let component: DashboardListComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ DashboardListComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DashboardListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts deleted file mode 100644 index 17a6b2ea..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; -import { Dashboard } from "../../core/models/dashboard.model"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; -import { CreateDashboardComponent } from "./create-dashboard/create-dashboard.component"; - -import { AdminService } from "../../core/services/admin.service"; - -// DB modal components -import { RestApiService } from "src/app/core/services/rest-api.service"; - -// Notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -@Component({ - selector: 'app-dashboard-list', - templateUrl: './dashboard-list.component.html', - styleUrls: ['./dashboard-list.component.css'] -}) -export class DashboardListComponent implements OnInit { - @Output() passEntry: EventEmitter = new EventEmitter(); - dbList: any = []; - dbs: Dashboard[] = []; - - loading: Boolean = true; - - tempDbDetail: Dashboard; - dashboardDeteleModelShow = true; - - // nameArr = []; - - constructor( - private adminService: AdminService, - private dashboardApiService: RestApiService, - private notificationService: ToastrNotificationService, - private modalService: NgbModal, - private spinner: NgxSpinnerService - ) { - // Set page title - this.adminService.setTitle("SIDEBAR.DASHBOARDLIST"); - this.initList(); - - } - - ngOnInit() { - this.spinner.show(); - } - initList() { - this.initData().then(data => { - this.initDbsList(this.dbList).then(data => { - this.dbs = data; - console.log(this.dbs, "dasboard-dbs[]") - }); - }); - } - - async initData() { - this.dbList = []; - this.dbList = await this.getDbList(); - setTimeout(() => { - this.spinner.hide(); - }, 500); - } - - getDbList() { - var data: any; - data = this.dashboardApiService.getDashboardList().toPromise(); - return data; - } - - async initDbsList(dbList: []) { - var d: Dashboard[] = []; - - if (dbList.length > 0) { - for (var i = 0; i < dbList.length; i++) { - let data = dbList[i]; - let feed = { - name: data["name"], - host: data["host"], - port: data["port"], - login: data["login"], - pass: data["pass"], - enabled: data["enabled"] - }; - d.push(feed); - } - } - return d; - } - - openDashboardModal(thisIndex: number) { - var modalRef, index; - index = thisIndex; - console.log(index, "index,add or edit"); - modalRef = this.modalService.open(CreateDashboardComponent, { - size: "lg", - centered: true - }); - modalRef.componentInstance.dashboard = this.dbs[index]; - modalRef.componentInstance.passEntry.subscribe(receiveEntry => { - this.dbs[index] = receiveEntry; - let host = this.dbs[index].host; - let enabled = this.dbs[index].enabled; - console.log(receiveEntry); - if (enabled == true) { - // Db name found, to update db - this.dashboardApiService.createUpadteDashboard(this.dbs[index]).subscribe( - res => { - console.log(res); - if (res.statusCode == 200) { - this.initList(); - this.notificationService.success("SUCCESSFULLY_UPDATED"); - } else { - this.notificationService.error("FAILED_UPDATED"); - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - } else { - this.dashboardApiService.deleteDashboard(this.dbs[thisIndex]).subscribe( - res => { - console.log(res); - if (res.statusCode == 200) { - this.initList(); - this.notificationService.success("SUCCESSFULLY_DELETED"); - } else { - this.dbs[thisIndex].enabled = true; - this.notificationService.error("FAILED_DELETED"); - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - - } - - }); - } -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css deleted file mode 100644 index 424c839b..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html deleted file mode 100644 index 134e2fc1..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -
-
- Home > Dashboard List -
-
- - diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts deleted file mode 100644 index 10886c12..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DashboardSettingComponent } from './dashboard-setting.component'; - -describe('DashboardSettingComponent', () => { - let component: DashboardSettingComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ DashboardSettingComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DashboardSettingComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts deleted file mode 100644 index 26efe645..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { Component, OnInit } from '@angular/core'; -@Component({ - selector: 'app-dashboard-setting', - templateUrl: './dashboard-setting.component.html', - styleUrls: ['./dashboard-setting.component.css'] -}) -export class DashboardSettingComponent implements OnInit { - - constructor() {} - - ngOnInit() { - } - -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css deleted file mode 100644 index 7bd79547..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -#f-file{ - position: absolute; - width: 100%; - height: 90%; - opacity: 0; - cursor: pointer; -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html deleted file mode 100644 index 4165de8d..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html +++ /dev/null @@ -1,156 +0,0 @@ - -
- - - -
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts deleted file mode 100644 index de3dc540..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EditTemplateModalComponent } from './edit-template-modal.component'; - -describe('EditTemplateModalComponent', () => { - let component: EditTemplateModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EditTemplateModalComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(EditTemplateModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts deleted file mode 100644 index a6b7be9f..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { - Component, - OnInit, - Input, - Output, - EventEmitter, - ViewChild, - ElementRef -} from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { Template } from "src/app/core/models/template.model"; - -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -@Component({ - selector: 'app-edit-template-modal', - templateUrl: './edit-template-modal.component.html', - styleUrls: ['./edit-template-modal.component.css'] -}) -export class EditTemplateModalComponent implements OnInit { - @Input() edittemplate: Template; - templateInput: Template; - defaultDesigntype: String; - defaultTopicname: String; - templatetypedata: Array = []; - topicname: Array = []; - dbList: Array = []; - tempSeletedDbs: any = []; - @Output() passEntry: EventEmitter = new EventEmitter(); - - @ViewChild("templatetype") templatetype: ElementRef; - @ViewChild("topic") topic: ElementRef; - - constructor( - public activeModal: NgbActiveModal, - public dashboardApiService: RestApiService, - private spinner: NgxSpinnerService, - ) { } - - inputtemplateName = null; - templateInputTitle = ""; - fileName = null; - - ngOnInit() { - // cache for display - this.templateInput = new Template(); - this.getDbList(); - const feed = { - id: this.edittemplate.id, - name: this.edittemplate.name, - submitted: this.edittemplate.submitted, - body: this.edittemplate.body, - note: this.edittemplate.note, - topicName: this.edittemplate.topicName, - designType: this.edittemplate.designType, - designTypeName: this.edittemplate.designTypeName, - dbs: this.edittemplate.dbs, - }; - this.templateInput = feed; - this.templateInputTitle = "" + this.edittemplate.name; - this.tempSeletedDbs = this.templateInput.dbs.map(item => { return Number(item) }); - - this.getTopicName(); - this.getTemplateTypeName(); - } - getTopicName() { - this.dashboardApiService.getTopicsFromFeeder().subscribe(data => { - this.topicname = data; - }); - } - - getDbList() { - this.dashboardApiService.getTempDbList().subscribe(data => { - Object.keys(data).map(item => { - this.dbList.push({ key: item, name: data[item] }) - }) - }); - } - - updateSelectedDB(event: any, name: any) { - if (event.target.checked) { - if (!this.tempSeletedDbs.find(db => db === name)) { - this.tempSeletedDbs.push(Number(name.key)); - } - } else { - const index = this.tempSeletedDbs.indexOf(+name.key, 0); - if (index > -1) { - this.tempSeletedDbs.splice(index, 1); - } - } - } - - getTemplateTypeName() { - this.dashboardApiService.getTemplateTypeName().subscribe(data => { - this.templatetypedata = data; - this.getDefaultOptions(); - }); - } - - getDefaultOptions() { - this.templatetypedata.map(item => { - if (item.id === this.templateInput.designType) { - return this.defaultDesigntype = item.name; - } - }); - this.defaultTopicname = this.templateInput.topicName; - } - - jsReadFiles() { - var thiss = this; - var file = (document.querySelector("#f-file")).files[0]; - this.fileName = file.name; - var reader = new FileReader(); - reader.onload = function () { - thiss.templateInput.body = String(this.result); - } - reader.readAsText(file); - } - - passBack() { - this.spinner.show(); - if (this.templateInput.name == '' || this.templateInput.name == undefined) { - return false; - } - this.edittemplate = this.templateInput; - // this.templatetypedata.map(item => { - // if (item.name === this.templatetype.nativeElement.value) { - // return this.edittemplate.designType = item.id; - // } - // }); - this.edittemplate.designType = this.templatetypedata.filter(item => { - return item.name === this.templatetype.nativeElement.value; - })[0].id || ""; - - this.edittemplate.designTypeName = this.templatetype.nativeElement.value; - this.edittemplate.topicName = this.topic.nativeElement.value; - this.edittemplate.dbs = this.tempSeletedDbs; - this.passEntry.emit(this.edittemplate); - setTimeout(() => { - this.spinner.hide(); - }, 500); - } -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css deleted file mode 100644 index 7bd79547..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -#f-file{ - position: absolute; - width: 100%; - height: 90%; - opacity: 0; - cursor: pointer; -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html deleted file mode 100644 index 40d0755e..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html +++ /dev/null @@ -1,157 +0,0 @@ - -
- - - - -
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts deleted file mode 100644 index 29df2b1a..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NewTemplateModalComponent } from './new-template-modal.component'; - -describe('NewTemplateModalComponent', () => { - let component: NewTemplateModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ NewTemplateModalComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(NewTemplateModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts deleted file mode 100644 index 496d08a1..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { - Component, - OnInit, - Input, - Output, - EventEmitter, - ViewChild, - ElementRef -} from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -import { Template } from "src/app/core/models/template.model"; - -@Component({ - selector: 'app-new-template-modal', - templateUrl: './new-template-modal.component.html', - styleUrls: ['./new-template-modal.component.css'] -}) -export class NewTemplateModalComponent implements OnInit { - @Input() template: Template; - @Input() templatelist_length; - templateInput: Template - templatetypedata: Array = []; - topicname: Array = []; - dbList: Array = []; - tempSeletedDbs: any = []; - @Output() passEntry: EventEmitter = new EventEmitter(); - @ViewChild("templatetype") templatetype: ElementRef; - @ViewChild("topic") topic: ElementRef; - - constructor( - public activeModal: NgbActiveModal, - public dashboardApiService: RestApiService, - private spinner: NgxSpinnerService, - ) { } - inputtemplateName = null; - templatebody = null; - fileName = null; - - ngOnInit() { - this.getTopicName(); - this.getTemplateTypeName(); - this.getDbList(); - // cache for display - this.templateInput = new Template(); - const feed = { - id: null, - name: this.template.name, - submitted: this.template.submitted, - body: this.template.body, - note: this.template.note, - topicName: this.template.topicName, - designType: this.template.designType, - designTypeName: this.template.designTypeName, - dbs: [], - }; - this.templateInput = feed; - } - getTopicName() { - this.dashboardApiService.getTopicsFromFeeder().subscribe(data => { - this.topicname = data; - }); - } - - getDbList() { - this.dashboardApiService.getTempDbList().subscribe(data => { - Object.keys(data).map(item => { - this.dbList.push({ key: item, name: data[item] }) - }) - }); - } - - getTemplateTypeName() { - this.dashboardApiService.getTemplateTypeName().subscribe(data => { - this.templatetypedata = data; - }); - } - - updateSelectedDB(event: any, name: any) { - if (event.target.checked) { - if (!this.tempSeletedDbs.find(db => db === name)) { - this.tempSeletedDbs.push(name.key); - } - } else { - const index = this.tempSeletedDbs.indexOf(name.key, 0); - if (index > -1) { - this.tempSeletedDbs.splice(index, 1); - } - } - } - - jsReadFiles() { - var thiss = this; - var file = (document.querySelector("#f-file")).files[0]; - this.fileName = file.name; - var reader = new FileReader(); - reader.onload = function () { - // console.log(this.result, "this.result"); - thiss.templateInput.body = String(this.result); - } - reader.readAsText(file); - } - passBack() { - this.spinner.show(); - if (this.templateInput.name == '' || this.templateInput.name == undefined) { - return false; - } - this.template = this.templateInput; - - // this.templatetypedata.map(item => { - // if (item.name === this.templatetype.nativeElement.value) { - // return this.template.designType = item.id; - // } - // }) - - this.template.designType = this.templatetypedata.filter(item => { - return item.name === this.templatetype.nativeElement.value; - })[0].id || ""; - - this.template.designTypeName = this.templatetype.nativeElement.value; - this.template.topicName = this.topic.nativeElement.value; - this.template.dbs = this.tempSeletedDbs; - this.template.submitted = false; - this.template.note = ""; - this.passEntry.emit(this.template); - setTimeout(() => { - this.spinner.hide(); - }, 500); - } -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css deleted file mode 100644 index 47ab70e5..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -.topic-list-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; - } diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html deleted file mode 100644 index 4a93ec65..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html +++ /dev/null @@ -1,112 +0,0 @@ - -
-
-
-
- -
-
- -
- -
-
-
- - -
- -
-
-
-
- -
-
- - - - - - - - - - - - - - {{ row.name }} - - - - - - {{ row.designTypeName }} - - - - - - {{ row.topicName }} - - - - -
- -   {{ 'DEPLOY' | translate }}   - -
-
- - - - - - - - - -
-
-
-
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts deleted file mode 100644 index 10a43a46..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TemplateListComponent } from './template-list.component'; - -describe('TemplateListComponent', () => { - let component: TemplateListComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TemplateListComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TemplateListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts deleted file mode 100644 index 8da33f00..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; -import { Template } from "src/app/core/models/template.model"; -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -// modal -import { NewTemplateModalComponent } from "./new-template-modal/new-template-modal.component"; -import { EditTemplateModalComponent } from "./edit-template-modal/edit-template-modal.component"; -import { AlertComponent } from "src/app/core/alert/alert.component"; -// notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -@Component({ - selector: 'app-template-list', - templateUrl: './template-list.component.html', - styleUrls: ['./template-list.component.css'] -}) -export class TemplateListComponent { - template_list: any = []; - templates: Template[] = []; - temps: Template[] = []; - Template_New: Template; - Template_Newbody: Template; - dashboardDeteleModelShow = true; - loadingIndicator: boolean = true; - mesgNoData = { - emptyMessage: ` -
-
- -
-
- ` - }; - @ViewChild("searchText") searchText: ElementRef; - constructor( - private modalService: NgbModal, - private dashboardApiService: RestApiService, - private spinner: NgxSpinnerService, - private notificationService: ToastrNotificationService, - ) { - setTimeout(() => { - this.loadingIndicator = false; - }, 5000); - - this.initData().then(data => { - this.initTemplateList(this.template_list).then( - data => { - // for cache of datatable - this.temps = [...data]; - this.templates = data; - setTimeout(() => { - this.spinner.hide(); - }, 500); - } - ); - }); - } - - ngOnInit() { - this.spinner.show(); - } - - async initData() { - this.template_list = []; - this.template_list = await this.getTemplateList(); - this.Template_New = new Template(); - this.Template_Newbody = new Template(); - return true; - } - - - getTemplateList() { - return this.dashboardApiService.getTemplateAll().toPromise(); - } - - async initTemplateList(template_list: []) { - var t: Template[] = []; - for (var i = 0; i < template_list.length; i++) { - let data = template_list[i]; - let feed = { - id: data["id"], - name: data["name"], - submitted: data["submitted"], - body: data["body"], - note: data["note"], - topicName: data["topicName"], - designType: data["designType"], - designTypeName: data["designTypeName"], - dbs: data["dbs"], - }; - t.push(feed); - } - return t; - } - - newTemplateModal() { - const modalRef = this.modalService.open(NewTemplateModalComponent, { - windowClass: "dl-md-modal templatess", - centered: true - }); - this.Template_New = new Template(); - this.Template_Newbody = new Template(); - modalRef.componentInstance.template = this.Template_Newbody; - modalRef.componentInstance.templatelist_length = this.template_list.length; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - this.Template_Newbody = receivedEntry; - this.dashboardApiService - .createNewTemplate(this.Template_Newbody) - .subscribe( - res => { - if (res.statusCode == 200) { - this.Template_New = res.returnBody; - this.template_list.push(this.Template_New); - this.template_list = [...this.template_list]; - this.notificationService.success("SUCCESSFULLY_CREARED"); - } else { - this.notificationService.error("FAILED_CREARED"); - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - }); - } - - onActivate(event) { - const emitType = event.type; - if (emitType == "dblclick") { - let id = event.row.id; - this.editTemplateModal(id); - } - - } - - editTemplateModal(id) { - const index = this.template_list.findIndex(t => t.id === id); - const modalRef = this.modalService.open(EditTemplateModalComponent, { - windowClass: "dl-md-modal templatess", - centered: true - }); - modalRef.componentInstance.edittemplate = this.template_list[index]; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - this.Template_New = receivedEntry; - this.dashboardApiService - .updateNewTemplate(this.Template_New) - .subscribe( - res => { - if (res.statusCode == 200) { - this.template_list[index] = this.Template_New; - this.template_list = [...this.template_list]; - this.notificationService.success("SUCCESSFULLY_UPDATED"); - } else { - this.notificationService.error("FAILED_UPDATED"); - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - }) - } - - deleteTemplateModel(id: number) { - const index = this.template_list.findIndex(t => t.id === id); - const modalRef = this.modalService.open(AlertComponent, { - size: "sm", - centered: true - }); - // modalRef.componentInstance.dashboardDeteleModelShow = this.dashboardDeteleModelShow; - modalRef.componentInstance.message = "ARE_YOU_SURE_DELETE"; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - // Delete database - this.dashboardApiService.DeleteTemplate(id).subscribe( - res => { - if (JSON.stringify(res).length <= 2) { - this.template_list.splice(index, 1); - this.template_list = [...this.template_list]; - this.notificationService.success("SUCCESSFULLY_DELETED"); - } else { - this.notificationService.error("FAILED_DELETED"); - } - - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - }); - - } - - deployTemplate(id: number) { - const index = this.template_list.findIndex(t => t.id === id); - const body = this.template_list[index]; - this.spinner.show(); - this.dashboardApiService.deployTemplateKibana(id, body).subscribe( - res => { - this.spinner.hide(); - if (JSON.stringify(res).length <= 2) { - this.notificationService.success("Deploy_SUCCESSFULLY"); - } else { - this.notificationService.error("Deploy_FAILED"); - } - }, - err => { - this.spinner.hide(); - this.notificationService.error(err); - } - ); - } - - updateFilter(searchValue) { - const val = searchValue.toLowerCase(); - // filter our data - const temps = this.temps.filter(function (d) { - return d.name.toLowerCase().indexOf(val) !== -1 || !val; - }); - // update the rows - this.template_list = temps; - } - - -} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css deleted file mode 100644 index 424c839b..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html deleted file mode 100644 index 2aede51d..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html +++ /dev/null @@ -1,23 +0,0 @@ - -
-
- {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.TEMPLATE" | translate}} -
-
- -
-
diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts deleted file mode 100644 index 21428a84..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TemplateComponent } from './template.component'; - -describe('TemplateComponent', () => { - let component: TemplateComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TemplateComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TemplateComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts deleted file mode 100644 index cb761deb..00000000 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { Component, OnInit } from '@angular/core'; -import {AdminService} from "../../core/services/admin.service"; - -@Component({ - selector: 'app-template', - templateUrl: './template.component.html', - styleUrls: ['./template.component.css'] -}) -export class TemplateComponent implements OnInit { - - constructor(private adminService: AdminService) { - // Set page title - this.adminService.setTitle("SIDEBAR.TEMPLATE"); - } - - ngOnInit() { - } - -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.css deleted file mode 100644 index ac205fe8..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.css +++ /dev/null @@ -1,40 +0,0 @@ -/* -* ============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========================================================= -*/ - - - -.nav-pills .nav-link.active, -.nav-pills .nav-link:hover { - color: #ffffff; - background-color: #5DBEBB; -} - -.nav-link { - font-family: "Open Sans", sans-serif; - font-weight: 400; - font-size: 14px; - color: #313449; - text-align: left; - border-radius: 0px; -} - -.nav-pills .show>.nav-link { - background-color: #FFFFFF; -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html deleted file mode 100644 index 490bf49e..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html +++ /dev/null @@ -1,123 +0,0 @@ - - -
- - - -
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.spec.ts deleted file mode 100644 index bde10b2c..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DatabaseAddModalComponent } from "./database-add-modal.component"; - -describe("DatabaseAddModalComponent", () => { - let component: DatabaseAddModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [DatabaseAddModalComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DatabaseAddModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.ts deleted file mode 100644 index 3f47bdd1..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; - -@Component({ - selector: "app-database-add-modal", - templateUrl: "./database-add-modal.component.html", - styleUrls: ["./database-add-modal.component.css"] -}) -export class DatabaseAddModalComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - seletedItem: string = ""; - - constructor(public activeModal: NgbActiveModal) {} - - ngOnInit() {} - - clickItem(name: string) { - this.seletedItem = name; - } - - passBack() { - this.passEntry.emit(this.seletedItem); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.css deleted file mode 100644 index 15261b48..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.css +++ /dev/null @@ -1,63 +0,0 @@ -/* -* ============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========================================================= -*/ - - - -.db-block { - min-width: 180px; - min-height: 180px; - padding: 10px; -} - -.db-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; - position: relative; - font-family: "Open Sans", sans-serif; - font-weight: 600; - font-size: 18px; - color: #313032; - text-align: center; - padding: 10px; -} - -.db-dropdown { - background-color: #ffffff; -} - -.db-dropdown:hover { - background-color: #ffffff; -} - -.db-config-icon { - color: #5DBEBB; - background-color: #ffffff; -} - -.db-config-icon:hover { - background-color: #D2D3D5; -} - -.dropdown-item { - font-family: "Open Sans", sans-serif; - font-weight: 400; - font-size: 14px; -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html deleted file mode 100644 index 829d6c62..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html +++ /dev/null @@ -1,235 +0,0 @@ - - -
- -
-
-
-
-
- -
- - - - - -
- - -
- - - - - - - - -
- - -
- - - - - - - - - - - - - -
- - -
- - - - - - - - - -
- - -
- - - - - - - - - - -
-
-
- - {{ db.name }} -
-
- -
-
-
-
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.spec.ts deleted file mode 100644 index 8c104fd4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DatabaseListComponent } from "./database-list.component"; - -describe("DatabaseListComponent", () => { - let component: DatabaseListComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [DatabaseListComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DatabaseListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts deleted file mode 100644 index 556e9f97..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts +++ /dev/null @@ -1,229 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, OnInit, ViewChild, ElementRef } from "@angular/core"; -import { Db } from "../../core/models/db.model"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; -import { DatabaseAddModalComponent } from "./database-add-modal/database-add-modal.component"; - -// DB modal components -import { RestApiService } from "src/app/core/services/rest-api.service"; - -// Modal -import { CouchbaseComponent } from "./dbs-modal/couchbase/couchbase.component"; -import { DruidComponent } from "./dbs-modal/druid/druid.component"; -import { ElasticsearchComponent } from "./dbs-modal/elasticsearch/elasticsearch.component"; -import { MongodbComponent } from "./dbs-modal/mongodb/mongodb.component"; -import { HdfsComponent } from "./dbs-modal/hdfs/hdfs.component"; -import { AlertComponent } from "src/app/core/alert/alert.component"; - -// Notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -@Component({ - selector: "app-database-list", - templateUrl: "./database-list.component.html", - styleUrls: ["./database-list.component.css"] -}) -export class DatabaseListComponent implements OnInit { - pageFinished: Boolean = false; - - dbList: any = []; - dbs: Db[] = []; - - loading: Boolean = true; - - tempDbDetail: Db; - - constructor( - private restApiService: RestApiService, - private notificationService: ToastrNotificationService, - private modalService: NgbModal, - private spinner: NgxSpinnerService - ) { - this.initData().then(data => { - this.initDbsList(this.dbList).then(data => { - this.dbs = data; - }); - }); - } - - ngOnInit() { - this.spinner.show(); - } - - async initData() { - this.dbList = []; - this.dbList = await this.getDbList(); - setTimeout(() => { - this.spinner.hide(); - }, 500); - } - - getDbList() { - var data: any; - - data = this.restApiService.getDbList().toPromise(); - - return data; - } - - async initDbsList(dbList: []) { - var d: Db[] = []; - - if (dbList.length > 0) { - for (var i = 0; i < dbList.length; i++) { - let data = await this.getDbDetail(dbList[i]); - let feed = { - name: dbList[i], - enabled: data.enabled, - host: data.host, - port: data.port, - database: data.database, - encrypt: data.encrypt, - login: data.login, - pass: data.pass - }; - d.push(feed); - } - } - return d; - } - - getDbDetail(name: string) { - return this.restApiService.getDbDetail(name).toPromise(); - } - - openAddModal() { - const modalRef = this.modalService.open(DatabaseAddModalComponent, { - windowClass: "dl-md-modal", - centered: true - }); - - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - if (receivedEntry) { - modalRef.close(); - this.openDetailModal(receivedEntry); - } - }); - } - - openDetailModal(name: string) { - var modalRef, index; - - switch (name) { - case "Couchbase": { - modalRef = this.modalService.open(CouchbaseComponent, { - size: "lg", - centered: true - }); - break; - } - case "Druid": { - modalRef = this.modalService.open(DruidComponent, { - size: "lg", - centered: true - }); - break; - } - case "Elasticsearch": { - modalRef = this.modalService.open(ElasticsearchComponent, { - size: "lg", - centered: true - }); - break; - } - case "MongoDB": { - modalRef = this.modalService.open(MongodbComponent, { - size: "lg", - centered: true - }); - break; - } - case "HDFS": { - modalRef = this.modalService.open(HdfsComponent, { - size: "lg", - centered: true - }); - break; - } - default: { - break; - } - } - - index = this.dbs.findIndex(d => d.name === name); - this.tempDbDetail = new Db(); - if (index != -1) { - modalRef.componentInstance.db = this.dbs[index]; - } else { - modalRef.componentInstance.db = this.tempDbDetail; - } - modalRef.componentInstance.passEntry.subscribe(receiveEntry => { - this.tempDbDetail = receiveEntry; - let enabled = receiveEntry.enabled; - console.log(this.tempDbDetail,"this.tempDbDetail"); - if(enabled == true){ - this.restApiService.upadteDb(this.tempDbDetail).subscribe( - res => { - console.log(res); - if (res.statusCode == 200) { - this.dbs[index] = this.tempDbDetail; - this.notificationService.success("SUCCESSFULLY_UPDATED"); - }else { - this.notificationService.error("FAILED_UPDATED"); - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - }else { - this.restApiService.upadteDb(this.dbs[index]).subscribe( - res => { - console.log(res); - if (res.statusCode == 200) { - this.dbs[index] = this.tempDbDetail; - this.notificationService.success("SUCCESSFULLY_DELETED"); - }else { - this.dbs[index].encrypt = true; - } - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - } - }); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.html deleted file mode 100644 index c67ab85c..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.html +++ /dev/null @@ -1,146 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts deleted file mode 100644 index e3de0b45..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { CouchbaseComponent } from "./couchbase.component"; - -describe("CouchbaseComponent", () => { - let component: CouchbaseComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [CouchbaseComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CouchbaseComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.ts deleted file mode 100644 index 5e11900b..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/couchbase/couchbase.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Db } from "src/app/core/models/db.model"; -import { AdminService } from "src/app/core/services/admin.service"; - -@Component({ - selector: "app-couchbase", - templateUrl: "./couchbase.component.html", - styleUrls: ["./couchbase.component.css"] -}) -export class CouchbaseComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() db: Db; - tempDb: Db; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService - ) {} - - ngOnInit() { - // cache for display - this.tempDb = new Db(); - const feed = { - name: "Couchbase", - enabled: this.db.enabled, - host: this.db.host, - port: this.db.port, - database: this.db.database, - encrypt: this.db.encrypt, - login: this.db.login, - pass: this.db.pass - }; - this.tempDb = feed; - } - - passBack() { - this.db = this.tempDb; - this.passEntry.emit(this.db); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.html deleted file mode 100644 index 5d5a38cf..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.html +++ /dev/null @@ -1,146 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.spec.ts deleted file mode 100644 index 833fa410..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DruidComponent } from "./druid.component"; - -describe("DruidComponent", () => { - let component: DruidComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [DruidComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DruidComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.ts deleted file mode 100644 index 43bd0ed4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/druid/druid.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Db } from "src/app/core/models/db.model"; -import { AdminService } from "src/app/core/services/admin.service"; - -@Component({ - selector: "app-druid", - templateUrl: "./druid.component.html", - styleUrls: ["./druid.component.css"] -}) -export class DruidComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() db: Db; - tempDb: Db; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService - ) {} - - ngOnInit() { - // cache for display - this.tempDb = new Db(); - const feed = { - name: "Druid", - enabled: this.db.enabled, - host: this.db.host, - port: this.db.port, - database: this.db.database, - encrypt: this.db.encrypt, - login: this.db.login, - pass: this.db.pass - }; - this.tempDb = feed; - } - - passBack() { - this.db = this.tempDb; - this.passEntry.emit(this.db); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html deleted file mode 100644 index 1a7e7e80..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html +++ /dev/null @@ -1,136 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts deleted file mode 100644 index 57798da3..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { ElasticsearchComponent } from "./elasticsearch.component"; - -describe("ElasticsearchComponent", () => { - let component: ElasticsearchComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ElasticsearchComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ElasticsearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts deleted file mode 100644 index bbecea56..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Db } from "src/app/core/models/db.model"; -import { AdminService } from "src/app/core/services/admin.service"; - -@Component({ - selector: "app-elasticsearch", - templateUrl: "./elasticsearch.component.html", - styleUrls: ["./elasticsearch.component.css"] -}) -export class ElasticsearchComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() db: Db; - tempDb: Db; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService - ) {} - - ngOnInit() { - // cache for display - this.tempDb = new Db(); - const feed = { - name: "Elasticsearch", - enabled: this.db.enabled, - host: this.db.host, - port: this.db.port, - database: this.db.database, - encrypt: this.db.encrypt, - login: this.db.login, - pass: this.db.pass - }; - this.tempDb = feed; - } - - passBack() { - this.db = this.tempDb; - this.passEntry.emit(this.db); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.html deleted file mode 100644 index 39b905b3..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.html +++ /dev/null @@ -1,136 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts deleted file mode 100644 index dafbdadc..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { HdfsComponent } from "./H./hdfs.component - -describe("HdfsComponent", () => { - let component: HdfsComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [HdfsComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HdfsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.ts deleted file mode 100644 index 034e2902..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/hdfs/hdfs.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Db } from "src/app/core/models/db.model"; -import { AdminService } from "src/app/core/services/admin.service"; - -@Component({ - selector: "app-hdfs", - templateUrl: "./hdfs.component.html", - styleUrls: ["./hdfs.component.css"] -}) -export class HdfsComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() db: Db; - tempDb: Db; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService - ) {} - - ngOnInit() { - // cache for display - this.tempDb = new Db(); - const feed = { - name: "HDFS", - enabled: this.db.enabled, - host: this.db.host, - port: this.db.port, - database: this.db.database, - encrypt: this.db.encrypt, - login: this.db.login, - pass: this.db.pass - }; - this.tempDb = feed; - } - - passBack() { - this.db = this.tempDb; - this.passEntry.emit(this.db); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.css b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.html deleted file mode 100644 index 48dc0516..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.html +++ /dev/null @@ -1,146 +0,0 @@ - - -
- - - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts deleted file mode 100644 index a9ff1b8d..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { MongodbComponent } from "./mongodb.component"; - -describe("MongodbComponent", () => { - let component: MongodbComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [MongodbComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MongodbComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.ts deleted file mode 100644 index 05a1526a..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database-list/dbs-modal/mongodb/mongodb.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Input, Output, EventEmitter } from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { Db } from "src/app/core/models/db.model"; -import { AdminService } from "src/app/core/services/admin.service"; - -@Component({ - selector: "app-mongodb", - templateUrl: "./mongodb.component.html", - styleUrls: ["./mongodb.component.css"] -}) -export class MongodbComponent { - @Output() passEntry: EventEmitter = new EventEmitter(); - @Input() db: Db; - tempDb: Db; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService - ) {} - - ngOnInit() { - // cache for display - this.tempDb = new Db(); - const feed = { - name: "MongoDB", - enabled: this.db.enabled, - host: this.db.host, - port: this.db.port, - database: this.db.database, - encrypt: this.db.encrypt, - login: this.db.login, - pass: this.db.pass - }; - this.tempDb = feed; - } - - passBack() { - this.db = this.tempDb; - this.passEntry.emit(this.db); - } -} diff --git a/components/datalake-handler/admin/src/src/app/database/database.component.css b/components/datalake-handler/admin/src/src/app/database/database.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/database/database.component.html b/components/datalake-handler/admin/src/src/app/database/database.component.html deleted file mode 100644 index 5ba0e314..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database.component.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -
-
- Home > Database Connections -
-
- - diff --git a/components/datalake-handler/admin/src/src/app/database/database.component.spec.ts b/components/datalake-handler/admin/src/src/app/database/database.component.spec.ts deleted file mode 100644 index a2a7e8db..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DatabaseComponent } from "./database.component"; - -describe("DatabaseComponent", () => { - let component: DatabaseComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [DatabaseComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DatabaseComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/database/database.component.ts b/components/datalake-handler/admin/src/src/app/database/database.component.ts deleted file mode 100644 index 67f35f9a..00000000 --- a/components/datalake-handler/admin/src/src/app/database/database.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, OnInit } from "@angular/core"; -import { AdminService } from "../core/services/admin.service"; - -@Component({ - selector: "app-database", - templateUrl: "./database.component.html", - styleUrls: ["./database.component.css"] -}) -export class DatabaseComponent implements OnInit { - constructor(private adminService: AdminService) { - this.adminService.setTitle("SIDEBAR.DATABASE"); - } - - ngOnInit() {} -} diff --git a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.css b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.css deleted file mode 100644 index 9f2bcedc..00000000 --- a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.css +++ /dev/null @@ -1,47 +0,0 @@ -/* -* ============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========================================================= -*/ - -.dashboard-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; - position: relative; - width: 100%; - height: 100%; -} - -.dashboard-panel .feeder-title { - color: #5DBEBB; - letter-spacing: 1.79px; - text-align: left; - margin: 20px 0 -10px 20px; -} - -.dashboard-panel .feeder-info { - text-align: center; - align-items: center; - vertical-align: middle; - min-height: 180px; -} - -.dashboard-panel .feeder-info-font { - color: #313032; - letter-spacing: 5px; -} diff --git a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.html b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.html deleted file mode 100644 index 64ba834c..00000000 --- a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -
-
- Home > DataLake Feeder -
-
- -
-
-
-
-
- Topics -
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
diff --git a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.spec.ts b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.spec.ts deleted file mode 100644 index b5ee7ecd..00000000 --- a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { FeederComponent } from "./feeder.component"; - -describe("FeederComponent", () => { - let component: FeederComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [FeederComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FeederComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts deleted file mode 100644 index f5d05bb7..00000000 --- a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, OnInit } from "@angular/core"; -import { AdminService } from "src/app/core/services/admin.service"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { HeaderComponent } from "src/app/header/header.component"; - -// notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; - -@Component({ - selector: "app-feeder", - templateUrl: "./feeder.component.html", - styleUrls: ["./feeder.component.css"] -}) -export class FeederComponent implements OnInit { - topicContent: string = ""; - - constructor( - private adminService: AdminService, - private restApiService: RestApiService, - private notificationService: ToastrNotificationService, - private spinner: NgxSpinnerService - ) { - this.adminService.setTitle("SIDEBAR.FEDDFER"); - this.restApiService.getTopicsFromFeeder().subscribe( - res => { - this.topicContent = res.length.toString(); - setTimeout(() => { - this.spinner.hide(); - }, 500); - }, - err => { - this.topicContent = "No Data"; - this.notificationService.error(err); - setTimeout(() => { - this.spinner.hide(); - }, 500); - } - ); - } - - ngOnInit() { - this.spinner.show(); - } - - chkTopicContent() { - if (this.topicContent == "No Data") { - return false; - } else { - return true; - } - } -} diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.css b/components/datalake-handler/admin/src/src/app/header/header.component.css deleted file mode 100644 index d6d32ca4..00000000 --- a/components/datalake-handler/admin/src/src/app/header/header.component.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============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========================================================= -*/ diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.html b/components/datalake-handler/admin/src/src/app/header/header.component.html deleted file mode 100644 index 304879ee..00000000 --- a/components/datalake-handler/admin/src/src/app/header/header.component.html +++ /dev/null @@ -1,43 +0,0 @@ - - -
-
- {{ title | translate }} -
- - -
- -
- -
- -
- -
-
-
diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.spec.ts b/components/datalake-handler/admin/src/src/app/header/header.component.spec.ts deleted file mode 100644 index f2e1afbb..00000000 --- a/components/datalake-handler/admin/src/src/app/header/header.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { HeaderComponent } from "./header.component"; - -describe("HeaderComponent", () => { - let component: HeaderComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [HeaderComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HeaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.ts b/components/datalake-handler/admin/src/src/app/header/header.component.ts deleted file mode 100644 index 629c19e5..00000000 --- a/components/datalake-handler/admin/src/src/app/header/header.component.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, Output } from "@angular/core"; -import { AdminService } from "../core/services/admin.service"; -import { TranslateService } from "@ngx-translate/core"; -import { Feeder } from "src/app/core/models/feeder.model"; -import { RestApiService } from "src/app/core/services/rest-api.service"; - -// notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -@Component({ - selector: "app-header", - templateUrl: "./header.component.html", - styleUrls: ["./header.component.css"] -}) -export class HeaderComponent { - title = "PageTitle"; - feeder: any = []; - - selectedLang: String; - langs: Array = [ - { value: "en-us", name: "EN" }, - { value: "zh-hans", name: "中文(简)" }, - { value: "zh-hant", name: "中文(繁)" } - ]; - - constructor( - private adminService: AdminService, - private restApiService: RestApiService, - private notificationService: ToastrNotificationService, - private translateService: TranslateService - ) { - this.translateService.setDefaultLang("en-us"); - } - - ngOnInit() { - this.adminService.title.subscribe(title => { - this.title = title; - }); - this.selectedLang = this.translateService.defaultLang; - - if ((this.title = "SIDEBAR.FEDDFER")) { - this.restApiService.getFeederstatus().subscribe((data: {}) => { - this.feeder = new Feeder(); - this.feeder = data; - }); - } - } - - changeLanguage(lang: string) { - this.translateService.use(lang); - } - - changeFeederStatus() { - if (this.feeder.running) { - this.restApiService.startFeeder().subscribe( - res => { - this.notificationService.success("Success start feeder."); - }, - err => { - this.feeder.running = false; - this.notificationService.error(err); - } - ); - } else { - this.restApiService.stopFeeder().subscribe( - res => { - this.notificationService.success("Success stop feeder."); - }, - err => { - this.feeder.running = true; - this.notificationService.error(err); - } - ); - } - } - - /* - * Feeder - */ - getFeederStatus() { - return this.restApiService.getFeederstatus().toPromise(); - } - - setFeederStatus(status: string) { - var data; - - switch (status) { - case "start": - data = true; - console.log("start feeder"); - break; - case "stop": - data = false; - console.log("stop feeder"); - break; - } - - return data; - } -} diff --git a/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.css b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.css new file mode 100644 index 00000000..46d72a44 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.css @@ -0,0 +1,31 @@ +/* +* ============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========================================================= +*/ + + +.alert-msg { + font-family: "Open Sans", sans-serif; + font-weight: 600; + font-size: 14px; + text-align: center; +} + +.alert-icon { + color: rgb(244, 166, 10); +} diff --git a/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.html b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.html new file mode 100644 index 00000000..75c5b9d5 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.html @@ -0,0 +1,66 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.spec.ts new file mode 100644 index 00000000..b1f05154 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { AlertComponent } from "./alert.component"; + +describe("AlertComponent", () => { + let component: AlertComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AlertComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AlertComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.ts b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.ts new file mode 100644 index 00000000..3774ec35 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/alert/alert.component.ts @@ -0,0 +1,46 @@ +/* + * ============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========================================================= + */ + +/** + * This component is a modal window to alert message. + * + * @author Ekko Chang + * + */ + +import { Component, EventEmitter, Input, Output } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; + +@Component({ + selector: "app-alert", + templateUrl: "./alert.component.html", + styleUrls: ["./alert.component.css"] +}) +export class AlertComponent { + @Input() message: string; + @Input() dashboardDeteleModelShow; + @Output() passEntry: EventEmitter = new EventEmitter(); + + constructor(public activeModal: NgbActiveModal) { } + + passBack() { + this.passEntry.emit(true); + } +} diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.css b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.css new file mode 100644 index 00000000..d28364f4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.css @@ -0,0 +1,252 @@ +/* +* ============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========================================================= +*/ + + + +.toast-title { + font-weight: bold; +} + +.toast-message { + word-wrap: break-word; +} + +.toast-message a, +.toast-message label { + color: #FFFFFF; +} + +.toast-message a:hover { + color: #CCCCCC; + text-decoration: none; +} + +.toast-close-button { + position: relative; + right: -0.3em; + top: -0.3em; + float: right; + font-size: 20px; + font-weight: bold; + color: #FFFFFF; + -webkit-text-shadow: 0 1px 0 #ffffff; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.8; +} + +.toast-close-button:hover, +.toast-close-button:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; +} + +/*Additional properties for button version +iOS requires the button element instead of an anchor tag. +If you want the anchor version, it requires `href="#"`.*/ +button.toast-close-button { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + +.toast-top-center { + top: 0; + right: 0; + width: 100%; +} + +.toast-bottom-center { + bottom: 0; + right: 0; + width: 100%; +} + +.toast-top-full-width { + top: 0; + right: 0; + width: 100%; +} + +.toast-bottom-full-width { + bottom: 0; + right: 0; + width: 100%; +} + +.toast-top-left { + top: 12px; + left: 12px; +} + +.toast-top-right { + top: 12px; + right: 12px; +} + +.toast-bottom-right { + right: 12px; + bottom: 12px; +} + +.toast-bottom-left { + bottom: 12px; + left: 12px; +} + +#toast-container { + pointer-events: none; + position: fixed; + z-index: 99999; +} + +#toast-container * { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +#toast-container>div { + position: relative; + overflow: hidden; + margin: 0 0 6px; + padding: 15px 15px 15px 50px; + width: 300px; + -moz-border-radius: 3px 3px 3px 3px; + -webkit-border-radius: 3px 3px 3px 3px; + border-radius: 3px 3px 3px 3px; + background-position: 15px center; + background-repeat: no-repeat; + -moz-box-shadow: 0 0 12px #999999; + -webkit-box-shadow: 0 0 12px #999999; + box-shadow: 0 0 12px #999999; + color: #FFFFFF; + opacity: 0.8; +} + +#toast-container>div.toast-custom { + padding: 15px; + color: #030303; +} + +#toast-container>div.toast-custom .toast-close-button { + color: #999999 !important; +} + +#toast-container> :hover { + -moz-box-shadow: 0 0 12px #000000; + -webkit-box-shadow: 0 0 12px #000000; + box-shadow: 0 0 12px #000000; + opacity: 1; + cursor: pointer; +} + +#toast-container>.toast-info { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; +} + +#toast-container>.toast-error { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; +} + +#toast-container>.toast-success { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; +} + +#toast-container>.toast-warning { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; +} + +#toast-container.toast-top-center>div, +#toast-container.toast-bottom-center>div { + width: 300px; + margin: auto; +} + +#toast-container.toast-top-full-width>div, +#toast-container.toast-bottom-full-width>div { + width: 96%; + margin: auto; +} + +.toast { + background-color: #FFFFFF; + pointer-events: auto; +} + +.toast-success { + background-color: #51A351; +} + +.toast-error { + background-color: #BD362F; +} + +.toast-info { + background-color: #2F96B4; +} + +.toast-warning { + background-color: #F89406; +} + +.toast-progress { + position: absolute; + left: 0; + bottom: 0; + height: 4px; + background-color: #000000; + opacity: 0.4; +} + +/*Responsive Design*/ +@media all and (max-width: 240px) { + #toast-container>div { + padding: 8px 8px 8px 50px; + width: 11em; + } + + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } +} + +@media all and (min-width: 241px) and (max-width: 480px) { + #toast-container>div { + padding: 8px 8px 8px 50px; + width: 18em; + } + + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } +} + +@media all and (min-width: 481px) and (max-width: 768px) { + #toast-container>div { + padding: 15px 15px 15px 50px; + width: 25em; + } +} diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.html b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.html new file mode 100644 index 00000000..026ce9c3 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.html @@ -0,0 +1,29 @@ + + + +
+
+ +
+ {{item.message | translate}} +
+
+
diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.spec.ts new file mode 100644 index 00000000..23ca1a46 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { ToastrNotificationComponent } from "./toastr-notification.component"; + +describe("ToastrNotificationComponent", () => { + let component: ToastrNotificationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ToastrNotificationComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ToastrNotificationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.ts b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.ts new file mode 100644 index 00000000..a704fb9a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.component.ts @@ -0,0 +1,81 @@ +/* + * ============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========================================================= + */ + +/** + * This component is to display the notification. + * + * @author Ekko Chang + * + */ + +import { Component, OnInit } from "@angular/core"; +import { + Notification, + NotificationType +} from "src/app/core/models/toastr-notification.model"; +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +@Component({ + selector: "app-toastr-notification", + templateUrl: "./toastr-notification.component.html", + styleUrls: ["./toastr-notification.component.css"] +}) +export class ToastrNotificationComponent implements OnInit { + notifications: Notification[] = []; + + constructor(public _notificationService: ToastrNotificationService) { } + + ngOnInit() { + this._notificationService.getAlert().subscribe((alert: Notification) => { + this.notifications = []; + if (!alert) { + this.notifications = []; + return; + } + this.notifications.push(alert); + setTimeout(() => { + this.notifications = this.notifications.filter(x => x !== alert); + }, 5000); + }); + } + + removeNotification(notification: Notification) { + this.notifications = this.notifications.filter(x => x !== notification); + } + + /* + Set css class for Alert -- Called from alert component + */ + cssClass(notification: Notification) { + if (!notification) { + return; + } + switch (notification.type) { + case NotificationType.Success: + return "toast-success"; + case NotificationType.Error: + return "toast-error"; + case NotificationType.Info: + return "toast-info"; + case NotificationType.Warning: + return "toast-warning"; + } + } +} diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.spec.ts b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.spec.ts new file mode 100644 index 00000000..1cda6a51 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.spec.ts @@ -0,0 +1,34 @@ +/* + * ============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 { TestBed } from "@angular/core/testing"; + +import { ToastrNotificationService } from "./toastr-notification.service"; + +describe("ToastrNotificationService", () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it("should be created", () => { + const service: ToastrNotificationService = TestBed.get( + ToastrNotificationService + ); + expect(service).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.ts b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.ts new file mode 100644 index 00000000..5419d070 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/components/toastr-notification/toastr-notification.service.ts @@ -0,0 +1,94 @@ +/* + * ============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 { Injectable } from "@angular/core"; +import { Router, NavigationStart } from "@angular/router"; +import { Observable, Subject } from "rxjs"; +import { + Notification, + NotificationType +} from "src/app/core/models/toastr-notification.model"; + +@Injectable({ + providedIn: "root" +}) +export class ToastrNotificationService { + public subject = new Subject(); + public keepAfterRouteChange = true; + + constructor(public router: Router) { + router.events.subscribe(event => { + if (event instanceof NavigationStart) { + if (this.keepAfterRouteChange) { + // only keep for a single route change + this.keepAfterRouteChange = false; + } else { + // clear alert messages + this.clear(); + } + } + }); + } + + getAlert(): Observable { + return this.subject.asObservable(); + } + + success(message: string, keepAfterRouteChange = false) { + this.showNotification( + NotificationType.Success, + message, + keepAfterRouteChange + ); + } + + error(message: string, keepAfterRouteChange = false) { + this.showNotification( + NotificationType.Error, + message, + keepAfterRouteChange + ); + } + + info(message: string, keepAfterRouteChange = false) { + this.showNotification(NotificationType.Info, message, keepAfterRouteChange); + } + + warn(message: string, keepAfterRouteChange = false) { + this.showNotification( + NotificationType.Warning, + message, + keepAfterRouteChange + ); + } + + showNotification( + type: NotificationType, + message: string, + keepAfterRouteChange = false + ) { + this.keepAfterRouteChange = keepAfterRouteChange; + this.subject.next({ type: type, message: message }); + } + + clear() { + this.subject.next(); + } +} diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.css b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html new file mode 100644 index 00000000..304879ee --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html @@ -0,0 +1,43 @@ + + +
+
+ {{ title | translate }} +
+ + +
+ +
+ +
+ +
+ +
+
+
diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.spec.ts new file mode 100644 index 00000000..f2e1afbb --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { HeaderComponent } from "./header.component"; + +describe("HeaderComponent", () => { + let component: HeaderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HeaderComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts new file mode 100644 index 00000000..8c39ec18 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts @@ -0,0 +1,126 @@ +/* + * ============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 + * + */ + +import { Component, Output } from "@angular/core"; +import { AdminService } from "../../../core/services/admin.service"; +import { TranslateService } from "@ngx-translate/core"; +import { Feeder } from "src/app/core/models/feeder.model"; +import { RestApiService } from "src/app/core/services/rest-api.service"; + +// notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +@Component({ + selector: "app-header", + templateUrl: "./header.component.html", + styleUrls: ["./header.component.css"] +}) +export class HeaderComponent { + title = "PageTitle"; + feeder: any = []; + + selectedLang: String; + langs: Array = [ + { value: "en-us", name: "EN" }, + { value: "zh-hans", name: "中文(简)" }, + { value: "zh-hant", name: "中文(繁)" } + ]; + + constructor( + private adminService: AdminService, + private restApiService: RestApiService, + private notificationService: ToastrNotificationService, + private translateService: TranslateService + ) { + this.translateService.setDefaultLang("en-us"); + } + + ngOnInit() { + this.adminService.title.subscribe(title => { + this.title = title; + }); + this.selectedLang = this.translateService.defaultLang; + + if ((this.title = "SIDEBAR.FEDDFER")) { + this.restApiService.getFeederstatus().subscribe((data: {}) => { + this.feeder = new Feeder(); + this.feeder = data; + }); + } + } + + changeLanguage(lang: string) { + this.translateService.use(lang); + } + + changeFeederStatus() { + if (this.feeder.running) { + this.restApiService.startFeeder().subscribe( + res => { + this.notificationService.success("Success start feeder."); + }, + err => { + this.feeder.running = false; + this.notificationService.error(err); + } + ); + } else { + this.restApiService.stopFeeder().subscribe( + res => { + this.notificationService.success("Success stop feeder."); + }, + err => { + this.feeder.running = true; + this.notificationService.error(err); + } + ); + } + } + + /* + * Feeder + */ + getFeederStatus() { + return this.restApiService.getFeederstatus().toPromise(); + } + + setFeederStatus(status: string) { + var data; + + switch (status) { + case "start": + data = true; + console.log("start feeder"); + break; + case "stop": + data = false; + console.log("stop feeder"); + break; + } + + return data; + } +} diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.css b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.css new file mode 100644 index 00000000..21d4bf74 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.css @@ -0,0 +1,25 @@ +/* +* ============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========================================================= +*/ +.navbar-nav-nohover:hover{ + background: transparent!important; +} +.navbar-nav-nohover:hover li{ + background: transparent!important; +} diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html new file mode 100644 index 00000000..cf0a24e6 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html @@ -0,0 +1,80 @@ + + + diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.spec.ts new file mode 100644 index 00000000..3ee29d74 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { SidebarComponent } from "./sidebar.component"; + +describe("SidebarComponent", () => { + let component: SidebarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SidebarComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SidebarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.ts b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.ts new file mode 100644 index 00000000..0973d4d0 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.ts @@ -0,0 +1,40 @@ +/* + * ============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 + * + */ + +import { Component, OnInit } from "@angular/core"; + +@Component({ + selector: "app-sidebar", + templateUrl: "./sidebar.component.html", + styleUrls: ["./sidebar.component.css"] +}) +export class SidebarComponent implements OnInit { + constructor() {} + + ngOnInit() {} + + dashboard = false; +} diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.css b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.html b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.html new file mode 100644 index 00000000..0f9abc54 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.html @@ -0,0 +1,3 @@ +

+ card works! +

diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.spec.ts new file mode 100644 index 00000000..e141708a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CardComponent } from './card.component'; + +describe('CardComponent', () => { + let component: CardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.ts b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.ts new file mode 100644 index 00000000..4e934bc8 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/card/card.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-card', + templateUrl: './card.component.html', + styleUrls: ['./card.component.css'] +}) +export class CardComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.css b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.html b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.html new file mode 100644 index 00000000..0b81c38f --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.html @@ -0,0 +1,3 @@ +

+ modal works! +

diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.spec.ts new file mode 100644 index 00000000..fc32a90f --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ModalComponent } from './modal.component'; + +describe('ModalComponent', () => { + let component: ModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.ts b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.ts new file mode 100644 index 00000000..15c22508 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/modal/modal.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-modal', + templateUrl: './modal.component.html', + styleUrls: ['./modal.component.css'] +}) +export class ModalComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.css b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.html b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.html new file mode 100644 index 00000000..25363490 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.html @@ -0,0 +1,3 @@ +

+ search works! +

diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.spec.ts new file mode 100644 index 00000000..43729199 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SearchComponent } from './search.component'; + +describe('SearchComponent', () => { + let component: SearchComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SearchComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.ts b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.ts new file mode 100644 index 00000000..c708abe6 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/search/search.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-search', + templateUrl: './search.component.html', + styleUrls: ['./search.component.css'] +}) +export class SearchComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.css b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.css new file mode 100644 index 00000000..e69de29b 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 new file mode 100644 index 00000000..38e41676 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.html @@ -0,0 +1,3 @@ +

+ table works! +

diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.spec.ts b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.spec.ts new file mode 100644 index 00000000..cdbacbc6 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TableComponent } from './table.component'; + +describe('TableComponent', () => { + let component: TableComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.ts b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.ts new file mode 100644 index 00000000..7e97f375 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/modules/table/table.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-table', + templateUrl: './table.component.html', + styleUrls: ['./table.component.css'] +}) +export class TableComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/shared/utils/utils.js b/components/datalake-handler/admin/src/src/app/shared/utils/utils.js new file mode 100644 index 00000000..c996d6bf --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/shared/utils/utils.js @@ -0,0 +1 @@ +//put some general functions here. Enjoy \ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css deleted file mode 100644 index 21d4bf74..00000000 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css +++ /dev/null @@ -1,25 +0,0 @@ -/* -* ============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========================================================= -*/ -.navbar-nav-nohover:hover{ - background: transparent!important; -} -.navbar-nav-nohover:hover li{ - background: transparent!important; -} diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html deleted file mode 100644 index cf0a24e6..00000000 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html +++ /dev/null @@ -1,80 +0,0 @@ - - - diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.spec.ts b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.spec.ts deleted file mode 100644 index 3ee29d74..00000000 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { SidebarComponent } from "./sidebar.component"; - -describe("SidebarComponent", () => { - let component: SidebarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [SidebarComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SidebarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts deleted file mode 100644 index 0973d4d0..00000000 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, OnInit } from "@angular/core"; - -@Component({ - selector: "app-sidebar", - templateUrl: "./sidebar.component.html", - styleUrls: ["./sidebar.component.css"] -}) -export class SidebarComponent implements OnInit { - constructor() {} - - ngOnInit() {} - - dashboard = false; -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.css b/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.css deleted file mode 100644 index 424c839b..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.html b/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.html deleted file mode 100644 index c45b8fdb..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.html +++ /dev/null @@ -1,229 +0,0 @@ - - -
- - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts deleted file mode 100644 index 536f3a9e..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NewTopicModelComponent } from './new-topic-model.component'; - -describe('NewTopicModelComponent', () => { - let component: NewTopicModelComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ NewTopicModelComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(NewTopicModelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.ts deleted file mode 100644 index 91be8d0a..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/new-topic-model/new-topic-model.component.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. - - 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. -*/ -import { - Component, - OnInit, - Input, - Output, - EventEmitter, - ViewChild, - ElementRef -} from "@angular/core"; -import {NgbActiveModal} from "@ng-bootstrap/ng-bootstrap"; -import {RestApiService} from "src/app/core/services/rest-api.service"; -import {AdminService} from "src/app/core/services/admin.service"; -import {Topic} from "src/app/core/models/topic.model"; - -@Component({ - selector: 'app-new-topic-model', - templateUrl: './new-topic-model.component.html', - styleUrls: ['./new-topic-model.component.css'] -}) -export class NewTopicModelComponent implements OnInit { - @Input() newTopic: Topic; - @Output() passEntry: EventEmitter = new EventEmitter(); - TopicInput: Topic; - // page elements - dbs: any = []; - dataFormats: Array = ["JSON", "XML"]; - tempSeletedDbs: any = []; - idExFields: Array = []; - idExNewField: any = {}; - @ViewChild("t_topicname") t_topicname: ElementRef; - @ViewChild("t_login") t_login: ElementRef; - @ViewChild("t_password") t_password: ElementRef; - @ViewChild("t_dataFormat") t_dataFormat: ElementRef; - @ViewChild("t_ttl") t_ttl: ElementRef; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService, - private restApiService: RestApiService - ) { - this.getDbs(); - } - - ngOnInit() { - this.newTopic = { - name: "", - login: "", - password:"", - sinkdbs: [], - enabled: false, - saveRaw: false, - dataFormat: this.dataFormats[0], - ttl: null, - correlateClearedMessage: false, - messageIdPath: null, - type:null - }; - this.TopicInput = new Topic(); - const feeds = { - name: this.newTopic.name, - login: this.newTopic.login, - password:this.newTopic.password, - sinkdbs: this.newTopic.sinkdbs, - enabled: this.newTopic.enabled, - saveRaw: this.newTopic.saveRaw, - dataFormat: this.newTopic.dataFormat, - ttl: this.newTopic.ttl, - correlateClearedMessage: this.newTopic.correlateClearedMessage, - messageIdPath: this.newTopic.messageIdPath, - type:null - }; - this.TopicInput = feeds; - this. idExFields = []; - if (this.TopicInput.messageIdPath != null) { - var feed = this.TopicInput.messageIdPath.split(","); - for (var i = 0; i < feed.length; i++) { - var data = { item: feed[i] }; - this.idExFields.push(data); - } - } else { - this.idExFields.push([]); - } - } - - getDbs() { - this.dbs = []; - this.restApiService.getDbList().subscribe((data: {}) => { - this.dbs = data; - }); - } - - updateSelectedDB(event: any, name: string) { - if (event.target.checked) { - if (!this.tempSeletedDbs.find(db => db === name)) { - this.tempSeletedDbs.push(name); - } - } else { - const index = this.tempSeletedDbs.indexOf(name, 0); - if (index > -1) { - this.tempSeletedDbs.splice(index, 1); - } - } - } - - addIdField() { - this.idExFields.push(this.idExNewField); - this.idExNewField = {}; - } - - deleteIdField(index: number) { - if (this.idExFields.length > 1) { - this.idExFields.splice(index, 1); - } - } - - passBack() { - this.newTopic = this.TopicInput; - this.newTopic.name = this.t_topicname.nativeElement.value; - this.newTopic.login = this.t_login.nativeElement.value; - this.newTopic.password = this.t_password.nativeElement.value; - this.newTopic.sinkdbs = this.tempSeletedDbs; - this.newTopic.dataFormat = this.t_dataFormat.nativeElement.value; - this.newTopic.ttl = this.t_ttl.nativeElement.value; - this.newTopic.messageIdPath = ""; - for (var i = 0; i < this.idExFields.length; i++) { - let item = "/"+this.idExFields[i].item; - if (i == 0) { - this.newTopic.messageIdPath = item; - } else { - this.newTopic.messageIdPath = - this.newTopic.messageIdPath + "," + item; - } - } - // Reset to default - if (this.newTopic.sinkdbs.length == 0) { - return false; - } - console.log(this.newTopic); - this.passEntry.emit(this.newTopic); - } - -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.css b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.html b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.html deleted file mode 100644 index bfa3f572..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.html +++ /dev/null @@ -1,164 +0,0 @@ - - -
- - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts deleted file mode 100644 index 9c3ec518..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TopicConfigModalComponent } from './topic-config-modal.component'; - -describe('TopicConfigModalComponent', () => { - let component: TopicConfigModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TopicConfigModalComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TopicConfigModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.ts deleted file mode 100644 index b67dff19..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-config-modal/topic-config-modal.component.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * ============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 - * - */ - -import { - Component, - OnInit, - Input, - Output, - EventEmitter, - ViewChild, - ElementRef -} from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { AdminService } from "src/app/core/services/admin.service"; -import { Topic } from "src/app/core/models/topic.model"; - -@Component({ - selector: "app-topic-config-modal", - templateUrl: "./topic-config-modal.component.html", - styleUrls: ["./topic-config-modal.component.css"] -}) -export class TopicConfigModalComponent implements OnInit { - @Input() topic: Topic; - @Input() title: string; - @Output() passEntry: EventEmitter = new EventEmitter(); - - // page elements - dbs: any = []; - dataFormats: Array = ["JSON", "XML"]; - tempSeletedDbs: any = []; - tempEnabled: boolean; - tempSaveRaw: boolean; - @ViewChild("t_login") t_login: ElementRef; - @ViewChild("t_password") t_password: ElementRef; - @ViewChild("t_dataFormat") t_dataFormat: ElementRef; - @ViewChild("t_ttl") t_ttl: ElementRef; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService, - private restApiService: RestApiService - ) { - this.getDbs(); - } - - ngOnInit() { - // for display - this.topic.sinkdbs.forEach(item => { - this.tempSeletedDbs.push(item); - }); - this.tempEnabled = this.topic.enabled; - this.tempSaveRaw = this.topic.saveRaw; - } - - getDbs() { - this.dbs = []; - this.restApiService.getDbList().subscribe((data: {}) => { - this.dbs = data; - }); - } - - updateSelectedDB(event: any, name: string) { - if (event.target.checked) { - if (!this.tempSeletedDbs.find(db => db === name)) { - this.tempSeletedDbs.push(name); - } - } else { - const index = this.tempSeletedDbs.indexOf(name, 0); - if (index > -1) { - this.tempSeletedDbs.splice(index, 1); - } - } - } - - passBack() { - this.topic.enabled = this.tempEnabled; - this.topic.login = this.t_login.nativeElement.value; - this.topic.password = this.t_password.nativeElement.value; - this.topic.sinkdbs = this.tempSeletedDbs; - this.topic.dataFormat = this.t_dataFormat.nativeElement.value; - this.topic.ttl = this.t_ttl.nativeElement.value; - this.topic.saveRaw = this.tempSaveRaw; - - this.passEntry.emit(this.topic); - } -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html deleted file mode 100644 index fa07903b..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html +++ /dev/null @@ -1,223 +0,0 @@ - - -
- - - - - -
diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts deleted file mode 100644 index ee6fcad3..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TopicDetailModalComponent } from './topic-detail-modal.component'; - -describe('TopicDetailModalComponent', () => { - let component: TopicDetailModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TopicDetailModalComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TopicDetailModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts deleted file mode 100644 index e2dd1825..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* - * ============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 - * - */ - -import { - Component, - OnInit, - Input, - Output, - EventEmitter, - ViewChild, - ElementRef -} from "@angular/core"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { AdminService } from "src/app/core/services/admin.service"; -import { Topic } from "src/app/core/models/topic.model"; - -@Component({ - selector: "app-topic-detail-modal", - templateUrl: "./topic-detail-modal.component.html", - styleUrls: ["./topic-detail-modal.component.css"] -}) -export class TopicDetailModalComponent implements OnInit { - @Input() topic: Topic; - @Output() passEntry: EventEmitter = new EventEmitter(); - - // page elements - dbs: any = []; - dataFormats: Array = ["JSON", "XML"]; - tempSeletedDbs: any = []; - tempEnabled: boolean; - tempSaveRaw: boolean; - tempMsg: boolean; - idExFields: Array = []; - idExNewField: any = {}; - @ViewChild("t_login") t_login: ElementRef; - @ViewChild("t_password") t_password: ElementRef; - @ViewChild("t_dataFormat") t_dataFormat: ElementRef; - @ViewChild("t_ttl") t_ttl: ElementRef; - - constructor( - public activeModal: NgbActiveModal, - public adminService: AdminService, - private restApiService: RestApiService - ) { - this.getDbs(); - } - ngOnInit() { - // for display - this.topic.sinkdbs.forEach(item => { - this.tempSeletedDbs.push(item); - }); - this.tempEnabled = this.topic.enabled; - this.tempSaveRaw = this.topic.saveRaw; - this.tempMsg = this.topic.correlateClearedMessage; - this.idExFields = []; - - if (this.topic.messageIdPath != null) { - var feed = this.topic.messageIdPath.split(","); - for (var i = 0; i < feed.length; i++) { - var data = { item: feed[i] }; - this.idExFields.push(data); - } - } else { - this.idExFields.push([]); - } - } - - getDbs() { - this.dbs = []; - this.restApiService.getDbList().subscribe((data: {}) => { - this.dbs = data; - }); - } - - updateSelectedDB(event: any, name: string) { - if (event.target.checked) { - if (!this.tempSeletedDbs.find(db => db === name)) { - this.tempSeletedDbs.push(name); - } - } else { - const index = this.tempSeletedDbs.indexOf(name, 0); - if (index > -1) { - this.tempSeletedDbs.splice(index, 1); - } - } - } - - addIdField() { - this.idExFields.push(this.idExNewField); - this.idExNewField = {}; - } - - deleteIdField(index: number) { - if (this.idExFields.length > 1) { - this.idExFields.splice(index, 1); - } - } - - passBack() { - this.topic.enabled = this.tempEnabled; - this.topic.login = this.t_login.nativeElement.value; - this.topic.password = this.t_password.nativeElement.value; - - this.topic.sinkdbs = this.tempSeletedDbs; - - this.topic.dataFormat = this.t_dataFormat.nativeElement.value; - this.topic.ttl = this.t_ttl.nativeElement.value; - this.topic.saveRaw = this.tempSaveRaw; - this.topic.correlateClearedMessage = this.tempMsg; - this.topic.messageIdPath = ""; - for (var i = 0; i < this.idExFields.length; i++) { - if (i == 0) { - this.topic.messageIdPath = this.idExFields[i].item; - } else { - this.topic.messageIdPath = - this.topic.messageIdPath + "," + this.idExFields[i].item; - } - } - - // Reset to default - if (this.topic.sinkdbs.length == 0) { - this.topic.type = false; - } else { - this.topic.type = true; - } - this.passEntry.emit(this.topic); - } -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.css b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.css deleted file mode 100644 index bb3e0e80..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.css +++ /dev/null @@ -1,5 +0,0 @@ -.topic-list-panel { - background: #FFFFFF; - box-shadow: 3px 3px 11px 0 #D2D3D5; - border-radius: 20px; -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html deleted file mode 100644 index 519cc9da..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html +++ /dev/null @@ -1,728 +0,0 @@ - - -
-
-
-
- -
-
- -
- -
-
-
- - -
- - -
-
-
-
- - -
-
- - - -
- - - - - - - - -
-
- - - - {{ row.name }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ row.ttl }} - - - - -
- - - - - - - - -
-
- - -
- - - - - - - - -
-
- - - -   {{ 'CONFIGURED' | translate }}   -   {{ 'UNCONFIGURED' | translate }}   - - - - - - - - - - - - - -
- total: {{ rowCount.toLocaleString() }} -
- - -
-
-
-
-
-
diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.spec.ts deleted file mode 100644 index 531afbb7..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from "@angular/core/testing"; - -import { TopicListComponent } from "./topic-list.component"; - -describe("TopicListComponent", () => { - let component: TopicListComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [TopicListComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TopicListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.ts b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.ts deleted file mode 100644 index 8f22307d..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.ts +++ /dev/null @@ -1,407 +0,0 @@ -/* - * ============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 - * - */ - -import { Component, ViewChild, ElementRef } from "@angular/core"; -import { RestApiService } from "src/app/core/services/rest-api.service"; -import { Topic } from "src/app/core/models/topic.model"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; - -// modal -import { TopicDetailModalComponent } from "./topic-detail-modal/topic-detail-modal.component"; -import { TopicConfigModalComponent } from "./topic-config-modal/topic-config-modal.component"; -import { NewTopicModelComponent } from "./new-topic-model/new-topic-model.component"; - -// notify -import { ToastrNotificationService } from "src/app/core/services/toastr-notification.service"; - -// Loading spinner -import { NgxSpinnerService } from "ngx-spinner"; -import {AlertComponent} from "../../core/alert/alert.component"; - -@Component({ - selector: "app-topic-list", - templateUrl: "./topic-list.component.html", - styleUrls: ["./topic-list.component.css"] -}) -export class TopicListComponent { - topicListDmaap: any = []; - topicListFeeder: any = []; - topicDefaultConfig: Topic; - - topics: Topic[] = []; - temp: Topic[] = []; // cache for topics - tempTopicDetail: Topic; // temp for a topic - tempNewTopic: Topic; // temp for a newtopic - - loadingIndicator: boolean = true; - mesgNoData = { - emptyMessage: ` -
-
- -
-
- ` - }; - - @ViewChild("searchText") searchText: ElementRef; - @ViewChild("mydatatable") topicTable; - - constructor( - private restApiService: RestApiService, - private modalService: NgbModal, - private notificationService: ToastrNotificationService, - private spinner: NgxSpinnerService - ) { - setTimeout(() => { - this.loadingIndicator = false; - }, 5000); - this.init() - - } - - ngOnInit() { - this.spinner.show(); - } - - init(){ - this.initData().then(data => { - this.initTopicList(this.topicListDmaap, this.topicListFeeder).then( - data => { - // for cache of datatable - this.temp = [...data]; - this.topics = data; - setTimeout(() => { - this.spinner.hide(); - }, 500); - } - ); - }); - } - - async initData() { - this.topicListDmaap = []; - this.topicListDmaap = await this.getTopicList("dmaap"); - - this.topicListFeeder = []; - this.topicListFeeder = await this.getTopicList("feeder"); - - this.topicDefaultConfig = new Topic(); - this.topicDefaultConfig = await this.getTopicDefaultConfig(); - - return true; - } - - getTopicList(type: string) { - var data: any; - - switch (type) { - case "dmaap": { - data = this.restApiService.getTopicsFromDmaap().toPromise(); - break; - } - case "feeder": { - data = this.restApiService.getTopicsFromFeeder().toPromise(); - break; - } - } - return data; - } - - getTopicDefaultConfig() { - return this.restApiService.getTopicDefaultConfig().toPromise(); - } - - 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 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 - }; - t.push(feed); - } - } - - return t; - } - - onActivate(event) { - const emitType = event.type; - if(emitType == "dblclick"){ - console.log('Activate Event', event); - let name = event.row.name; - this.openTopicModal(name); - } - - } - - openNewTopicModal(){ - const modalRef = this.modalService.open(NewTopicModelComponent, { - size: "lg", - centered: true - }); - modalRef.componentInstance.newTopic = this.tempNewTopic; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - console.log(receivedEntry,"newtopic receivedEntry"); - this.tempNewTopic = receivedEntry; - this.restApiService.addNewTopic(this.tempNewTopic).subscribe( - res => { - this.init(); - this.notificationService.success("SUCCESSFULLY_CREARED"); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - } - ); - }) - - - } - - openTopicModal(name: string) { - if (name == "config") { - const modalRef = this.modalService.open(TopicConfigModalComponent, { - windowClass: "dl-md-modal", - centered: true - }); - modalRef.componentInstance.title = "Topics Default Configurations"; - modalRef.componentInstance.topic = this.topicDefaultConfig; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - this.restApiService - .updateTopicDefaultConfig(this.topicDefaultConfig) - .subscribe( - res => { - this.topicDefaultConfig = receivedEntry; - this.topics.forEach(t => { - if (!t.type) { - // Unconfigure topics - t.login = this.topicDefaultConfig.login; - t.password = this.topicDefaultConfig.password; - t.sinkdbs = this.topicDefaultConfig.sinkdbs; - t.enabled = this.topicDefaultConfig.enabled; - t.saveRaw = this.topicDefaultConfig.saveRaw; - t.dataFormat = this.topicDefaultConfig.dataFormat; - t.ttl = this.topicDefaultConfig.ttl; - t.correlateClearedMessage = this.topicDefaultConfig.correlateClearedMessage; - t.messageIdPath = this.topicDefaultConfig.messageIdPath; - } - }); - this.notificationService.success("Success updated."); - modalRef.close(); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - }); - } else { - const index = this.temp.findIndex(t => t.name === name); - const modalRef = this.modalService.open(TopicDetailModalComponent, { - size: "lg", - centered: true - }); - modalRef.componentInstance.topic = this.temp[index]; - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - this.tempTopicDetail = receivedEntry; - // Configured topic - if (this.tempTopicDetail.type) { - this.restApiService.getTopicsFromFeeder().subscribe( - res => { - if (res.find(name => name === this.tempTopicDetail.name)) { - // Update topic from db - this.restApiService.upadteTopic(this.tempTopicDetail).subscribe( - res => { - this.temp[index] = this.tempTopicDetail; - this.topics = this.temp; - this.notificationService.success("SUCCESSFULLY_UPDATED"); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - } - ); - } else { - // Insert topic from db - this.restApiService.addTopic(this.tempTopicDetail).subscribe( - res => { - this.init(); - this.notificationService.success("SUCCESSFULLY_CREARED"); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - } - ); - } - }, - err => { - this.notificationService.error(err); - modalRef.close(); - } - ); - } else { - // Reset to default and delete topic from db - this.restApiService.deleteTopic(this.tempTopicDetail.name).subscribe( - res => { - this.init(); - this.notificationService.success("SUCCESSFULLY_DELETED"); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - } - ); - } - }); - } - } - - deleteTopicModal(name: string){ - const index = this.temp.findIndex(t => t.name === name); - const modalRef = this.modalService.open(AlertComponent, { - size: "sm", - centered: true - }); - modalRef.componentInstance.message = "ARE_YOU_SURE_DELETE"; - console.log(this.temp[index]); - modalRef.componentInstance.passEntry.subscribe(receivedEntry => { - this.restApiService.deleteTopic(this.temp[index].name).subscribe( - res => { - this.init(); - this.notificationService.success("SUCCESSFULLY_DELETED"); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - }, - err => { - this.notificationService.error(err); - modalRef.close(); - this.updateFilter(this.searchText.nativeElement.value); - } - ); - - }) - } - - getTopicDetail(name: string) { - return this.restApiService.getTopicDetail(name).toPromise(); - } - - updateFilter(searchValue) { - const val = searchValue.toLowerCase(); - - // filter our data - const temp = this.temp.filter(function(d) { - return d.name.toLowerCase().indexOf(val) !== -1 || !val; - }); - - // update the rows - this.topics = temp; - } -} diff --git a/components/datalake-handler/admin/src/src/app/topics/topics.component.css b/components/datalake-handler/admin/src/src/app/topics/topics.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/components/datalake-handler/admin/src/src/app/topics/topics.component.html b/components/datalake-handler/admin/src/src/app/topics/topics.component.html deleted file mode 100644 index 25274404..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topics.component.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
- Home > Topics -
- -
- -
-
diff --git a/components/datalake-handler/admin/src/src/app/topics/topics.component.spec.ts b/components/datalake-handler/admin/src/src/app/topics/topics.component.spec.ts deleted file mode 100644 index f38f85e6..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topics.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TopicsComponent } from './topics.component'; - -describe('TopicsComponent', () => { - let component: TopicsComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TopicsComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TopicsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/components/datalake-handler/admin/src/src/app/topics/topics.component.ts b/components/datalake-handler/admin/src/src/app/topics/topics.component.ts deleted file mode 100644 index 539d1249..00000000 --- a/components/datalake-handler/admin/src/src/app/topics/topics.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, OnInit } from "@angular/core"; -import { AdminService } from "../core/services/admin.service"; - -@Component({ - selector: "app-topics", - templateUrl: "./topics.component.html", - styleUrls: ["./topics.component.css"] -}) -export class TopicsComponent implements OnInit { - constructor(private adminService: AdminService) { - // Set page title - this.adminService.setTitle("SIDEBAR.TOPICS"); - } - - ngOnInit() {} -} diff --git a/components/datalake-handler/admin/src/src/app/views/about/about.component.css b/components/datalake-handler/admin/src/src/app/views/about/about.component.css new file mode 100644 index 00000000..c8173515 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/about/about.component.css @@ -0,0 +1,44 @@ +/* + * ============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========================================================= + */ + +.about-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + padding: 30px 30px; +} + +.about-title { + color: #5DBEBB; + font-weight: 800; + padding-bottom: 20px; +} + +.about-bold { + color: #313032; + font-weight: 800; +} + +.about-info { + font-family: "Open Sans", sans-serif; + font-weight: 400; + font-size: 14px; + color: #A8A9AC; +} diff --git a/components/datalake-handler/admin/src/src/app/views/about/about.component.html b/components/datalake-handler/admin/src/src/app/views/about/about.component.html new file mode 100644 index 00000000..accab817 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/about/about.component.html @@ -0,0 +1,189 @@ + +
+
+ Home > About +
+
+ +
+ +
+
+
+ ONAP DataLake Admin Platform +
+
+ {{ this.feeder.version }} +
+
+ +
+
+
+ + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+
diff --git a/components/datalake-handler/admin/src/src/app/views/about/about.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/about/about.component.spec.ts new file mode 100644 index 00000000..b2be756c --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/about/about.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { AboutComponent } from "./about.component"; + +describe("AboutComponent", () => { + let component: AboutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AboutComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AboutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/about/about.component.ts b/components/datalake-handler/admin/src/src/app/views/about/about.component.ts new file mode 100644 index 00000000..adf65a2a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/about/about.component.ts @@ -0,0 +1,52 @@ +/* + * ============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 + * + */ + +import { Component, OnInit } from "@angular/core"; +import { AdminService } from "src/app/core/services/admin.service"; +import { RestApiService } from "src/app/core/services/rest-api.service"; + +@Component({ + selector: "app-about", + templateUrl: "./about.component.html", + styleUrls: ["./about.component.css"] +}) +export class AboutComponent implements OnInit { + feeder: any = []; + + constructor( + private adminService: AdminService, + private restApiService: RestApiService + ) { + this.adminService.setTitle("SIDEBAR.ABOUT"); + } + + ngOnInit() { + // Get datalake feeder version + this.restApiService.getFeederstatus().subscribe(data => { + this.feeder = data; + }); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css new file mode 100644 index 00000000..7af4051a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css @@ -0,0 +1,18 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +input::-webkit-input-placeholder{ + color: #A8A9AC; +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html new file mode 100644 index 00000000..5fdc45a1 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html @@ -0,0 +1,129 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts new file mode 100644 index 00000000..6fa809d5 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreateDashboardComponent } from './create-dashboard.component'; + +describe('CreateDashboardComponent', () => { + let component: CreateDashboardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreateDashboardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreateDashboardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts new file mode 100644 index 00000000..158068ae --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts @@ -0,0 +1,77 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { Component, OnInit, Input, Output, ViewChild, EventEmitter, ElementRef } from '@angular/core'; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Dashboard } from "src/app/core/models/dashboard.model"; +import { AdminService } from "src/app/core/services/admin.service"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +@Component({ + selector: 'app-create-dashboard', + templateUrl: './create-dashboard.component.html', + styleUrls: ['./create-dashboard.component.css'] +}) +export class CreateDashboardComponent implements OnInit { + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService, + public restApiService: RestApiService, + ) { } + + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() dashboard: Dashboard; + @Input() nameArr; + tempDb: Dashboard; + + selectshow = false; + tempDbNameTitle = null; + + @ViewChild("t_dataDashboardName") t_dataDashboardName: ElementRef; + + ngOnInit() { + // cache for display + + console.log(this.dashboard); + this.tempDb = new Dashboard(); + if (this.dashboard.enabled == undefined) { + this.dashboard.enabled = true; + } + const feeds = { + name: this.dashboard.name, + host: this.dashboard.host, + port: this.dashboard.port, + login: this.dashboard.login, + pass: this.dashboard.pass, + enabled: this.dashboard.enabled, + }; + console.log(feeds); + this.tempDb = feeds; + this.tempDbNameTitle = this.dashboard.host + } + + + + passBack() { + if (this.tempDb.host == null && this.tempDb.port == null && this.tempDb.login == null && this.tempDb.pass == null) { + return false; + } + this.dashboard = this.tempDb; + this.dashboard.name = this.t_dataDashboardName.nativeElement.value; + console.log(this.dashboard, "this.dashboard output"); + this.passEntry.emit(this.dashboard); + } + +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.css new file mode 100644 index 00000000..69d9710a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.css @@ -0,0 +1,70 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +.db-block { + min-width: 180px; + min-height: 180px; + padding: 10px; +} +.db-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + position: relative; + font-family: "Open Sans", sans-serif; + font-weight: 600; + font-size: 18px; + color: #313032; + text-align: center; + padding: 10px; +} +.db-dropdown { + background-color: #ffffff; +} + +.db-dropdown:hover { + background-color: #ffffff; +} + +.db-config-icon { + color: #5DBEBB; + background-color: #ffffff; +} + +.db-config-icon:hover { + background-color: #D2D3D5; +} + +.dropdown-item { + font-family: "Open Sans", sans-serif; + font-weight: 400; + font-size: 14px; +} +.dropdown-menu.action-btn{ + min-width: 2rem!important; + left: -70px!important; +} +.truecheck{ + color:#5DBEBB +} +.falsecheck{ + color:#BDBEC0 +} +.maskShow{ + position: absolute; +} +.deleteDisplay{ +background: rgba(222, 222, 222, 0.48); +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.html new file mode 100644 index 00000000..316dee54 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.html @@ -0,0 +1,181 @@ + +
+
+ {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.DASHBOARDLIST" | translate}} +
+
+ +
+ + +
+
+
+ + +
+
+ +
+ + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + + +
+ + +
+ + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+
+ +
+ + {{ db.name }} +
+
+ +
+
+
+
diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts new file mode 100644 index 00000000..d0e59ce4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardListComponent } from './dashboard-list.component'; + +describe('DashboardListComponent', () => { + let component: DashboardListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DashboardListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.ts new file mode 100644 index 00000000..225f819d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-list/dashboard-list.component.ts @@ -0,0 +1,162 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { Dashboard } from "../../../core/models/dashboard.model"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { CreateDashboardComponent } from "./create-dashboard/create-dashboard.component"; + +import { AdminService } from "../../../core/services/admin.service"; + +// DB modal components +import { RestApiService } from "src/app/core/services/rest-api.service"; + +// Notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +@Component({ + selector: 'app-dashboard-list', + templateUrl: './dashboard-list.component.html', + styleUrls: ['./dashboard-list.component.css'] +}) +export class DashboardListComponent implements OnInit { + @Output() passEntry: EventEmitter = new EventEmitter(); + dbList: any = []; + dbs: Dashboard[] = []; + + loading: Boolean = true; + + tempDbDetail: Dashboard; + dashboardDeteleModelShow = true; + + // nameArr = []; + + constructor( + private adminService: AdminService, + private dashboardApiService: RestApiService, + private notificationService: ToastrNotificationService, + private modalService: NgbModal, + private spinner: NgxSpinnerService + ) { + // Set page title + this.adminService.setTitle("SIDEBAR.DASHBOARDLIST"); + this.initList(); + + } + + ngOnInit() { + this.spinner.show(); + } + initList() { + this.initData().then(data => { + this.initDbsList(this.dbList).then(data => { + this.dbs = data; + console.log(this.dbs, "dasboard-dbs[]") + }); + }); + } + + async initData() { + this.dbList = []; + this.dbList = await this.getDbList(); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + + getDbList() { + var data: any; + data = this.dashboardApiService.getDashboardList().toPromise(); + return data; + } + + async initDbsList(dbList: []) { + var d: Dashboard[] = []; + + if (dbList.length > 0) { + for (var i = 0; i < dbList.length; i++) { + let data = dbList[i]; + let feed = { + name: data["name"], + host: data["host"], + port: data["port"], + login: data["login"], + pass: data["pass"], + enabled: data["enabled"] + }; + d.push(feed); + } + } + return d; + } + + openDashboardModal(thisIndex: number) { + var modalRef, index; + index = thisIndex; + console.log(index, "index,add or edit"); + modalRef = this.modalService.open(CreateDashboardComponent, { + size: "lg", + centered: true + }); + modalRef.componentInstance.dashboard = this.dbs[index]; + modalRef.componentInstance.passEntry.subscribe(receiveEntry => { + this.dbs[index] = receiveEntry; + let host = this.dbs[index].host; + let enabled = this.dbs[index].enabled; + console.log(receiveEntry); + if (enabled == true) { + // Db name found, to update db + this.dashboardApiService.createUpadteDashboard(this.dbs[index]).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + this.initList(); + this.notificationService.success("SUCCESSFULLY_UPDATED"); + } else { + this.notificationService.error("FAILED_UPDATED"); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } else { + this.dashboardApiService.deleteDashboard(this.dbs[thisIndex]).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + this.initList(); + this.notificationService.success("SUCCESSFULLY_DELETED"); + } else { + this.dbs[thisIndex].enabled = true; + this.notificationService.error("FAILED_DELETED"); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + + } + + }); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.html new file mode 100644 index 00000000..134e2fc1 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.html @@ -0,0 +1,24 @@ + + + +
+
+ Home > Dashboard List +
+
+ + diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.spec.ts new file mode 100644 index 00000000..10886c12 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardSettingComponent } from './dashboard-setting.component'; + +describe('DashboardSettingComponent', () => { + let component: DashboardSettingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DashboardSettingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.ts new file mode 100644 index 00000000..c423ab42 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/dashboard-setting.component.ts @@ -0,0 +1,29 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { Component, OnInit } from '@angular/core'; +@Component({ + selector: 'app-dashboard-setting', + templateUrl: './dashboard-setting.component.html', + styleUrls: ['./dashboard-setting.component.css'] +}) +export class DashboardSettingComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css new file mode 100644 index 00000000..7bd79547 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css @@ -0,0 +1,22 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +#f-file{ + position: absolute; + width: 100%; + height: 90%; + opacity: 0; + cursor: pointer; +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html new file mode 100644 index 00000000..4165de8d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html @@ -0,0 +1,156 @@ + +
+ + + +
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts new file mode 100644 index 00000000..de3dc540 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditTemplateModalComponent } from './edit-template-modal.component'; + +describe('EditTemplateModalComponent', () => { + let component: EditTemplateModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditTemplateModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditTemplateModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts new file mode 100644 index 00000000..a6b7be9f --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts @@ -0,0 +1,160 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { Template } from "src/app/core/models/template.model"; + +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +@Component({ + selector: 'app-edit-template-modal', + templateUrl: './edit-template-modal.component.html', + styleUrls: ['./edit-template-modal.component.css'] +}) +export class EditTemplateModalComponent implements OnInit { + @Input() edittemplate: Template; + templateInput: Template; + defaultDesigntype: String; + defaultTopicname: String; + templatetypedata: Array = []; + topicname: Array = []; + dbList: Array = []; + tempSeletedDbs: any = []; + @Output() passEntry: EventEmitter = new EventEmitter(); + + @ViewChild("templatetype") templatetype: ElementRef; + @ViewChild("topic") topic: ElementRef; + + constructor( + public activeModal: NgbActiveModal, + public dashboardApiService: RestApiService, + private spinner: NgxSpinnerService, + ) { } + + inputtemplateName = null; + templateInputTitle = ""; + fileName = null; + + ngOnInit() { + // cache for display + this.templateInput = new Template(); + this.getDbList(); + const feed = { + id: this.edittemplate.id, + name: this.edittemplate.name, + submitted: this.edittemplate.submitted, + body: this.edittemplate.body, + note: this.edittemplate.note, + topicName: this.edittemplate.topicName, + designType: this.edittemplate.designType, + designTypeName: this.edittemplate.designTypeName, + dbs: this.edittemplate.dbs, + }; + this.templateInput = feed; + this.templateInputTitle = "" + this.edittemplate.name; + this.tempSeletedDbs = this.templateInput.dbs.map(item => { return Number(item) }); + + this.getTopicName(); + this.getTemplateTypeName(); + } + getTopicName() { + this.dashboardApiService.getTopicsFromFeeder().subscribe(data => { + this.topicname = data; + }); + } + + getDbList() { + this.dashboardApiService.getTempDbList().subscribe(data => { + Object.keys(data).map(item => { + this.dbList.push({ key: item, name: data[item] }) + }) + }); + } + + updateSelectedDB(event: any, name: any) { + if (event.target.checked) { + if (!this.tempSeletedDbs.find(db => db === name)) { + this.tempSeletedDbs.push(Number(name.key)); + } + } else { + const index = this.tempSeletedDbs.indexOf(+name.key, 0); + if (index > -1) { + this.tempSeletedDbs.splice(index, 1); + } + } + } + + getTemplateTypeName() { + this.dashboardApiService.getTemplateTypeName().subscribe(data => { + this.templatetypedata = data; + this.getDefaultOptions(); + }); + } + + getDefaultOptions() { + this.templatetypedata.map(item => { + if (item.id === this.templateInput.designType) { + return this.defaultDesigntype = item.name; + } + }); + this.defaultTopicname = this.templateInput.topicName; + } + + jsReadFiles() { + var thiss = this; + var file = (document.querySelector("#f-file")).files[0]; + this.fileName = file.name; + var reader = new FileReader(); + reader.onload = function () { + thiss.templateInput.body = String(this.result); + } + reader.readAsText(file); + } + + passBack() { + this.spinner.show(); + if (this.templateInput.name == '' || this.templateInput.name == undefined) { + return false; + } + this.edittemplate = this.templateInput; + // this.templatetypedata.map(item => { + // if (item.name === this.templatetype.nativeElement.value) { + // return this.edittemplate.designType = item.id; + // } + // }); + this.edittemplate.designType = this.templatetypedata.filter(item => { + return item.name === this.templatetype.nativeElement.value; + })[0].id || ""; + + this.edittemplate.designTypeName = this.templatetype.nativeElement.value; + this.edittemplate.topicName = this.topic.nativeElement.value; + this.edittemplate.dbs = this.tempSeletedDbs; + this.passEntry.emit(this.edittemplate); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css new file mode 100644 index 00000000..7bd79547 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css @@ -0,0 +1,22 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +#f-file{ + position: absolute; + width: 100%; + height: 90%; + opacity: 0; + cursor: pointer; +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html new file mode 100644 index 00000000..40d0755e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html @@ -0,0 +1,157 @@ + +
+ + + + +
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts new file mode 100644 index 00000000..29df2b1a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewTemplateModalComponent } from './new-template-modal.component'; + +describe('NewTemplateModalComponent', () => { + let component: NewTemplateModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NewTemplateModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NewTemplateModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts new file mode 100644 index 00000000..496d08a1 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts @@ -0,0 +1,148 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +import { Template } from "src/app/core/models/template.model"; + +@Component({ + selector: 'app-new-template-modal', + templateUrl: './new-template-modal.component.html', + styleUrls: ['./new-template-modal.component.css'] +}) +export class NewTemplateModalComponent implements OnInit { + @Input() template: Template; + @Input() templatelist_length; + templateInput: Template + templatetypedata: Array = []; + topicname: Array = []; + dbList: Array = []; + tempSeletedDbs: any = []; + @Output() passEntry: EventEmitter = new EventEmitter(); + @ViewChild("templatetype") templatetype: ElementRef; + @ViewChild("topic") topic: ElementRef; + + constructor( + public activeModal: NgbActiveModal, + public dashboardApiService: RestApiService, + private spinner: NgxSpinnerService, + ) { } + inputtemplateName = null; + templatebody = null; + fileName = null; + + ngOnInit() { + this.getTopicName(); + this.getTemplateTypeName(); + this.getDbList(); + // cache for display + this.templateInput = new Template(); + const feed = { + id: null, + name: this.template.name, + submitted: this.template.submitted, + body: this.template.body, + note: this.template.note, + topicName: this.template.topicName, + designType: this.template.designType, + designTypeName: this.template.designTypeName, + dbs: [], + }; + this.templateInput = feed; + } + getTopicName() { + this.dashboardApiService.getTopicsFromFeeder().subscribe(data => { + this.topicname = data; + }); + } + + getDbList() { + this.dashboardApiService.getTempDbList().subscribe(data => { + Object.keys(data).map(item => { + this.dbList.push({ key: item, name: data[item] }) + }) + }); + } + + getTemplateTypeName() { + this.dashboardApiService.getTemplateTypeName().subscribe(data => { + this.templatetypedata = data; + }); + } + + updateSelectedDB(event: any, name: any) { + if (event.target.checked) { + if (!this.tempSeletedDbs.find(db => db === name)) { + this.tempSeletedDbs.push(name.key); + } + } else { + const index = this.tempSeletedDbs.indexOf(name.key, 0); + if (index > -1) { + this.tempSeletedDbs.splice(index, 1); + } + } + } + + jsReadFiles() { + var thiss = this; + var file = (document.querySelector("#f-file")).files[0]; + this.fileName = file.name; + var reader = new FileReader(); + reader.onload = function () { + // console.log(this.result, "this.result"); + thiss.templateInput.body = String(this.result); + } + reader.readAsText(file); + } + passBack() { + this.spinner.show(); + if (this.templateInput.name == '' || this.templateInput.name == undefined) { + return false; + } + this.template = this.templateInput; + + // this.templatetypedata.map(item => { + // if (item.name === this.templatetype.nativeElement.value) { + // return this.template.designType = item.id; + // } + // }) + + this.template.designType = this.templatetypedata.filter(item => { + return item.name === this.templatetype.nativeElement.value; + })[0].id || ""; + + this.template.designTypeName = this.templatetype.nativeElement.value; + this.template.topicName = this.topic.nativeElement.value; + this.template.dbs = this.tempSeletedDbs; + this.template.submitted = false; + this.template.note = ""; + this.passEntry.emit(this.template); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.css new file mode 100644 index 00000000..47ab70e5 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.css @@ -0,0 +1,20 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +.topic-list-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + } diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.html new file mode 100644 index 00000000..4a93ec65 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.html @@ -0,0 +1,112 @@ + +
+
+
+
+ +
+
+ +
+ +
+
+
+ + +
+ +
+
+
+
+ +
+
+ + + + + + + + + + + + + + {{ row.name }} + + + + + + {{ row.designTypeName }} + + + + + + {{ row.topicName }} + + + + +
+ +   {{ 'DEPLOY' | translate }}   + +
+
+ + + + + + + + + +
+
+
+
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.spec.ts new file mode 100644 index 00000000..10a43a46 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TemplateListComponent } from './template-list.component'; + +describe('TemplateListComponent', () => { + let component: TemplateListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TemplateListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TemplateListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts new file mode 100644 index 00000000..156e3ed7 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts @@ -0,0 +1,248 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { Template } from "src/app/core/models/template.model"; +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +// modal +import { NewTemplateModalComponent } from "./new-template-modal/new-template-modal.component"; +import { EditTemplateModalComponent } from "./edit-template-modal/edit-template-modal.component"; +import { AlertComponent } from "src/app/shared/components/alert/alert.component"; +// notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +@Component({ + selector: 'app-template-list', + templateUrl: './template-list.component.html', + styleUrls: ['./template-list.component.css'] +}) +export class TemplateListComponent { + template_list: any = []; + templates: Template[] = []; + temps: Template[] = []; + Template_New: Template; + Template_Newbody: Template; + dashboardDeteleModelShow = true; + loadingIndicator: boolean = true; + mesgNoData = { + emptyMessage: ` +
+
+ +
+
+ ` + }; + @ViewChild("searchText") searchText: ElementRef; + constructor( + private modalService: NgbModal, + private dashboardApiService: RestApiService, + private spinner: NgxSpinnerService, + private notificationService: ToastrNotificationService, + ) { + setTimeout(() => { + this.loadingIndicator = false; + }, 5000); + + this.initData().then(data => { + this.initTemplateList(this.template_list).then( + data => { + // for cache of datatable + this.temps = [...data]; + this.templates = data; + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + ); + }); + } + + ngOnInit() { + this.spinner.show(); + } + + async initData() { + this.template_list = []; + this.template_list = await this.getTemplateList(); + this.Template_New = new Template(); + this.Template_Newbody = new Template(); + return true; + } + + + getTemplateList() { + return this.dashboardApiService.getTemplateAll().toPromise(); + } + + async initTemplateList(template_list: []) { + var t: Template[] = []; + for (var i = 0; i < template_list.length; i++) { + let data = template_list[i]; + let feed = { + id: data["id"], + name: data["name"], + submitted: data["submitted"], + body: data["body"], + note: data["note"], + topicName: data["topicName"], + designType: data["designType"], + designTypeName: data["designTypeName"], + dbs: data["dbs"], + }; + t.push(feed); + } + return t; + } + + newTemplateModal() { + const modalRef = this.modalService.open(NewTemplateModalComponent, { + windowClass: "dl-md-modal templatess", + centered: true + }); + this.Template_New = new Template(); + this.Template_Newbody = new Template(); + modalRef.componentInstance.template = this.Template_Newbody; + modalRef.componentInstance.templatelist_length = this.template_list.length; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + this.Template_Newbody = receivedEntry; + this.dashboardApiService + .createNewTemplate(this.Template_Newbody) + .subscribe( + res => { + if (res.statusCode == 200) { + this.Template_New = res.returnBody; + this.template_list.push(this.Template_New); + this.template_list = [...this.template_list]; + this.notificationService.success("SUCCESSFULLY_CREARED"); + } else { + this.notificationService.error("FAILED_CREARED"); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + }); + } + + onActivate(event) { + const emitType = event.type; + if (emitType == "dblclick") { + let id = event.row.id; + this.editTemplateModal(id); + } + + } + + editTemplateModal(id) { + const index = this.template_list.findIndex(t => t.id === id); + const modalRef = this.modalService.open(EditTemplateModalComponent, { + windowClass: "dl-md-modal templatess", + centered: true + }); + modalRef.componentInstance.edittemplate = this.template_list[index]; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + this.Template_New = receivedEntry; + this.dashboardApiService + .updateNewTemplate(this.Template_New) + .subscribe( + res => { + if (res.statusCode == 200) { + this.template_list[index] = this.Template_New; + this.template_list = [...this.template_list]; + this.notificationService.success("SUCCESSFULLY_UPDATED"); + } else { + this.notificationService.error("FAILED_UPDATED"); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + }) + } + + deleteTemplateModel(id: number) { + const index = this.template_list.findIndex(t => t.id === id); + const modalRef = this.modalService.open(AlertComponent, { + size: "sm", + centered: true + }); + // modalRef.componentInstance.dashboardDeteleModelShow = this.dashboardDeteleModelShow; + modalRef.componentInstance.message = "ARE_YOU_SURE_DELETE"; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + // Delete database + this.dashboardApiService.DeleteTemplate(id).subscribe( + res => { + if (JSON.stringify(res).length <= 2) { + this.template_list.splice(index, 1); + this.template_list = [...this.template_list]; + this.notificationService.success("SUCCESSFULLY_DELETED"); + } else { + this.notificationService.error("FAILED_DELETED"); + } + + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + }); + + } + + deployTemplate(id: number) { + const index = this.template_list.findIndex(t => t.id === id); + const body = this.template_list[index]; + this.spinner.show(); + this.dashboardApiService.deployTemplateKibana(id, body).subscribe( + res => { + this.spinner.hide(); + if (JSON.stringify(res).length <= 2) { + this.notificationService.success("Deploy_SUCCESSFULLY"); + } else { + this.notificationService.error("Deploy_FAILED"); + } + }, + err => { + this.spinner.hide(); + this.notificationService.error(err); + } + ); + } + + updateFilter(searchValue) { + const val = searchValue.toLowerCase(); + // filter our data + const temps = this.temps.filter(function (d) { + return d.name.toLowerCase().indexOf(val) !== -1 || !val; + }); + // update the rows + this.template_list = temps; + } + + +} diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.css b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.html b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.html new file mode 100644 index 00000000..2aede51d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.html @@ -0,0 +1,23 @@ + +
+
+ {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.TEMPLATE" | translate}} +
+
+ +
+
diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.spec.ts new file mode 100644 index 00000000..21428a84 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TemplateComponent } from './template.component'; + +describe('TemplateComponent', () => { + let component: TemplateComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TemplateComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TemplateComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.ts new file mode 100644 index 00000000..3a605f78 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template.component.ts @@ -0,0 +1,34 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { Component, OnInit } from '@angular/core'; +import { AdminService } from "../../../core/services/admin.service"; + +@Component({ + selector: 'app-template', + templateUrl: './template.component.html', + styleUrls: ['./template.component.css'] +}) +export class TemplateComponent implements OnInit { + + constructor(private adminService: AdminService) { + // Set page title + this.adminService.setTitle("SIDEBAR.TEMPLATE"); + } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.css new file mode 100644 index 00000000..ac205fe8 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.css @@ -0,0 +1,40 @@ +/* +* ============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========================================================= +*/ + + + +.nav-pills .nav-link.active, +.nav-pills .nav-link:hover { + color: #ffffff; + background-color: #5DBEBB; +} + +.nav-link { + font-family: "Open Sans", sans-serif; + font-weight: 400; + font-size: 14px; + color: #313449; + text-align: left; + border-radius: 0px; +} + +.nav-pills .show>.nav-link { + background-color: #FFFFFF; +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.html new file mode 100644 index 00000000..490bf49e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.html @@ -0,0 +1,123 @@ + + +
+ + + +
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.spec.ts new file mode 100644 index 00000000..bde10b2c --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { DatabaseAddModalComponent } from "./database-add-modal.component"; + +describe("DatabaseAddModalComponent", () => { + let component: DatabaseAddModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DatabaseAddModalComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatabaseAddModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.ts new file mode 100644 index 00000000..3f47bdd1 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-add-modal/database-add-modal.component.ts @@ -0,0 +1,50 @@ +/* + * ============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 + * + */ + +import { Component, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; + +@Component({ + selector: "app-database-add-modal", + templateUrl: "./database-add-modal.component.html", + styleUrls: ["./database-add-modal.component.css"] +}) +export class DatabaseAddModalComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + seletedItem: string = ""; + + constructor(public activeModal: NgbActiveModal) {} + + ngOnInit() {} + + clickItem(name: string) { + this.seletedItem = name; + } + + passBack() { + this.passEntry.emit(this.seletedItem); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.css new file mode 100644 index 00000000..15261b48 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.css @@ -0,0 +1,63 @@ +/* +* ============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========================================================= +*/ + + + +.db-block { + min-width: 180px; + min-height: 180px; + padding: 10px; +} + +.db-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + position: relative; + font-family: "Open Sans", sans-serif; + font-weight: 600; + font-size: 18px; + color: #313032; + text-align: center; + padding: 10px; +} + +.db-dropdown { + background-color: #ffffff; +} + +.db-dropdown:hover { + background-color: #ffffff; +} + +.db-config-icon { + color: #5DBEBB; + background-color: #ffffff; +} + +.db-config-icon:hover { + background-color: #D2D3D5; +} + +.dropdown-item { + font-family: "Open Sans", sans-serif; + font-weight: 400; + font-size: 14px; +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.html new file mode 100644 index 00000000..829d6c62 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.html @@ -0,0 +1,235 @@ + + +
+ +
+
+
+
+
+ +
+ + + + + +
+ + +
+ + + + + + + + +
+ + +
+ + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + +
+
+
+ + {{ db.name }} +
+
+ +
+
+
+
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.spec.ts new file mode 100644 index 00000000..8c104fd4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { DatabaseListComponent } from "./database-list.component"; + +describe("DatabaseListComponent", () => { + let component: DatabaseListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DatabaseListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatabaseListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.ts new file mode 100644 index 00000000..5b937301 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/database-list.component.ts @@ -0,0 +1,229 @@ +/* + * ============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 + * + */ + +import { Component, OnInit, ViewChild, ElementRef } from "@angular/core"; +import { Db } from "../../../core/models/db.model"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { DatabaseAddModalComponent } from "./database-add-modal/database-add-modal.component"; + +// DB modal components +import { RestApiService } from "src/app/core/services/rest-api.service"; + +// Modal +import { CouchbaseComponent } from "./dbs-modal/couchbase/couchbase.component"; +import { DruidComponent } from "./dbs-modal/druid/druid.component"; +import { ElasticsearchComponent } from "./dbs-modal/elasticsearch/elasticsearch.component"; +import { MongodbComponent } from "./dbs-modal/mongodb/mongodb.component"; +import { HdfsComponent } from "./dbs-modal/hdfs/hdfs.component"; +import { AlertComponent } from "src/app/shared/components/alert/alert.component"; + +// Notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +@Component({ + selector: "app-database-list", + templateUrl: "./database-list.component.html", + styleUrls: ["./database-list.component.css"] +}) +export class DatabaseListComponent implements OnInit { + pageFinished: Boolean = false; + + dbList: any = []; + dbs: Db[] = []; + + loading: Boolean = true; + + tempDbDetail: Db; + + constructor( + private restApiService: RestApiService, + private notificationService: ToastrNotificationService, + private modalService: NgbModal, + private spinner: NgxSpinnerService + ) { + this.initData().then(data => { + this.initDbsList(this.dbList).then(data => { + this.dbs = data; + }); + }); + } + + ngOnInit() { + this.spinner.show(); + } + + async initData() { + this.dbList = []; + this.dbList = await this.getDbList(); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + + getDbList() { + var data: any; + + data = this.restApiService.getDbList().toPromise(); + + return data; + } + + async initDbsList(dbList: []) { + var d: Db[] = []; + + if (dbList.length > 0) { + for (var i = 0; i < dbList.length; i++) { + let data = await this.getDbDetail(dbList[i]); + let feed = { + name: dbList[i], + enabled: data.enabled, + host: data.host, + port: data.port, + database: data.database, + encrypt: data.encrypt, + login: data.login, + pass: data.pass + }; + d.push(feed); + } + } + return d; + } + + getDbDetail(name: string) { + return this.restApiService.getDbDetail(name).toPromise(); + } + + openAddModal() { + const modalRef = this.modalService.open(DatabaseAddModalComponent, { + windowClass: "dl-md-modal", + centered: true + }); + + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + if (receivedEntry) { + modalRef.close(); + this.openDetailModal(receivedEntry); + } + }); + } + + openDetailModal(name: string) { + var modalRef, index; + + switch (name) { + case "Couchbase": { + modalRef = this.modalService.open(CouchbaseComponent, { + size: "lg", + centered: true + }); + break; + } + case "Druid": { + modalRef = this.modalService.open(DruidComponent, { + size: "lg", + centered: true + }); + break; + } + case "Elasticsearch": { + modalRef = this.modalService.open(ElasticsearchComponent, { + size: "lg", + centered: true + }); + break; + } + case "MongoDB": { + modalRef = this.modalService.open(MongodbComponent, { + size: "lg", + centered: true + }); + break; + } + case "HDFS": { + modalRef = this.modalService.open(HdfsComponent, { + size: "lg", + centered: true + }); + break; + } + default: { + break; + } + } + + index = this.dbs.findIndex(d => d.name === name); + this.tempDbDetail = new Db(); + if (index != -1) { + modalRef.componentInstance.db = this.dbs[index]; + } else { + modalRef.componentInstance.db = this.tempDbDetail; + } + modalRef.componentInstance.passEntry.subscribe(receiveEntry => { + this.tempDbDetail = receiveEntry; + let enabled = receiveEntry.enabled; + console.log(this.tempDbDetail, "this.tempDbDetail"); + if (enabled == true) { + this.restApiService.upadteDb(this.tempDbDetail).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + this.dbs[index] = this.tempDbDetail; + this.notificationService.success("SUCCESSFULLY_UPDATED"); + } else { + this.notificationService.error("FAILED_UPDATED"); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } else { + this.restApiService.upadteDb(this.dbs[index]).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + this.dbs[index] = this.tempDbDetail; + this.notificationService.success("SUCCESSFULLY_DELETED"); + } else { + this.dbs[index].encrypt = true; + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } + }); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.html new file mode 100644 index 00000000..c67ab85c --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.html @@ -0,0 +1,146 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts new file mode 100644 index 00000000..e3de0b45 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { CouchbaseComponent } from "./couchbase.component"; + +describe("CouchbaseComponent", () => { + let component: CouchbaseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CouchbaseComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CouchbaseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.ts new file mode 100644 index 00000000..4ce7f2ab --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/couchbase/couchbase.component.ts @@ -0,0 +1,67 @@ +/* + * ============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 + * + */ + +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Db } from "src/app/core/models/db.model"; +import { AdminService } from "src/app/core/services/admin.service"; + +@Component({ + selector: "app-couchbase", + templateUrl: "./couchbase.component.html", + styleUrls: ["./couchbase.component.css"] +}) +export class CouchbaseComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() db: Db; + tempDb: Db; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService + ) { } + + ngOnInit() { + // cache for display + this.tempDb = new Db(); + const feed = { + name: "Couchbase", + enabled: this.db.enabled, + host: this.db.host, + port: this.db.port, + database: this.db.database, + encrypt: this.db.encrypt, + login: this.db.login, + pass: this.db.pass + }; + this.tempDb = feed; + } + + passBack() { + this.db = this.tempDb; + this.passEntry.emit(this.db); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.html new file mode 100644 index 00000000..5d5a38cf --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.html @@ -0,0 +1,146 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.spec.ts new file mode 100644 index 00000000..833fa410 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { DruidComponent } from "./druid.component"; + +describe("DruidComponent", () => { + let component: DruidComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DruidComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DruidComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.ts new file mode 100644 index 00000000..4de2fdd8 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/druid/druid.component.ts @@ -0,0 +1,67 @@ +/* + * ============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 + * + */ + +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Db } from "src/app/core/models/db.model"; +import { AdminService } from "src/app/core/services/admin.service"; + +@Component({ + selector: "app-druid", + templateUrl: "./druid.component.html", + styleUrls: ["./druid.component.css"] +}) +export class DruidComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() db: Db; + tempDb: Db; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService + ) { } + + ngOnInit() { + // cache for display + this.tempDb = new Db(); + const feed = { + name: "Druid", + enabled: this.db.enabled, + host: this.db.host, + port: this.db.port, + database: this.db.database, + encrypt: this.db.encrypt, + login: this.db.login, + pass: this.db.pass + }; + this.tempDb = feed; + } + + passBack() { + this.db = this.tempDb; + this.passEntry.emit(this.db); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html new file mode 100644 index 00000000..1a7e7e80 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.html @@ -0,0 +1,136 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts new file mode 100644 index 00000000..57798da3 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { ElasticsearchComponent } from "./elasticsearch.component"; + +describe("ElasticsearchComponent", () => { + let component: ElasticsearchComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ElasticsearchComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ElasticsearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts new file mode 100644 index 00000000..29e2125e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/elasticsearch/elasticsearch.component.ts @@ -0,0 +1,67 @@ +/* + * ============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 + * + */ + +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Db } from "src/app/core/models/db.model"; +import { AdminService } from "src/app/core/services/admin.service"; + +@Component({ + selector: "app-elasticsearch", + templateUrl: "./elasticsearch.component.html", + styleUrls: ["./elasticsearch.component.css"] +}) +export class ElasticsearchComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() db: Db; + tempDb: Db; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService + ) { } + + ngOnInit() { + // cache for display + this.tempDb = new Db(); + const feed = { + name: "Elasticsearch", + enabled: this.db.enabled, + host: this.db.host, + port: this.db.port, + database: this.db.database, + encrypt: this.db.encrypt, + login: this.db.login, + pass: this.db.pass + }; + this.tempDb = feed; + } + + passBack() { + this.db = this.tempDb; + this.passEntry.emit(this.db); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.html new file mode 100644 index 00000000..39b905b3 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.html @@ -0,0 +1,136 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts new file mode 100644 index 00000000..dafbdadc --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { HdfsComponent } from "./H./hdfs.component + +describe("HdfsComponent", () => { + let component: HdfsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HdfsComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HdfsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.ts new file mode 100644 index 00000000..42ac7748 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/hdfs/hdfs.component.ts @@ -0,0 +1,67 @@ +/* + * ============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 + * + */ + +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Db } from "src/app/core/models/db.model"; +import { AdminService } from "src/app/core/services/admin.service"; + +@Component({ + selector: "app-hdfs", + templateUrl: "./hdfs.component.html", + styleUrls: ["./hdfs.component.css"] +}) +export class HdfsComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() db: Db; + tempDb: Db; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService + ) { } + + ngOnInit() { + // cache for display + this.tempDb = new Db(); + const feed = { + name: "HDFS", + enabled: this.db.enabled, + host: this.db.host, + port: this.db.port, + database: this.db.database, + encrypt: this.db.encrypt, + login: this.db.login, + pass: this.db.pass + }; + this.tempDb = feed; + } + + passBack() { + this.db = this.tempDb; + this.passEntry.emit(this.db); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.css b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.html b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.html new file mode 100644 index 00000000..48dc0516 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.html @@ -0,0 +1,146 @@ + + +
+ + + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts new file mode 100644 index 00000000..a9ff1b8d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { MongodbComponent } from "./mongodb.component"; + +describe("MongodbComponent", () => { + let component: MongodbComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [MongodbComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MongodbComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.ts new file mode 100644 index 00000000..606a132d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database-list/dbs-modal/mongodb/mongodb.component.ts @@ -0,0 +1,67 @@ +/* + * ============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 + * + */ + +import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Db } from "src/app/core/models/db.model"; +import { AdminService } from "src/app/core/services/admin.service"; + +@Component({ + selector: "app-mongodb", + templateUrl: "./mongodb.component.html", + styleUrls: ["./mongodb.component.css"] +}) +export class MongodbComponent { + @Output() passEntry: EventEmitter = new EventEmitter(); + @Input() db: Db; + tempDb: Db; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService + ) { } + + ngOnInit() { + // cache for display + this.tempDb = new Db(); + const feed = { + name: "MongoDB", + enabled: this.db.enabled, + host: this.db.host, + port: this.db.port, + database: this.db.database, + encrypt: this.db.encrypt, + login: this.db.login, + pass: this.db.pass + }; + this.tempDb = feed; + } + + passBack() { + this.db = this.tempDb; + this.passEntry.emit(this.db); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/database/database.component.css b/components/datalake-handler/admin/src/src/app/views/database/database.component.css new file mode 100644 index 00000000..d6d32ca4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database.component.css @@ -0,0 +1,19 @@ +/* +* ============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========================================================= +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/database/database.component.html b/components/datalake-handler/admin/src/src/app/views/database/database.component.html new file mode 100644 index 00000000..5ba0e314 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database.component.html @@ -0,0 +1,28 @@ + + + +
+
+ Home > Database Connections +
+
+ + diff --git a/components/datalake-handler/admin/src/src/app/views/database/database.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/database/database.component.spec.ts new file mode 100644 index 00000000..a2a7e8db --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { DatabaseComponent } from "./database.component"; + +describe("DatabaseComponent", () => { + let component: DatabaseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DatabaseComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatabaseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/database/database.component.ts b/components/datalake-handler/admin/src/src/app/views/database/database.component.ts new file mode 100644 index 00000000..6b192111 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/database/database.component.ts @@ -0,0 +1,41 @@ +/* + * ============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 + * + */ + +import { Component, OnInit } from "@angular/core"; +import { AdminService } from "../../core/services/admin.service"; + +@Component({ + selector: "app-database", + templateUrl: "./database.component.html", + styleUrls: ["./database.component.css"] +}) +export class DatabaseComponent implements OnInit { + constructor(private adminService: AdminService) { + this.adminService.setTitle("SIDEBAR.DATABASE"); + } + + ngOnInit() { } +} diff --git a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.css b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.css new file mode 100644 index 00000000..9f2bcedc --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.css @@ -0,0 +1,47 @@ +/* +* ============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========================================================= +*/ + +.dashboard-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + position: relative; + width: 100%; + height: 100%; +} + +.dashboard-panel .feeder-title { + color: #5DBEBB; + letter-spacing: 1.79px; + text-align: left; + margin: 20px 0 -10px 20px; +} + +.dashboard-panel .feeder-info { + text-align: center; + align-items: center; + vertical-align: middle; + min-height: 180px; +} + +.dashboard-panel .feeder-info-font { + color: #313032; + letter-spacing: 5px; +} diff --git a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.html b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.html new file mode 100644 index 00000000..64ba834c --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.html @@ -0,0 +1,56 @@ + + + +
+
+ Home > DataLake Feeder +
+
+ +
+
+
+
+
+ Topics +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
diff --git a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.spec.ts new file mode 100644 index 00000000..b5ee7ecd --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.spec.ts @@ -0,0 +1,44 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { FeederComponent } from "./feeder.component"; + +describe("FeederComponent", () => { + let component: FeederComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [FeederComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FeederComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts new file mode 100644 index 00000000..921910b8 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts @@ -0,0 +1,81 @@ +/* + * ============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 + * + */ + +import { Component, OnInit } from "@angular/core"; +import { AdminService } from "src/app/core/services/admin.service"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { HeaderComponent } from "src/app/shared/layout/header/header.component"; + +// notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; + +@Component({ + selector: "app-feeder", + templateUrl: "./feeder.component.html", + styleUrls: ["./feeder.component.css"] +}) +export class FeederComponent implements OnInit { + topicContent: string = ""; + + constructor( + private adminService: AdminService, + private restApiService: RestApiService, + private notificationService: ToastrNotificationService, + private spinner: NgxSpinnerService + ) { + this.adminService.setTitle("SIDEBAR.FEDDFER"); + this.restApiService.getTopicsFromFeeder().subscribe( + res => { + this.topicContent = res.length.toString(); + setTimeout(() => { + this.spinner.hide(); + }, 500); + }, + err => { + this.topicContent = "No Data"; + this.notificationService.error(err); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + ); + } + + ngOnInit() { + this.spinner.show(); + } + + chkTopicContent() { + if (this.topicContent == "No Data") { + return false; + } else { + return true; + } + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/test/test.component.css b/components/datalake-handler/admin/src/src/app/views/test/test.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/views/test/test.component.html b/components/datalake-handler/admin/src/src/app/views/test/test.component.html new file mode 100644 index 00000000..f4d08c15 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/test/test.component.html @@ -0,0 +1,20 @@ +
+

Test module is used for some publice business modules sample

+
+

Module 1 -----> card

+ + +
+
+

Module 2 -----> modal

+ +
+
+

Module 3 -----> search

+ +
+
+

Module 4 -----> table

+ +
+
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/views/test/test.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/test/test.component.spec.ts new file mode 100644 index 00000000..ef4e38cb --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/test/test.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TestComponent } from './test.component'; + +describe('TestComponent', () => { + let component: TestComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TestComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TestComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 00000000..ff623a7f --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/test/test.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-test', + templateUrl: './test.component.html', + styleUrls: ['./test.component.css'] +}) +export class TestComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.css b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.html b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.html new file mode 100644 index 00000000..c45b8fdb --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.html @@ -0,0 +1,229 @@ + + +
+ + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts new file mode 100644 index 00000000..536f3a9e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewTopicModelComponent } from './new-topic-model.component'; + +describe('NewTopicModelComponent', () => { + let component: NewTopicModelComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NewTopicModelComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NewTopicModelComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 00000000..82bbcb69 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/new-topic-model/new-topic-model.component.ts @@ -0,0 +1,157 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + 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. +*/ +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { AdminService } from "src/app/core/services/admin.service"; +import { Topic } from "src/app/core/models/topic.model"; + +@Component({ + selector: 'app-new-topic-model', + templateUrl: './new-topic-model.component.html', + styleUrls: ['./new-topic-model.component.css'] +}) +export class NewTopicModelComponent implements OnInit { + @Input() newTopic: Topic; + @Output() passEntry: EventEmitter = new EventEmitter(); + TopicInput: Topic; + // page elements + dbs: any = []; + dataFormats: Array = ["JSON", "XML"]; + tempSeletedDbs: any = []; + idExFields: Array = []; + idExNewField: any = {}; + @ViewChild("t_topicname") t_topicname: ElementRef; + @ViewChild("t_login") t_login: ElementRef; + @ViewChild("t_password") t_password: ElementRef; + @ViewChild("t_dataFormat") t_dataFormat: ElementRef; + @ViewChild("t_ttl") t_ttl: ElementRef; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService, + private restApiService: RestApiService + ) { + this.getDbs(); + } + + ngOnInit() { + this.newTopic = { + name: "", + login: "", + password: "", + sinkdbs: [], + enabled: false, + saveRaw: false, + dataFormat: this.dataFormats[0], + ttl: null, + correlateClearedMessage: false, + messageIdPath: null, + type: null + }; + this.TopicInput = new Topic(); + const feeds = { + name: this.newTopic.name, + login: this.newTopic.login, + password: this.newTopic.password, + sinkdbs: this.newTopic.sinkdbs, + enabled: this.newTopic.enabled, + saveRaw: this.newTopic.saveRaw, + dataFormat: this.newTopic.dataFormat, + ttl: this.newTopic.ttl, + correlateClearedMessage: this.newTopic.correlateClearedMessage, + messageIdPath: this.newTopic.messageIdPath, + type: null + }; + this.TopicInput = feeds; + this.idExFields = []; + if (this.TopicInput.messageIdPath != null) { + var feed = this.TopicInput.messageIdPath.split(","); + for (var i = 0; i < feed.length; i++) { + var data = { item: feed[i] }; + this.idExFields.push(data); + } + } else { + this.idExFields.push([]); + } + } + + getDbs() { + this.dbs = []; + this.restApiService.getDbList().subscribe((data: {}) => { + this.dbs = data; + }); + } + + updateSelectedDB(event: any, name: string) { + if (event.target.checked) { + if (!this.tempSeletedDbs.find(db => db === name)) { + this.tempSeletedDbs.push(name); + } + } else { + const index = this.tempSeletedDbs.indexOf(name, 0); + if (index > -1) { + this.tempSeletedDbs.splice(index, 1); + } + } + } + + addIdField() { + this.idExFields.push(this.idExNewField); + this.idExNewField = {}; + } + + deleteIdField(index: number) { + if (this.idExFields.length > 1) { + this.idExFields.splice(index, 1); + } + } + + passBack() { + this.newTopic = this.TopicInput; + this.newTopic.name = this.t_topicname.nativeElement.value; + this.newTopic.login = this.t_login.nativeElement.value; + this.newTopic.password = this.t_password.nativeElement.value; + this.newTopic.sinkdbs = this.tempSeletedDbs; + this.newTopic.dataFormat = this.t_dataFormat.nativeElement.value; + this.newTopic.ttl = this.t_ttl.nativeElement.value; + this.newTopic.messageIdPath = ""; + for (var i = 0; i < this.idExFields.length; i++) { + let item = "/" + this.idExFields[i].item; + if (i == 0) { + this.newTopic.messageIdPath = item; + } else { + this.newTopic.messageIdPath = + this.newTopic.messageIdPath + "," + item; + } + } + // Reset to default + if (this.newTopic.sinkdbs.length == 0) { + return false; + } + console.log(this.newTopic); + this.passEntry.emit(this.newTopic); + } + +} diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.css b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.html b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.html new file mode 100644 index 00000000..bfa3f572 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.html @@ -0,0 +1,164 @@ + + +
+ + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts new file mode 100644 index 00000000..9c3ec518 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TopicConfigModalComponent } from './topic-config-modal.component'; + +describe('TopicConfigModalComponent', () => { + let component: TopicConfigModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TopicConfigModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TopicConfigModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.ts new file mode 100644 index 00000000..b67dff19 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-config-modal/topic-config-modal.component.ts @@ -0,0 +1,110 @@ +/* + * ============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 + * + */ + +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { AdminService } from "src/app/core/services/admin.service"; +import { Topic } from "src/app/core/models/topic.model"; + +@Component({ + selector: "app-topic-config-modal", + templateUrl: "./topic-config-modal.component.html", + styleUrls: ["./topic-config-modal.component.css"] +}) +export class TopicConfigModalComponent implements OnInit { + @Input() topic: Topic; + @Input() title: string; + @Output() passEntry: EventEmitter = new EventEmitter(); + + // page elements + dbs: any = []; + dataFormats: Array = ["JSON", "XML"]; + tempSeletedDbs: any = []; + tempEnabled: boolean; + tempSaveRaw: boolean; + @ViewChild("t_login") t_login: ElementRef; + @ViewChild("t_password") t_password: ElementRef; + @ViewChild("t_dataFormat") t_dataFormat: ElementRef; + @ViewChild("t_ttl") t_ttl: ElementRef; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService, + private restApiService: RestApiService + ) { + this.getDbs(); + } + + ngOnInit() { + // for display + this.topic.sinkdbs.forEach(item => { + this.tempSeletedDbs.push(item); + }); + this.tempEnabled = this.topic.enabled; + this.tempSaveRaw = this.topic.saveRaw; + } + + getDbs() { + this.dbs = []; + this.restApiService.getDbList().subscribe((data: {}) => { + this.dbs = data; + }); + } + + updateSelectedDB(event: any, name: string) { + if (event.target.checked) { + if (!this.tempSeletedDbs.find(db => db === name)) { + this.tempSeletedDbs.push(name); + } + } else { + const index = this.tempSeletedDbs.indexOf(name, 0); + if (index > -1) { + this.tempSeletedDbs.splice(index, 1); + } + } + } + + passBack() { + this.topic.enabled = this.tempEnabled; + this.topic.login = this.t_login.nativeElement.value; + this.topic.password = this.t_password.nativeElement.value; + this.topic.sinkdbs = this.tempSeletedDbs; + this.topic.dataFormat = this.t_dataFormat.nativeElement.value; + this.topic.ttl = this.t_ttl.nativeElement.value; + this.topic.saveRaw = this.tempSaveRaw; + + this.passEntry.emit(this.topic); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html new file mode 100644 index 00000000..fa07903b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.html @@ -0,0 +1,223 @@ + + +
+ + + + + +
diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts new file mode 100644 index 00000000..ee6fcad3 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TopicDetailModalComponent } from './topic-detail-modal.component'; + +describe('TopicDetailModalComponent', () => { + let component: TopicDetailModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TopicDetailModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TopicDetailModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts new file mode 100644 index 00000000..e2dd1825 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-detail-modal/topic-detail-modal.component.ts @@ -0,0 +1,152 @@ +/* + * ============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 + * + */ + +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { AdminService } from "src/app/core/services/admin.service"; +import { Topic } from "src/app/core/models/topic.model"; + +@Component({ + selector: "app-topic-detail-modal", + templateUrl: "./topic-detail-modal.component.html", + styleUrls: ["./topic-detail-modal.component.css"] +}) +export class TopicDetailModalComponent implements OnInit { + @Input() topic: Topic; + @Output() passEntry: EventEmitter = new EventEmitter(); + + // page elements + dbs: any = []; + dataFormats: Array = ["JSON", "XML"]; + tempSeletedDbs: any = []; + tempEnabled: boolean; + tempSaveRaw: boolean; + tempMsg: boolean; + idExFields: Array = []; + idExNewField: any = {}; + @ViewChild("t_login") t_login: ElementRef; + @ViewChild("t_password") t_password: ElementRef; + @ViewChild("t_dataFormat") t_dataFormat: ElementRef; + @ViewChild("t_ttl") t_ttl: ElementRef; + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService, + private restApiService: RestApiService + ) { + this.getDbs(); + } + ngOnInit() { + // for display + this.topic.sinkdbs.forEach(item => { + this.tempSeletedDbs.push(item); + }); + this.tempEnabled = this.topic.enabled; + this.tempSaveRaw = this.topic.saveRaw; + this.tempMsg = this.topic.correlateClearedMessage; + this.idExFields = []; + + if (this.topic.messageIdPath != null) { + var feed = this.topic.messageIdPath.split(","); + for (var i = 0; i < feed.length; i++) { + var data = { item: feed[i] }; + this.idExFields.push(data); + } + } else { + this.idExFields.push([]); + } + } + + getDbs() { + this.dbs = []; + this.restApiService.getDbList().subscribe((data: {}) => { + this.dbs = data; + }); + } + + updateSelectedDB(event: any, name: string) { + if (event.target.checked) { + if (!this.tempSeletedDbs.find(db => db === name)) { + this.tempSeletedDbs.push(name); + } + } else { + const index = this.tempSeletedDbs.indexOf(name, 0); + if (index > -1) { + this.tempSeletedDbs.splice(index, 1); + } + } + } + + addIdField() { + this.idExFields.push(this.idExNewField); + this.idExNewField = {}; + } + + deleteIdField(index: number) { + if (this.idExFields.length > 1) { + this.idExFields.splice(index, 1); + } + } + + passBack() { + this.topic.enabled = this.tempEnabled; + this.topic.login = this.t_login.nativeElement.value; + this.topic.password = this.t_password.nativeElement.value; + + this.topic.sinkdbs = this.tempSeletedDbs; + + this.topic.dataFormat = this.t_dataFormat.nativeElement.value; + this.topic.ttl = this.t_ttl.nativeElement.value; + this.topic.saveRaw = this.tempSaveRaw; + this.topic.correlateClearedMessage = this.tempMsg; + this.topic.messageIdPath = ""; + for (var i = 0; i < this.idExFields.length; i++) { + if (i == 0) { + this.topic.messageIdPath = this.idExFields[i].item; + } else { + this.topic.messageIdPath = + this.topic.messageIdPath + "," + this.idExFields[i].item; + } + } + + // Reset to default + if (this.topic.sinkdbs.length == 0) { + this.topic.type = false; + } else { + this.topic.type = true; + } + this.passEntry.emit(this.topic); + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.css b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.css new file mode 100644 index 00000000..bb3e0e80 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.css @@ -0,0 +1,5 @@ +.topic-list-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; +} 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 new file mode 100644 index 00000000..519cc9da --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.html @@ -0,0 +1,728 @@ + + +
+
+
+
+ +
+
+ +
+ +
+
+
+ + +
+ + +
+
+
+
+ + +
+
+ + + +
+ + + + + + + + +
+
+ + + + {{ row.name }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ row.ttl }} + + + + +
+ + + + + + + + +
+
+ + +
+ + + + + + + + +
+
+ + + +   {{ 'CONFIGURED' | translate }}   +   {{ 'UNCONFIGURED' | translate }}   + + + + + + + + + + + + + +
+ total: {{ rowCount.toLocaleString() }} +
+ + +
+
+
+
+
+
diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.spec.ts new file mode 100644 index 00000000..531afbb7 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { TopicListComponent } from "./topic-list.component"; + +describe("TopicListComponent", () => { + let component: TopicListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TopicListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TopicListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 00000000..7f2b6f04 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topic-list/topic-list.component.ts @@ -0,0 +1,407 @@ +/* + * ============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 + * + */ + +import { Component, ViewChild, ElementRef } from "@angular/core"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +import { Topic } from "src/app/core/models/topic.model"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; + +// modal +import { TopicDetailModalComponent } from "./topic-detail-modal/topic-detail-modal.component"; +import { TopicConfigModalComponent } from "./topic-config-modal/topic-config-modal.component"; +import { NewTopicModelComponent } from "./new-topic-model/new-topic-model.component"; + +// notify +import { ToastrNotificationService } from "src/app/shared/components/toastr-notification/toastr-notification.service"; + +// Loading spinner +import { NgxSpinnerService } from "ngx-spinner"; +import { AlertComponent } from "../../../shared/components/alert/alert.component"; + +@Component({ + selector: "app-topic-list", + templateUrl: "./topic-list.component.html", + styleUrls: ["./topic-list.component.css"] +}) +export class TopicListComponent { + topicListDmaap: any = []; + topicListFeeder: any = []; + topicDefaultConfig: Topic; + + topics: Topic[] = []; + temp: Topic[] = []; // cache for topics + tempTopicDetail: Topic; // temp for a topic + tempNewTopic: Topic; // temp for a newtopic + + loadingIndicator: boolean = true; + mesgNoData = { + emptyMessage: ` +
+
+ +
+
+ ` + }; + + @ViewChild("searchText") searchText: ElementRef; + @ViewChild("mydatatable") topicTable; + + constructor( + private restApiService: RestApiService, + private modalService: NgbModal, + private notificationService: ToastrNotificationService, + private spinner: NgxSpinnerService + ) { + setTimeout(() => { + this.loadingIndicator = false; + }, 5000); + this.init() + + } + + ngOnInit() { + this.spinner.show(); + } + + init() { + this.initData().then(data => { + this.initTopicList(this.topicListDmaap, this.topicListFeeder).then( + data => { + // for cache of datatable + this.temp = [...data]; + this.topics = data; + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + ); + }); + } + + async initData() { + this.topicListDmaap = []; + this.topicListDmaap = await this.getTopicList("dmaap"); + + this.topicListFeeder = []; + this.topicListFeeder = await this.getTopicList("feeder"); + + this.topicDefaultConfig = new Topic(); + this.topicDefaultConfig = await this.getTopicDefaultConfig(); + + return true; + } + + getTopicList(type: string) { + var data: any; + + switch (type) { + case "dmaap": { + data = this.restApiService.getTopicsFromDmaap().toPromise(); + break; + } + case "feeder": { + data = this.restApiService.getTopicsFromFeeder().toPromise(); + break; + } + } + return data; + } + + getTopicDefaultConfig() { + return this.restApiService.getTopicDefaultConfig().toPromise(); + } + + 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 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 + }; + t.push(feed); + } + } + + return t; + } + + onActivate(event) { + const emitType = event.type; + if (emitType == "dblclick") { + console.log('Activate Event', event); + let name = event.row.name; + this.openTopicModal(name); + } + + } + + openNewTopicModal() { + const modalRef = this.modalService.open(NewTopicModelComponent, { + size: "lg", + centered: true + }); + modalRef.componentInstance.newTopic = this.tempNewTopic; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + console.log(receivedEntry, "newtopic receivedEntry"); + this.tempNewTopic = receivedEntry; + this.restApiService.addNewTopic(this.tempNewTopic).subscribe( + res => { + this.init(); + this.notificationService.success("SUCCESSFULLY_CREARED"); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + } + ); + }) + + + } + + openTopicModal(name: string) { + if (name == "config") { + const modalRef = this.modalService.open(TopicConfigModalComponent, { + windowClass: "dl-md-modal", + centered: true + }); + modalRef.componentInstance.title = "Topics Default Configurations"; + modalRef.componentInstance.topic = this.topicDefaultConfig; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + this.restApiService + .updateTopicDefaultConfig(this.topicDefaultConfig) + .subscribe( + res => { + this.topicDefaultConfig = receivedEntry; + this.topics.forEach(t => { + if (!t.type) { + // Unconfigure topics + t.login = this.topicDefaultConfig.login; + t.password = this.topicDefaultConfig.password; + t.sinkdbs = this.topicDefaultConfig.sinkdbs; + t.enabled = this.topicDefaultConfig.enabled; + t.saveRaw = this.topicDefaultConfig.saveRaw; + t.dataFormat = this.topicDefaultConfig.dataFormat; + t.ttl = this.topicDefaultConfig.ttl; + t.correlateClearedMessage = this.topicDefaultConfig.correlateClearedMessage; + t.messageIdPath = this.topicDefaultConfig.messageIdPath; + } + }); + this.notificationService.success("Success updated."); + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + }); + } else { + const index = this.temp.findIndex(t => t.name === name); + const modalRef = this.modalService.open(TopicDetailModalComponent, { + size: "lg", + centered: true + }); + modalRef.componentInstance.topic = this.temp[index]; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + this.tempTopicDetail = receivedEntry; + // Configured topic + if (this.tempTopicDetail.type) { + this.restApiService.getTopicsFromFeeder().subscribe( + res => { + if (res.find(name => name === this.tempTopicDetail.name)) { + // Update topic from db + this.restApiService.upadteTopic(this.tempTopicDetail).subscribe( + res => { + this.temp[index] = this.tempTopicDetail; + this.topics = this.temp; + this.notificationService.success("SUCCESSFULLY_UPDATED"); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + } + ); + } else { + // Insert topic from db + this.restApiService.addTopic(this.tempTopicDetail).subscribe( + res => { + this.init(); + this.notificationService.success("SUCCESSFULLY_CREARED"); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + } + ); + } + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } else { + // Reset to default and delete topic from db + this.restApiService.deleteTopic(this.tempTopicDetail.name).subscribe( + res => { + this.init(); + this.notificationService.success("SUCCESSFULLY_DELETED"); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + } + ); + } + }); + } + } + + deleteTopicModal(name: string) { + const index = this.temp.findIndex(t => t.name === name); + const modalRef = this.modalService.open(AlertComponent, { + size: "sm", + centered: true + }); + modalRef.componentInstance.message = "ARE_YOU_SURE_DELETE"; + console.log(this.temp[index]); + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + this.restApiService.deleteTopic(this.temp[index].name).subscribe( + res => { + this.init(); + this.notificationService.success("SUCCESSFULLY_DELETED"); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + this.updateFilter(this.searchText.nativeElement.value); + } + ); + + }) + } + + getTopicDetail(name: string) { + return this.restApiService.getTopicDetail(name).toPromise(); + } + + updateFilter(searchValue) { + const val = searchValue.toLowerCase(); + + // filter our data + const temp = this.temp.filter(function (d) { + return d.name.toLowerCase().indexOf(val) !== -1 || !val; + }); + + // update the rows + this.topics = temp; + } +} diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topics.component.css b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.css new file mode 100644 index 00000000..e69de29b diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topics.component.html b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.html new file mode 100644 index 00000000..25274404 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.html @@ -0,0 +1,9 @@ +
+
+ Home > Topics +
+ +
+ +
+
diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topics.component.spec.ts b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.spec.ts new file mode 100644 index 00000000..f38f85e6 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TopicsComponent } from './topics.component'; + +describe('TopicsComponent', () => { + let component: TopicsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TopicsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TopicsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/views/topics/topics.component.ts b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.ts new file mode 100644 index 00000000..d8647fec --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/views/topics/topics.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from "@angular/core"; +import { AdminService } from "../../core/services/admin.service"; + +@Component({ + selector: "app-topics", + templateUrl: "./topics.component.html", + styleUrls: ["./topics.component.css"] +}) +export class TopicsComponent implements OnInit { + constructor(private adminService: AdminService) { + // Set page title + this.adminService.setTitle("SIDEBAR.TOPICS"); + } + + ngOnInit() { } +} -- cgit