From 1bcbf004b19e8486718550cddd7ae0d41561dd39 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Mon, 4 Nov 2019 14:26:04 +0100 Subject: [PATCH] Non-RT RIC Dashboard Removed unused code. Added Nordix to some copyright texts. Change-Id: I5bb26466418d826bd4005689915c64ddd8630674 Issue-ID: NONRTRIC-61 Signed-off-by: PatrikBuhr --- dashboard/INFO.yaml | 47 ------- dashboard/README.md | 5 +- dashboard/docs/overview.rst | 88 ++----------- dashboard/docs/release-notes.rst | 146 +-------------------- .../dashboard/config/WebSecurityConfiguration.java | 1 + .../dashboard/controller/Html5PathsController.java | 3 +- .../portal/dashboard/k8sapi/CaasIngressDemo.java | 44 ------- .../src/main/resources/application.properties | 17 +-- dashboard/webapp-frontend/README.md | 1 + .../src/app/app-control/app-control.animations.ts | 28 ---- .../src/app/app-control/app-control.component.html | 100 -------------- .../src/app/app-control/app-control.component.scss | 46 ------- .../app/app-control/app-control.component.spec.ts | 44 ------- .../src/app/app-control/app-control.component.ts | 103 --------------- .../src/app/app-control/app-control.datasource.ts | 134 ------------------- .../src/app/control/control.component.html | 24 ---- .../src/app/control/control.component.scss | 22 ---- .../src/app/control/control.component.spec.ts | 44 ------- .../src/app/control/control.component.ts | 34 ----- .../src/app/footer/footer.component.html | 3 + .../src/app/footer/footer.component.ts | 4 +- .../ran-connection-dialog.component.html | 54 -------- .../ran-connection-dialog.component.scss | 29 ---- .../ran-control/ran-connection-dialog.component.ts | 124 ----------------- .../src/app/ran-control/ran-control.component.html | 89 ------------- .../src/app/ran-control/ran-control.component.scss | 51 ------- .../app/ran-control/ran-control.component.spec.ts | 44 ------- .../src/app/ran-control/ran-control.component.ts | 107 --------------- .../src/app/ran-control/ran-control.datasource.ts | 72 ---------- dashboard/webapp-frontend/src/app/rd.module.ts | 29 +--- .../add-dashboard-user-dialog.component.html | 44 ------- .../add-dashboard-user-dialog.component.scss | 23 ---- .../add-dashboard-user-dialog.component.ts | 61 --------- .../edit-dashboard-user-dialog.component.html | 44 ------- .../edit-dashboard-user-dialog.component.scss | 23 ---- .../edit-dashboard-user-dialog.component.ts | 63 --------- .../src/app/user/user.component.html | 76 ----------- .../src/app/user/user.component.scss | 46 ------- .../src/app/user/user.component.spec.ts | 44 ------- .../webapp-frontend/src/app/user/user.component.ts | 97 -------------- .../src/app/user/user.datasource.ts | 102 -------------- 41 files changed, 34 insertions(+), 2126 deletions(-) delete mode 100644 dashboard/INFO.yaml delete mode 100644 dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/k8sapi/CaasIngressDemo.java delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.animations.ts delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.component.html delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.component.spec.ts delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/app-control/app-control.datasource.ts delete mode 100644 dashboard/webapp-frontend/src/app/control/control.component.html delete mode 100644 dashboard/webapp-frontend/src/app/control/control.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/control/control.component.spec.ts delete mode 100644 dashboard/webapp-frontend/src/app/control/control.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.html delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-control.component.html delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-control.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-control.component.spec.ts delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-control.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/ran-control/ran-control.datasource.ts delete mode 100644 dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.html delete mode 100644 dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.html delete mode 100644 dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/user/user.component.html delete mode 100644 dashboard/webapp-frontend/src/app/user/user.component.scss delete mode 100644 dashboard/webapp-frontend/src/app/user/user.component.spec.ts delete mode 100644 dashboard/webapp-frontend/src/app/user/user.component.ts delete mode 100644 dashboard/webapp-frontend/src/app/user/user.datasource.ts diff --git a/dashboard/INFO.yaml b/dashboard/INFO.yaml deleted file mode 100644 index 2cc88273..00000000 --- a/dashboard/INFO.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -project: 'portal/ric-dashboard' -project_creation_date: '2019-05-21' -project_category: '' -lifecycle_state: 'Incubation' -project_lead: &portal_ric_dashboard_ptl - name: 'TBD' - email: 'TBD' - id: 'TBD' - company: 'AT&T Labs-Research' - timezone: 'America/New_York' -primary_contact: *portal_ric_dashboard_ptl -issue_tracking: - type: 'jira' - url: 'https://jira.o-ran-sc.org/projects/RICPLT' - key: 'DASHBOARD' -mailing_list: - type: 'groups.io' - url: 'https://lists.o-ran-sc.org/g/main' - tag: '<[portal/ric-dashboard]>' -realtime_discussion: - type: 'irc' - server: 'freenode.net' - channel: '#o-ran-sc' -meetings: - - type: 'zoom' - agenda: '' - url: '' - server: 'n/a' - channel: 'n/a' - repeats: 'weekly' - time: '' -repositories: - - 'portal/ric-dashboard' -committers: - - name: 'Chris Lott' - email: 'clott@research.att.com' - company: 'AT&T Labs-Research' - id: 'cl778h' - timezone: 'America/New_York' - - name: 'Manoop Talasila' - email: 'talasila@research.att.com' - company: 'ATT' - id: 'talasila' - timezone: 'America/New_York' -tsc: - approval: 'https://lists.o-ran-sc.org/g/toc' diff --git a/dashboard/README.md b/dashboard/README.md index 9dbc046e..03da2f29 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -1,6 +1,6 @@ -# O-RAN-SC RIC Dashboard Web Application +# O-RAN-SC NonRT RIC Dashboard Web Application -The O-RAN SC RIC Dashboard provides administrative and operator +The O-RAN NonRT RIC Dashboard provides administrative and operator functions for a radio access network (RAN) controller. This web app consists of an Angular (version 8) front end and a Java (version 11) Spring-Boot (version 2.1) back end. @@ -13,6 +13,7 @@ URL `http://your-host-name-here:8080/swagger-ui.html` ## License Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +Modifications Copyright (C) 2019 Nordix Foundation 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 diff --git a/dashboard/docs/overview.rst b/dashboard/docs/overview.rst index a58986e0..f0d5c957 100644 --- a/dashboard/docs/overview.rst +++ b/dashboard/docs/overview.rst @@ -1,14 +1,14 @@ -.. ===============LICENSE_START======================================================= -.. O-RAN SC CC-BY-4.0 +.. ========================LICENSE_START================================= +.. O-RAN-SC .. %% -.. Copyright (C) 2019 AT&T Intellectual Property +.. Copyright (C) 2019 Nordix Foundation .. %% .. 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 -.. + +.. 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. @@ -16,83 +16,15 @@ .. limitations under the License. .. ===============LICENSE_END========================================================= -RIC Dashboard Overview +NonRT RIC Dashboard Overview ====================== -The O-RAN SC RIC Dashboard provides administrative and operator -functions for a radio access network (RAN) controller. The web app is +The O-RAN NonRT RIC Dashboard provides administrative and operator +functions managing policies. The web app is built as a single-page app using an Angular (version 8) front end and a Java (version 11) Spring-Boot (version 2.1) back end. Project Resources ----------------- +TBD -The source code is available from the Linux Foundation Gerrit server: - - ``_ - -The build (CI) jobs are in the Linux Foundation Jenkins server: - - ``_ - -Issues are tracked in the Linux Foundation Jira server: - - ``_ - -Project information is available in the Linux Foundation Wiki: - - ``_ - - -A1 Mediator ------------ - -The Dashboard interfaces with the A1 Mediator. This platform -component is accessed via HTTP/REST requests using a client that is -generated from an API specification published by the A1 Mediator team. - -The A1 Mediator supports fetching and storing configuration of -applications, which is referred to as getting or setting a policy. -The Dashboard UI provides screens to view and modify configuration -data for such applications. As of this writing, the only application -that is managed via the A1 Mediator interface is the Admission Control -("AC") application. - - -Application Manager -------------------- - -The Dashboard interfaces with the Application Manager. This platform -component is accessed via HTTP/REST requests using a client that is -generated from an API specification published by the Application -Manager team. - -The Application Manager supports deploying, undeploying and -configuring applications in the RIC. The Dashboard UI provides screens -for these functions. - - -Automatic Neighbor Relation Application ---------------------------------------- - -The Dashboard interfaces with the Automatic Neighbor Relation (ANR) -application. This RIC application is accessed via HTTP/REST requests -using a client that is generated from an API specification published -by the ANR team. - -This RIC application discovers and manages the Neighbor Cell Relation -Table (NCRT). The Dashboard UI provides screens to view and modify -NCRT data. - - -E2 Manager ----------- - -The Dashboard interfaces with the E2 Manager. This platform -component is accessed via HTTP/REST requests using a client that is -generated from an API specification published by the E2 Manager team. - -The E2 Manager platform component supports connecting and -disconnecting RAN elements. The Dashboard UI provides controls for -operators to create "ENDC" and "X2" connections, and to disconnect RAN -elements. diff --git a/dashboard/docs/release-notes.rst b/dashboard/docs/release-notes.rst index 19a9e55b..b9ee3fd6 100644 --- a/dashboard/docs/release-notes.rst +++ b/dashboard/docs/release-notes.rst @@ -1,7 +1,7 @@ .. ===============LICENSE_START======================================================= .. O-RAN SC CC-BY-4.0 .. %% -.. Copyright (C) 2019 AT&T Intellectual Property +.. Copyright (C) 2019 Nordix Foundation .. %% .. Licensed under the Apache License, Version 2.0 (the "License"); .. you may not use this file except in compliance with the License. @@ -16,146 +16,6 @@ .. limitations under the License. .. ===============LICENSE_END========================================================= -RIC Dashboard Release Notes -=========================== +NonTR RIC Dashboard Release Notes +================================= -Version 1.2.4, 24 Oct 2019 --------------------------- -* Revise a1-med-client to use API spec in new submodule ric-plt/a1; - removed cached copy -* Revise app manager client to use API spec in new submodule ric-plt/appmgr; - removed cached copy -* Add Platform page showing Kubernetes pods in aux and platform obtained from CAAS-Ingress -* Update Angular libraries to recent stable versions -* Revise user controller to answer data sent by portal, drop the mock implementation -* Set global style for page titles -* Align page titles to top left,decrease font size -* Update EPSDK-FW to version 2.6 -* Make constructor robust to missing caasingress.insecure property -* Repair bug that omitted slashes in CAAS-Ingress URL builder -* Improve the dark mode -* Show container ready count with total count - -Version 1.2.3, 4 Oct 2019 -------------------------- -* Serve unauthenticated user a login-at-portal page without using redirect -* Upgrade to Spring-Boot 2.1.9.RELEASE - -Version 1.2.2, 27 Sep 2019 --------------------------- -* Support Portal security using EPSDK-FW cookie and user management - -Version 1.2.1, 20 Sep 2019 --------------------------- -* Repair E2 URLs in front end like endc-setup/endcSetup -* Extend ANR mock feature to persist edits for demos -* Block whitespace in E2 IP input field validation -* Relax validation in E2 RAN name field validation -* Make RAN connection table robust to missing fields -* Install curl when building Docker image - -Version 1.2.0, 11 Sep 2019 --------------------------- -* Split URL properties into prefix/suffix parts -* Add jacoco plugin to back-end for code coverage -* Compile with Java version 11, use base openjdk:11-jre-slim -* Clean code of issues reported by Sonar -* Drop mock RAN names feature that supported R1 testing -* Extend mock endpoints to simulate delay seen in tests -* Move mock configuration classes into test area -* Update App manager client to spec version 0.1.7 -* Add controller for page refresh of Angular routes -* Extend E2 mock configuration for demo purposes -* Add pattern for matching AC/admin application name -* Add custom (plain but not white-label) error page -* Synch A1 method paths in front-end and back-end -* Add xapp dynamic configuration feature -* Disable x-frame-options response header -* Repair app manager undeploy-app back/front methods -* Display AC xAPP metrics data via Kibana source (metrics.url.ac) on dashboard -* Pass AC policy parameter without parsing as JSON -* Use snake_case (not camelCase) names in AC policy front end -* Update A1 mediator client to spec version 0.10.3 -* Extend AC control screen to read policy from A1 -* Create loading-dialog component and service -* Showing the loading-dialog while making API call -* Add notification and error handling for xapp configuration -* Update E2 manager client to spec version 2.0.5 of 2019-09-11 -* Display MC xAPP metrics data via Kibana source (metrics.url.mc) on dashboard - -Version 1.0.5, 5 July 2019 --------------------------- -* Upgrade to Angular version 8 -* Upgrade to Spring-Boot 2.1.6.RELEASE -* Align AC xApp policy page title -* Update E2 manager client to spec version 20190703 -* Add configuration-driven mock of E2 getNodebIdList -* Revise front-end components to use prefix 'rd' -* Improve error handling in BE and FE code -* Revise the notification service to display multiple notifications -* Add JUnit test cases for controller methods - -Version 1.0.4, 27 June 2019 ---------------------------- -* Add AC xApp neighbor control screen -* Add ANR xApp neighbor cell relation table -* Drop the pendulum xApp control screen -* Add column sorting on xApp catalog, xApp control, ANR -* Add disconnect-all button to RAN connection screen -* Extend E2 service with disconnect-all method -* Update ANR xApp client to spec version 0.0.8 -* Update E2 manager client to spec version 20190620 -* Adjust CSS and HTML for main container positioning -* Revise config property keys to use URL (not basepath) -* Left menu overlap main content fix -* Extend back-end controllers to return error details -* Add feature resilient to malformed instance data -* Extend Xapp Controller with config endpoints -* Add build number to dashboard version string -* Move mock admin screen user data to backend -* Update App manager client to spec version 0.1.5 -* Move RAN connection feature to control screen -* Rework admin table -* Update the notification service -* Move RAN connection feature to control screen -* Repair deploy-app feature and use icon instead of text button - -Version 1.0.3, 28 May 2019 --------------------------- -* Add AC xApp controller to backend -* Add AC xApp interface to frontend -* Add RAN type radio selector to connection setup -* Update ANR xApp client to spec version 0.0.7 -* Update E2 manager client to spec version 20190515 -* Update xApp manager client to spec version 0.1.4 -* Add get-version methods to all controllers -* Add simple page footer with copyright and version -* Add AC and ANR xApp services -* Rename signal service to E2 Manager service -* Use XappMgrService to replace ControlService and CatalogService -* Apply mat-table to control and catalog -* RAN Connection screen upgrade to mat-table - -Version 1.0.2, 13 May 2019 --------------------------- -* Update A1 mediator client to version 0.4.0 -* Add E2 response message with timestamp and status code -* Fetch xAPP instance status information from xAPP Manager and display in dashboard -* Allow the user to initiate an E2 (X2) connection between RIC and gNB/eNB -* User input validations on connections between RIC and eNB/gNB in the dashboard -* Add ANR xApp backend with mock implementation -* Add undeploy xApp function -* Add shared confirm dialog -* Add shared notification - -Version 1.0.1, 6 May 2019 -------------------------- -* Add draft A1 Mediator API definition -* Use E2 Manager API definition dated 2 May 2019, with tag modifications -* Adjust group IDs and packages for name O-RAN-SC; drop ORAN-OSC -* Add ANR API spec and client code generator -* Update xApp Manager API spec to version 0.1.2 - -Version 1.0.0, 30 Apr 2019 --------------------------- -* Initial version diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java index b912500a..0a7f02ca 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java @@ -3,6 +3,7 @@ * O-RAN-SC * %% * Copyright (C) 2019 AT&T Intellectual Property + * Modifications Copyright (C) 2019 Nordix Foundation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/Html5PathsController.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/Html5PathsController.java index ed2e9053..7fb6e674 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/Html5PathsController.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/Html5PathsController.java @@ -3,6 +3,7 @@ * O-RAN-SC * %% * Copyright (C) 2019 AT&T Intellectual Property + * Modifications Copyright (C) 2019 Nordix Foundation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +57,7 @@ public class Html5PathsController { * On error */ @RequestMapping(method = { RequestMethod.OPTIONS, RequestMethod.GET }, // - path = { "/catalog", "/control", "/stats", "/user" }) + path = { "/policy", "/user" }) public void forwardAngularRoutes(HttpServletRequest request, HttpServletResponse response) throws IOException { URL url = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/index.html"); if (logger.isDebugEnabled()) diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/k8sapi/CaasIngressDemo.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/k8sapi/CaasIngressDemo.java deleted file mode 100644 index 3a75dfad..00000000 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/k8sapi/CaasIngressDemo.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ -package org.oransc.ric.portal.dashboard.k8sapi; - -import java.lang.invoke.MethodHandles; - -import org.oransc.ric.portal.dashboard.util.HttpsURLConnectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.ResponseEntity; -import org.springframework.web.client.RestTemplate; - -public class CaasIngressDemo { - - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - public static void main(String[] args) throws Exception { - HttpsURLConnectionUtils.turnOffSslChecking(); - // Get IP address from REC deployment team for testing - final String podsUrl = "https://10.0.0.1:16443/api/v1/namespaces/ricaux/pods"; - RestTemplate rt = new RestTemplate(); - ResponseEntity podsResponse = rt.getForEntity(podsUrl, String.class); - logger.info(podsResponse.getBody()); - HttpsURLConnectionUtils.turnOnSslChecking(); - } - -} diff --git a/dashboard/webapp-backend/src/main/resources/application.properties b/dashboard/webapp-backend/src/main/resources/application.properties index e9699682..585e795f 100644 --- a/dashboard/webapp-backend/src/main/resources/application.properties +++ b/dashboard/webapp-backend/src/main/resources/application.properties @@ -2,6 +2,7 @@ # O-RAN-SC # %% # Copyright (C) 2019 AT&T Intellectual Property +# Modifications Copyright (C) 2019 Nordix Foundation # %% # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ # limitations under the License. # ========================LICENSE_END=================================== -# Defines RIC Dashboard property keys and default values. +# Defines NonRT RIC Dashboard property keys and default values. # Create a copy in the launch directory to override values; or # copy to "application-abc.properties" as mentioned in the README. @@ -40,23 +41,11 @@ portalapi.appname = RIC Dashboard portalapi.username = portalapi.password = -# endpoint URLs must be supplied at deployment time -# A1 Mediator -a1med.url.prefix = http://jar-app-props-default-A1-URL-prefix -a1med.url.suffix = # endpoint URLs must be supplied at deployment time # A1 Controller a1controller.url.prefix = http://localhost:8282 a1controller.url.suffix = /restconf/operations -# ANR xApp -anrxapp.url.prefix = http://jar-app-props-default-ANR-URL-prefix -anrxapp.url.suffix = -# App Manager -appmgr.url.prefix = http://jar-app-props-default-Xapp-Mgr-URL -appmgr.url.suffix = /ric/v1 -# E2 Manager -e2mgr.url.prefix = http://jar-app-props-default-E2-URL -e2mgr.url.suffix = /v1 + # Kubernetes API via https://github.com/nokia/caas-ingress # Set insecure=true to disable SSL certificate and hostname checking caasingress.insecure = true diff --git a/dashboard/webapp-frontend/README.md b/dashboard/webapp-frontend/README.md index f1c849e7..569b7717 100644 --- a/dashboard/webapp-frontend/README.md +++ b/dashboard/webapp-frontend/README.md @@ -29,6 +29,7 @@ To get more help on the Angular CLI use `ng help` or go check out the [Angular C ## License Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +Modifications Copyright (C) 2019 Nordix Foundation 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 diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.animations.ts b/dashboard/webapp-frontend/src/app/app-control/app-control.animations.ts deleted file mode 100644 index c00f8773..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.animations.ts +++ /dev/null @@ -1,28 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { animate, state, style, transition, trigger } from '@angular/animations'; - -export const AppControlAnimations = { - messageTrigger: trigger('messageExpand', [ - state('collapsed', style({ height: '0px', minHeight: '0', display: 'none' })), - state('expanded', style({ height: '*' })), - ]) -} diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.component.html b/dashboard/webapp-frontend/src/app/app-control/app-control.component.html deleted file mode 100644 index ec802f47..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.component.html +++ /dev/null @@ -1,100 +0,0 @@ - - -
-

xApp Control

- - - - - App Name - {{element.xapp}} - - - - Instance Name - {{element.instance.name}} - - - - Status - {{element.instance.status}} - - - - IP - {{element.instance.ip}} - - - - Port - {{element.instance.port}} - - - - Action - - - - - - - - - - - - - No records found. - - - - - - - -
-
-
- txMessages: -
-
  • - {{rxmessage}} -
  • -
    - rxMessages: -
    -
  • - {{txmessage}} -
  • -
    -
    - -
    - -
    - -
    diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.component.scss b/dashboard/webapp-frontend/src/app/app-control/app-control.component.scss deleted file mode 100644 index 232562f4..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.component.scss +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ - .app-control__section { -} - - -.spinner-container { - height: 100px; - width: 100px; -} - -.spinner-container mat-spinner { - margin: 0 auto 0 auto; -} - -.app-control-table { - width: 100%; - min-height: 150px; - margin-top: 10px; - background-color: transparent; -} - -tr.message-row { - height: 0; -} - -.display-none { - display: none; -} diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.component.spec.ts b/dashboard/webapp-frontend/src/app/app-control/app-control.component.spec.ts deleted file mode 100644 index 6648d81b..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { AppControlComponent } from './app-control.component'; - -describe('AppControlComponent', () => { - let component: AppControlComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AppControlComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AppControlComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.component.ts b/dashboard/webapp-frontend/src/app/app-control/app-control.component.ts deleted file mode 100644 index 07b931d9..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.component.ts +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { HttpErrorResponse, HttpResponse } from '@angular/common/http'; -import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatSort } from '@angular/material/sort'; -import { Router } from '@angular/router'; -import { XappControlRow } from '../interfaces/app-mgr.types'; -import { AppMgrService } from '../services/app-mgr/app-mgr.service'; -import { ConfirmDialogService } from '../services/ui/confirm-dialog.service'; -import { ErrorDialogService } from '../services/ui/error-dialog.service'; -import { LoadingDialogService } from '../services/ui/loading-dialog.service'; -import { NotificationService } from '../services/ui/notification.service'; -import { AppControlAnimations } from './app-control.animations'; -import { AppControlDataSource } from './app-control.datasource'; -import { finalize } from 'rxjs/operators'; - -@Component({ - selector: 'rd-app-control', - templateUrl: './app-control.component.html', - styleUrls: ['./app-control.component.scss'], - animations: [AppControlAnimations.messageTrigger] -}) -export class AppControlComponent implements OnInit { - - displayedColumns: string[] = ['xapp', 'name', 'status', 'ip', 'port', 'action']; - dataSource: AppControlDataSource; - @ViewChild(MatSort, {static: true}) sort: MatSort; - - constructor( - private appMgrSvc: AppMgrService, - private router: Router, - private confirmDialogService: ConfirmDialogService, - private errorDialogService: ErrorDialogService, - private loadingDialogService: LoadingDialogService, - private notificationService: NotificationService) { } - - ngOnInit() { - this.dataSource = new AppControlDataSource(this.appMgrSvc, this.sort, this.notificationService); - this.dataSource.loadTable(); - } - - controlApp(app: XappControlRow): void { - // TODO: identify apps without hardcoding to names - const acAppPattern0 = /[Aa][Dd][Mm][Ii][Nn]/; - const acAppPattern1 = /[Aa][Dd][Mm][Ii][Ss]{2}[Ii][Oo][Nn]/; - const anrAppPattern0 = /ANR/; - const anrAppPattern1 = /[Aa][Uu][Tt][Oo][Mm][Aa][Tt][Ii][Cc]/; - const anrAppPattern2 = /[Nn][Ee][Ii][Gg][Hh][Bb][Oo][Rr]/; - if (acAppPattern0.test(app.xapp) || acAppPattern1.test(app.xapp)) { - this.router.navigate(['/ac']); - } else if (anrAppPattern0.test(app.xapp) || (anrAppPattern1.test(app.xapp) && anrAppPattern2.test(app.xapp))) { - this.router.navigate(['/anr']); - } else { - this.errorDialogService.displayError('No control available for ' + app.xapp + ' (yet)'); - } - } - - onUndeployApp(app: XappControlRow): void { - this.confirmDialogService.openConfirmDialog('Are you sure you want to undeploy App ' + app.xapp + '?') - .afterClosed().subscribe( (res: boolean) => { - if (res) { - this.loadingDialogService.startLoading("Undeploying " + app.xapp); - this.appMgrSvc.undeployXapp(app.xapp) - .pipe( - finalize(() => this.loadingDialogService.stopLoading()) - ) - .subscribe( - ( httpResponse: HttpResponse) => { - // Answers 204/No content on success - this.notificationService.success('App undeployed successfully!'); - this.dataSource.loadTable(); - }, - ( (her: HttpErrorResponse) => { - // the error field should have an ErrorTransport object - let msg = her.message; - if (her.error && her.error.message) { - msg = her.error.message; - } - this.notificationService.warn('App undeploy failed: ' + msg); - }) - ); - } - }); - } - -} diff --git a/dashboard/webapp-frontend/src/app/app-control/app-control.datasource.ts b/dashboard/webapp-frontend/src/app/app-control/app-control.datasource.ts deleted file mode 100644 index e97dc637..00000000 --- a/dashboard/webapp-frontend/src/app/app-control/app-control.datasource.ts +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { CollectionViewer, DataSource } from '@angular/cdk/collections'; -import { HttpErrorResponse } from '@angular/common/http'; -import { MatSort } from '@angular/material/sort'; -import { Observable } from 'rxjs/Observable'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { merge } from 'rxjs'; -import { of } from 'rxjs/observable/of'; -import { catchError, finalize, map } from 'rxjs/operators'; -import { XappControlRow, XMDeployedApp, XMXappInstance } from '../interfaces/app-mgr.types'; -import { AppMgrService } from '../services/app-mgr/app-mgr.service'; -import { NotificationService } from '../services/ui/notification.service'; - -export class AppControlDataSource extends DataSource { - - private appControlSubject = new BehaviorSubject([]); - - private loadingSubject = new BehaviorSubject(false); - - public loading$ = this.loadingSubject.asObservable(); - - public rowCount = 1; // hide footer during intial load - - private emptyInstances: XMXappInstance = - { ip: null, - name: null, - port: null, - status: null, - rxMessages: [], - txMessages: [], - }; - - constructor(private appMgrSvc: AppMgrService, - private sort: MatSort, - private notificationService: NotificationService) { - super(); - } - - loadTable() { - this.loadingSubject.next(true); - this.appMgrSvc.getDeployed() - .pipe( - catchError( (her: HttpErrorResponse) => { - console.log('AppControlDataSource failed: ' + her.message); - this.notificationService.error('Failed to get applications: ' + her.message); - return of([]); - }), - finalize(() => this.loadingSubject.next(false)) - ) - .subscribe( (xApps: XMDeployedApp[]) => { - this.rowCount = xApps.length; - const flattenedApps = this.flatten(xApps); - this.appControlSubject.next(flattenedApps); - }); - } - - connect(collectionViewer: CollectionViewer): Observable { - const dataMutations = [ - this.appControlSubject.asObservable(), - this.sort.sortChange - ]; - return merge(...dataMutations).pipe(map(() => { - return this.getSortedData([...this.appControlSubject.getValue()]); - })); - } - - disconnect(collectionViewer: CollectionViewer): void { - this.appControlSubject.complete(); - this.loadingSubject.complete(); - } - - private flatten(allxappdata: XMDeployedApp[]): XappControlRow[] { - const xAppInstances: XappControlRow[] = []; - for (const xapp of allxappdata) { - if (!xapp.instances) { - const row: XappControlRow = { - xapp: xapp.name, - instance: this.emptyInstances - }; - xAppInstances.push(row); - } else { - for (const ins of xapp.instances) { - const row: XappControlRow = { - xapp: xapp.name, - instance: ins - }; - xAppInstances.push(row); - } - } - } - return xAppInstances; - } - - private getSortedData(data: XappControlRow[]) { - if (!this.sort.active || this.sort.direction === '') { - return data; - } - - return data.sort((a, b) => { - const isAsc = this.sort.direction === 'asc'; - switch (this.sort.active) { - case 'xapp': return compare(a.xapp, b.xapp, isAsc); - case 'name': return compare(a.instance.name, b.instance.name, isAsc); - case 'status': return compare(a.instance.status, b.instance.status, isAsc); - case 'ip': return compare(a.instance.ip, b.instance.ip, isAsc); - case 'port': return compare(a.instance.port, b.instance.port, isAsc); - default: return 0; - } - }); - } -} - -function compare(a: any, b: any, isAsc: boolean) { - return (a < b ? -1 : 1) * (isAsc ? 1 : -1); -} diff --git a/dashboard/webapp-frontend/src/app/control/control.component.html b/dashboard/webapp-frontend/src/app/control/control.component.html deleted file mode 100644 index e3258b6e..00000000 --- a/dashboard/webapp-frontend/src/app/control/control.component.html +++ /dev/null @@ -1,24 +0,0 @@ - -
    - -
    - -
    diff --git a/dashboard/webapp-frontend/src/app/control/control.component.scss b/dashboard/webapp-frontend/src/app/control/control.component.scss deleted file mode 100644 index f06d0ced..00000000 --- a/dashboard/webapp-frontend/src/app/control/control.component.scss +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ -.control__section { - background-color: transparent; -} diff --git a/dashboard/webapp-frontend/src/app/control/control.component.spec.ts b/dashboard/webapp-frontend/src/app/control/control.component.spec.ts deleted file mode 100644 index eb7d064c..00000000 --- a/dashboard/webapp-frontend/src/app/control/control.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { ControlComponent } from './control.component'; - -describe('ControlComponent', () => { - let component: ControlComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ControlComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ControlComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/dashboard/webapp-frontend/src/app/control/control.component.ts b/dashboard/webapp-frontend/src/app/control/control.component.ts deleted file mode 100644 index 18545afe..00000000 --- a/dashboard/webapp-frontend/src/app/control/control.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'rd-control', - templateUrl: './control.component.html', - styleUrls: ['./control.component.scss'] -}) -export class ControlComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.html b/dashboard/webapp-frontend/src/app/footer/footer.component.html index 5dd1c364..29702097 100644 --- a/dashboard/webapp-frontend/src/app/footer/footer.component.html +++ b/dashboard/webapp-frontend/src/app/footer/footer.component.html @@ -3,6 +3,7 @@ O-RAN-SC %% Copyright (C) 2019 AT&T Intellectual Property + Modifications Copyright (C) 2019 Nordix Foundation %% Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,5 +21,7 @@ diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.ts b/dashboard/webapp-frontend/src/app/footer/footer.component.ts index e119d70d..66430ecb 100644 --- a/dashboard/webapp-frontend/src/app/footer/footer.component.ts +++ b/dashboard/webapp-frontend/src/app/footer/footer.component.ts @@ -3,6 +3,7 @@ * O-RAN-SC * %% * Copyright (C) 2019 AT&T Intellectual Property + * Modifications Copyright (C) 2019 Nordix Foundation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +41,8 @@ export class FooterComponent implements OnInit { public ui: UiService ) { } ngOnInit() { - this.dashboardService.getVersion().subscribe((res: DashboardSuccessTransport) => this.dashboardVersion = res.data); + this.dashboardVersion = '0.0'; + //this.dashboardService.getVersion().subscribe((res: DashboardSuccessTransport) => this.dashboardVersion = res.data); this.ui.darkModeState.subscribe((isDark) => { this.darkMode = isDark; }); diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.html b/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.html deleted file mode 100644 index 0642baab..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.html +++ /dev/null @@ -1,54 +0,0 @@ - - -
    - Setup RAN Connection -
    -
    -
    -
    - - - EN-DC - X2 - -
    - - - Example: ABCD123456 - Name is required - Valid name is required - - - - IP is required - Valid IP is required - - - - Port is required - Valid port number is required - -
    - -
    diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.scss b/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.scss deleted file mode 100644 index 484ceb91..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.scss +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ - - /* used to place form fields on separate lines/rows in dialog */ -.input-display-block { - display: block; -} - -/* leave a bit of space */ -.ran-type-radio-button { - margin-left: 5px; -} diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts b/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts deleted file mode 100644 index ad871216..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { HttpErrorResponse, HttpResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; -import { Observable } from 'rxjs'; -import { finalize } from 'rxjs/operators'; -import { E2SetupRequest, RanDialogFormData } from '../interfaces/e2-mgr.types'; -import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service'; -import { ErrorDialogService } from '../services/ui/error-dialog.service'; -import { LoadingDialogService } from '../services/ui/loading-dialog.service'; -import { NotificationService } from '../services/ui/notification.service'; - -@Component({ - selector: 'rd-ran-control-connect-dialog', - templateUrl: './ran-connection-dialog.component.html', - styleUrls: ['./ran-connection-dialog.component.scss'] -}) - -export class RanControlConnectDialogComponent implements OnInit { - - public ranDialogForm: FormGroup; - public processing = false; - - constructor( - private dialogRef: MatDialogRef, - private service: E2ManagerService, - private errorService: ErrorDialogService, - private loadingDialogService: LoadingDialogService, - private notifService: NotificationService) { - // opens with empty fields; accepts no data to display - } - - ngOnInit() { - const namePattern = /^([A-Z0-9])+$/; - // tslint:disable-next-line:max-line-length - const ipPattern = /((((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?$))/; - const portPattern = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/; - this.ranDialogForm = new FormGroup({ - ranType: new FormControl('endc'), - ranName: new FormControl('', [Validators.required, Validators.pattern(namePattern)]), - ranIp: new FormControl('', [Validators.required, Validators.pattern(ipPattern)]), - ranPort: new FormControl('', [Validators.required, Validators.pattern(portPattern)]) - }); - } - - onCancel() { - this.dialogRef.close(false); - } - - setupConnection = (ranFormValue: RanDialogFormData) => { - if (!this.ranDialogForm.valid) { - // should never happen - return; - } - this.processing = true; - const setupRequest: E2SetupRequest = { - ranName: ranFormValue.ranName.trim(), - ranIp: ranFormValue.ranIp.trim(), - ranPort: ranFormValue.ranPort.trim() - }; - this.loadingDialogService.startLoading('Setting up connection'); - let observable: Observable>; - if (ranFormValue.ranType === 'endc') { - observable = this.service.endcSetup(setupRequest); - } else { - observable = this.service.x2Setup(setupRequest); - } - observable - .pipe( - finalize(() => this.loadingDialogService.stopLoading()) - ) - .subscribe( - (response: any) => { - this.processing = false; - this.notifService.success('Connect request sent!'); - this.dialogRef.close(true); - }, - ((her: HttpErrorResponse) => { - this.processing = false; - // the error field carries the server's response - let msg = her.message; - if (her.error && her.error.message) { - msg = her.error.message; - } - this.errorService.displayError('Connect request failed: ' + msg); - // keep the dialog open - }) - ); - } - - hasError(controlName: string, errorName: string) { - if (this.ranDialogForm.controls[controlName].hasError(errorName)) { - return true; - } - return false; - } - - validateControl(controlName: string) { - if (this.ranDialogForm.controls[controlName].invalid && this.ranDialogForm.controls[controlName].touched) { - return true; - } - return false; - } - -} diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.html b/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.html deleted file mode 100644 index 01dd2929..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.html +++ /dev/null @@ -1,89 +0,0 @@ - - -
    -

    RAN Connections

    - - - - - - - - - - Nodeb ID - -
    {{ran.nodebIdentity.globalNbId.nbId}}
    -
    -
    - - - Node Type - -
    {{ran.nodebStatus.nodeType}}
    -
    -
    - - - RAN Name - -
    {{ran.nodebIdentity.inventoryName}}
    -
    -
    - - - IP - -
    {{ran.nodebStatus.ip}}
    -
    -
    - - - Port - -
    {{ran.nodebStatus.port}}
    -
    -
    - - - Connection Status - -
    {{ran.nodebStatus.connectionStatus}}
    -
    -
    - - - No records found. - - - - - - - -
    - -
    - -
    - -
    \ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.scss b/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.scss deleted file mode 100644 index c86d0629..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.scss +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ - .ran-control__section { -} - -.disconnect-all-button { - float: right; -} - -.ran-control-table { - width: 100%; - min-height: 100px; - margin-top: 10px; - background-color:transparent; -} - -.spinner-container { - height: 100px; - width: 100px; -} - -.spinner-container mat-spinner { - margin: 0 auto 0 auto; -} - -.version__text { - color: gray; - letter-spacing: 0.1rem; - font-size: 10px; -} - -.display-none { - display: none; -} diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.spec.ts b/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.spec.ts deleted file mode 100644 index aa0e8b82..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { RanControlComponent } from './ran-control.component'; - -describe('RanControlComponent', () => { - let component: RanControlComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ RanControlComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(RanControlComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.ts b/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.ts deleted file mode 100644 index b5aba669..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.ts +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { finalize } from 'rxjs/operators'; -import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service'; -import { ConfirmDialogService } from '../services/ui/confirm-dialog.service'; -import { ErrorDialogService } from '../services/ui/error-dialog.service'; -import { LoadingDialogService } from '../services/ui/loading-dialog.service'; -import { NotificationService } from '../services/ui/notification.service'; -import { RanControlConnectDialogComponent } from './ran-connection-dialog.component'; -import { RANControlDataSource } from './ran-control.datasource'; -import { UiService } from '../services/ui/ui.service'; - -@Component({ - selector: 'rd-ran-control', - templateUrl: './ran-control.component.html', - styleUrls: ['./ran-control.component.scss'] -}) -export class RanControlComponent implements OnInit { - - darkMode: boolean; - panelClass: string = ""; - displayedColumns: string[] = ['nbId', 'nodeType', 'ranName', 'ranIp', 'ranPort', 'connectionStatus']; - dataSource: RANControlDataSource; - - constructor(private e2MgrSvc: E2ManagerService, - private errorDialogService: ErrorDialogService, - private confirmDialogService: ConfirmDialogService, - private notificationService: NotificationService, - private loadingDialogService: LoadingDialogService, - public dialog: MatDialog, - public ui: UiService) { } - - ngOnInit() { - this.dataSource = new RANControlDataSource(this.e2MgrSvc, this.notificationService); - this.dataSource.loadTable(); - this.ui.darkModeState.subscribe((isDark) => { - this.darkMode = isDark; - }); - } - - setupRANConnection() { - if (this.darkMode) { - this.panelClass = "dark-theme"; - } else { - this.panelClass = ""; - } - const dialogRef = this.dialog.open(RanControlConnectDialogComponent, { - panelClass: this.panelClass, - width: '450px' - }); - dialogRef.afterClosed() - .subscribe((result: boolean) => { - if (result) { - this.dataSource.loadTable(); - } - }); - } - - disconnectAllRANConnections() { - const aboutError = 'Disconnect all RAN Connections Failed: '; - this.confirmDialogService.openConfirmDialog('Are you sure you want to disconnect all RAN connections?') - .afterClosed().subscribe( (res: boolean) => { - if (res) { - this.loadingDialogService.startLoading("Disconnecting"); - this.e2MgrSvc.nodebPut() - .pipe( - finalize(() => this.loadingDialogService.stopLoading()) - ) - .subscribe( - ( body: any ) => { - this.notificationService.success('Disconnect succeeded!'); - this.dataSource.loadTable(); - }, - (her: HttpErrorResponse) => { - // the error field should have an ErrorTransport object - let msg = her.message; - if (her.error && her.error.message) { - msg = her.error.message; - } - this.errorDialogService.displayError('Disconnect failed: ' + msg); - } - ); - } - }); - } - -} diff --git a/dashboard/webapp-frontend/src/app/ran-control/ran-control.datasource.ts b/dashboard/webapp-frontend/src/app/ran-control/ran-control.datasource.ts deleted file mode 100644 index b23a3cd2..00000000 --- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.datasource.ts +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { CollectionViewer, DataSource } from '@angular/cdk/collections'; -import { HttpErrorResponse } from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { of } from 'rxjs/observable/of'; -import { catchError, finalize } from 'rxjs/operators'; -import { E2RanDetails } from '../interfaces/e2-mgr.types'; -import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service'; -import { NotificationService } from '../services/ui/notification.service'; - -export class RANControlDataSource extends DataSource { - - private ranControlSubject = new BehaviorSubject([]); - - private loadingSubject = new BehaviorSubject(false); - - public loading$ = this.loadingSubject.asObservable(); - - public rowCount = 1; // hide footer during intial load - - constructor(private e2MgrSvcservice: E2ManagerService, - private notificationService: NotificationService) { - super(); - } - - loadTable() { - this.loadingSubject.next(true); - this.e2MgrSvcservice.getRan() - .pipe( - catchError( (her: HttpErrorResponse) => { - console.log('RANControlDataSource failed: ' + her.message); - this.notificationService.error('Failed to get RAN details: ' + her.message); - return of([]); - }), - finalize( () => this.loadingSubject.next(false) ) - ) - .subscribe( (ranControl: E2RanDetails[] ) => { - this.rowCount = ranControl.length; - this.ranControlSubject.next(ranControl); - }); - } - - connect(collectionViewer: CollectionViewer): Observable { - return this.ranControlSubject.asObservable(); - } - - disconnect(collectionViewer: CollectionViewer): void { - this.ranControlSubject.complete(); - this.loadingSubject.complete(); - } - -} diff --git a/dashboard/webapp-frontend/src/app/rd.module.ts b/dashboard/webapp-frontend/src/app/rd.module.ts index 378374ad..3ba8a408 100644 --- a/dashboard/webapp-frontend/src/app/rd.module.ts +++ b/dashboard/webapp-frontend/src/app/rd.module.ts @@ -35,15 +35,10 @@ import { ChartsModule } from 'ng2-charts'; import { MDBBootstrapModule } from 'angular-bootstrap-md'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ToastrModule } from 'ngx-toastr'; - -import { AddDashboardUserDialogComponent } from './user/add-dashboard-user-dialog/add-dashboard-user-dialog.component'; -import { AppControlComponent } from './app-control/app-control.component'; import { AppMgrService } from './services/app-mgr/app-mgr.service'; import { ConfirmDialogComponent } from './ui/confirm-dialog/confirm-dialog.component'; -import { ControlComponent } from './control/control.component'; import { DashboardService } from './services/dashboard/dashboard.service'; import { E2ManagerService } from './services/e2-mgr/e2-mgr.service'; -import { EditDashboardUserDialogComponent } from './user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component'; import { ErrorDialogComponent } from './ui/error-dialog/error-dialog.component'; import { ErrorDialogService } from './services/ui/error-dialog.service'; import { FlexLayoutModule } from '@angular/flex-layout'; @@ -56,21 +51,14 @@ import { PolicyCardComponent } from './ui/policy-card/policy-card.component'; import { PolicyControlComponent } from './policy-control/policy-control.component'; import { PolicyInstanceComponent } from './policy-control/policy-instance.component'; import { PolicyInstanceDialogComponent } from './policy-control/policy-instance-dialog.component'; -import { RanControlComponent } from './ran-control/ran-control.component'; -import { RanControlConnectDialogComponent } from './ran-control/ran-connection-dialog.component'; import { RdComponent } from './rd.component'; import { RdRoutingModule } from './rd-routing.module'; import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.component'; import { UiService } from './services/ui/ui.service'; -import { UserComponent } from './user/user.component'; @NgModule({ - declarations: [ - AddDashboardUserDialogComponent, - AppControlComponent, + declarations: [ ConfirmDialogComponent, - ControlComponent, - EditDashboardUserDialogComponent, ErrorDialogComponent, FooterComponent, LoadingDialogComponent, @@ -80,11 +68,8 @@ import { UserComponent } from './user/user.component'; PolicyControlComponent, PolicyInstanceComponent, PolicyInstanceDialogComponent, - RanControlComponent, - RanControlConnectDialogComponent, RdComponent, SidenavListComponent, - UserComponent ], imports: [ BrowserModule, @@ -140,17 +125,13 @@ import { UserComponent } from './user/user.component'; MatSidenavModule, MatSliderModule, MatSlideToggleModule, - MatTabsModule, - RanControlConnectDialogComponent + MatTabsModule ], - entryComponents: [ - AddDashboardUserDialogComponent, - ConfirmDialogComponent, - EditDashboardUserDialogComponent, + entryComponents: [ + ConfirmDialogComponent, ErrorDialogComponent, LoadingDialogComponent, - PolicyInstanceDialogComponent, - RanControlConnectDialogComponent + PolicyInstanceDialogComponent ], providers: [ AppMgrService, diff --git a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.html b/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.html deleted file mode 100644 index ef29a83a..00000000 --- a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.html +++ /dev/null @@ -1,44 +0,0 @@ - -
    - Add Dashboard User -
    - -
    -
    - - - - - - -
    -
    - - - Active - Inactive - -
    - -
    diff --git a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.scss b/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.scss deleted file mode 100644 index 97179625..00000000 --- a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.scss +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ - -.input-display-block { - display: block; -} \ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.ts b/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.ts deleted file mode 100644 index faca1050..00000000 --- a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.ts +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -import { Component, OnInit } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; -import { DashboardService } from '../../services/dashboard/dashboard.service'; -import { ErrorDialogService } from '../../services/ui/error-dialog.service'; - -@Component({ - selector: 'add-dashboard-user-dialog', - templateUrl: './add-dashboard-user-dialog.component.html', - styleUrls: ['./add-dashboard-user-dialog.component.scss'] -}) -export class AddDashboardUserDialogComponent implements OnInit { - - public addUserDialogForm: FormGroup; - - constructor( - private dialogRef: MatDialogRef, - private dashSvc: DashboardService, - private errorService: ErrorDialogService) { } - - ngOnInit() { - this.addUserDialogForm = new FormGroup({ - firstName: new FormControl('', [Validators.required]), - lastName: new FormControl('', [Validators.required]), - status: new FormControl('', [Validators.required]) - }); - } - - onCancel() { - this.dialogRef.close(false); - } - - public addUser = (FormValue) => { - if (this.addUserDialogForm.valid) { - // send the request to backend when it's ready - const aboutError = 'Not implemented yet'; - this.errorService.displayError(aboutError); - } - } - -} diff --git a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.html b/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.html deleted file mode 100644 index f64d9df1..00000000 --- a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.html +++ /dev/null @@ -1,44 +0,0 @@ - -
    - Edit Dashboard User -
    - -
    -
    - - - - - - -
    -
    - - - Active - Inactive - -
    - -
    diff --git a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.scss b/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.scss deleted file mode 100644 index 97179625..00000000 --- a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.scss +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ - -.input-display-block { - display: block; -} \ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts b/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts deleted file mode 100644 index aef88603..00000000 --- a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -import { Component, Inject, OnInit } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { DashboardService } from '../../services/dashboard/dashboard.service'; -import { ErrorDialogService } from '../../services/ui/error-dialog.service'; - - -@Component({ - selector: 'rd-edit-app-dashboard-user-dialog', - templateUrl: './edit-dashboard-user-dialog.component.html', - styleUrls: ['./edit-dashboard-user-dialog.component.scss'] -}) -export class EditDashboardUserDialogComponent implements OnInit { - - public editUserDialogForm: FormGroup; - - constructor( - @Inject(MAT_DIALOG_DATA) public data, - private dialogRef: MatDialogRef, - private dashSvc: DashboardService, - private errorService: ErrorDialogService) { } - - ngOnInit() { - this.editUserDialogForm = new FormGroup({ - firstName: new FormControl(this.data.firstName , [Validators.required]), - lastName: new FormControl(this.data.lastName, [Validators.required]), - status: new FormControl(this.data.status, [Validators.required]) - }); - } - - onCancel() { - this.dialogRef.close(false); - } - - public editUser = (FormValue) => { - if (this.editUserDialogForm.valid) { - // send the request to backend when it's ready - const aboutError = 'Not implemented yet'; - this.errorService.displayError(aboutError); - } - } - -} diff --git a/dashboard/webapp-frontend/src/app/user/user.component.html b/dashboard/webapp-frontend/src/app/user/user.component.html deleted file mode 100644 index 5bffc796..00000000 --- a/dashboard/webapp-frontend/src/app/user/user.component.html +++ /dev/null @@ -1,76 +0,0 @@ - -
    -

    Users

    - -
    - -
    - - - - Login ID - {{element.loginId}} - - - - First Name - {{element.firstName}} - - - - Last Name - {{element.lastName}} - - - - Active? - {{element.active}} - - - - Action - -
    - - -
    -
    -
    - - - No records found. - - - - - - -
    - -
    - -
    - -
    \ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/user/user.component.scss b/dashboard/webapp-frontend/src/app/user/user.component.scss deleted file mode 100644 index f3a5d893..00000000 --- a/dashboard/webapp-frontend/src/app/user/user.component.scss +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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=================================== - */ -.user__section { -} - -.spinner-container { - height: 360px; - width: 390px; - position: fixed; -} - -.spinner-container mat-spinner { - margin: 130px auto 0 auto; -} - -.user-table { - width: 99%; - min-height: 150px; - margin-top: 10px; - background-color: transparent; -} - -.user-button-row button { - margin-right: 5px; -} - -.display-none { - display: none; -} diff --git a/dashboard/webapp-frontend/src/app/user/user.component.spec.ts b/dashboard/webapp-frontend/src/app/user/user.component.spec.ts deleted file mode 100644 index d4d822e7..00000000 --- a/dashboard/webapp-frontend/src/app/user/user.component.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { UserComponent } from './user.component'; - -describe('UserComponent', () => { - let component: AdminComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [UserComponent] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(UserComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/dashboard/webapp-frontend/src/app/user/user.component.ts b/dashboard/webapp-frontend/src/app/user/user.component.ts deleted file mode 100644 index a3573c0f..00000000 --- a/dashboard/webapp-frontend/src/app/user/user.component.ts +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSort } from '@angular/material/sort'; -import { DashboardService } from '../services/dashboard/dashboard.service'; -import { ErrorDialogService } from '../services/ui/error-dialog.service'; -import { EcompUser } from './../interfaces/dashboard.types'; -import { NotificationService } from './../services/ui/notification.service'; -import { UserDataSource } from './user.datasource'; -import { AddDashboardUserDialogComponent } from './add-dashboard-user-dialog/add-dashboard-user-dialog.component'; -import { EditDashboardUserDialogComponent } from './edit-dashboard-user-dialog/edit-dashboard-user-dialog.component'; -import { UiService } from '../services/ui/ui.service'; - -@Component({ - selector: 'rd-user', - templateUrl: './user.component.html', - styleUrls: ['./user.component.scss'] -}) - -export class UserComponent implements OnInit { - - darkMode: boolean; - panelClass: string = ""; - displayedColumns: string[] = ['loginId', 'firstName', 'lastName', 'active', 'action']; - dataSource: UserDataSource; - @ViewChild(MatSort, {static: true}) sort: MatSort; - - constructor( - private dashboardSvc: DashboardService, - private errorService: ErrorDialogService, - private notificationService: NotificationService, - public dialog: MatDialog, - public ui: UiService) { } - - ngOnInit() { - this.dataSource = new UserDataSource(this.dashboardSvc, this.sort, this.notificationService); - this.dataSource.loadTable(); - this.ui.darkModeState.subscribe((isDark) => { - this.darkMode = isDark; - }); - } - - editUser(user: EcompUser) { - if (this.darkMode) { - this.panelClass = "dark-theme" - } else { - this.panelClass = ""; - } - const dialogRef = this.dialog.open(EditDashboardUserDialogComponent, { - panelClass: this.panelClass, - width: '450px', - data: user - }); - dialogRef.afterClosed().subscribe(result => { - this.dataSource.loadTable(); - }); - } - - deleteUser() { - const aboutError = 'Not implemented (yet).'; - this.errorService.displayError(aboutError); - } - - addUser() { - if (this.darkMode) { - this.panelClass = "dark-theme" - } else { - this.panelClass = ""; - } - const dialogRef = this.dialog.open(AddDashboardUserDialogComponent, { - panelClass: this.panelClass, - width: '450px' - }); - dialogRef.afterClosed().subscribe(result => { - this.dataSource.loadTable(); - }); - } -} - diff --git a/dashboard/webapp-frontend/src/app/user/user.datasource.ts b/dashboard/webapp-frontend/src/app/user/user.datasource.ts deleted file mode 100644 index 6b7805bc..00000000 --- a/dashboard/webapp-frontend/src/app/user/user.datasource.ts +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property - * %% - * 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 { CollectionViewer, DataSource } from '@angular/cdk/collections'; -import { HttpErrorResponse } from '@angular/common/http'; -import { MatSort } from '@angular/material/sort'; -import { Observable } from 'rxjs/Observable'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { merge } from 'rxjs'; -import { of } from 'rxjs/observable/of'; -import { catchError, finalize, map } from 'rxjs/operators'; -import { EcompUser } from '../interfaces/dashboard.types'; -import { DashboardService } from '../services/dashboard/dashboard.service'; -import { NotificationService } from '../services/ui/notification.service'; - -export class UserDataSource extends DataSource { - - private userSubject = new BehaviorSubject([]); - - private loadingSubject = new BehaviorSubject(false); - - public loading$ = this.loadingSubject.asObservable(); - - public rowCount = 1; // hide footer during intial load - - constructor(private dashboardSvc: DashboardService, - private sort: MatSort, - private notificationService: NotificationService) { - super(); - } - - loadTable() { - this.loadingSubject.next(true); - this.dashboardSvc.getUsers() - .pipe( - catchError( (her: HttpErrorResponse) => { - console.log('UserDataSource failed: ' + her.message); - this.notificationService.error('Failed to get users: ' + her.message); - return of([]); - }), - finalize(() => this.loadingSubject.next(false)) - ) - .subscribe( (users: EcompUser[]) => { - this.rowCount = users.length; - this.userSubject.next(users); - }); - } - - connect(collectionViewer: CollectionViewer): Observable { - const dataMutations = [ - this.userSubject.asObservable(), - this.sort.sortChange - ]; - return merge(...dataMutations).pipe(map(() => { - return this.getSortedData([...this.userSubject.getValue()]); - })); - } - - disconnect(collectionViewer: CollectionViewer): void { - this.userSubject.complete(); - this.loadingSubject.complete(); - } - - private getSortedData(data: EcompUser[]) { - if (!this.sort.active || this.sort.direction === '') { - return data; - } - - return data.sort((a: EcompUser, b: EcompUser) => { - const isAsc = this.sort.direction === 'asc'; - switch (this.sort.active) { - case 'loginId': return this.compare(a.loginId, b.loginId, isAsc); - case 'firstName': return this.compare(a.firstName, b.firstName, isAsc); - case 'lastName': return this.compare(a.lastName, b.lastName, isAsc); - case 'active': return this.compare(a.active, b.active, isAsc); - default: return 0; - } - }); - } - - private compare(a: any, b: any, isAsc: boolean) { - return (a < b ? -1 : 1) * (isAsc ? 1 : -1); - } - -} -- 2.16.6