Non-RT RIC Dashboard
Removed unused code.
Added Nordix to some copyright texts.
Change-Id: I5bb26466418d826bd4005689915c64ddd8630674
Issue-ID: NONRTRIC-61
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
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 c00f877..0000000
--- 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 ec802f4..0000000
--- a/dashboard/webapp-frontend/src/app/app-control/app-control.component.html
+++ /dev/null
@@ -1,100 +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===================================
- -->
-
-<div class="app-control__section">
- <h3 class="rd-global-page-title">xApp Control</h3>
-
- <table mat-table [dataSource]="dataSource" matSort multiTemplateDataRows class="app-control-table mat-elevation-z8">
-
- <ng-container matColumnDef="xapp">
- <mat-header-cell *matHeaderCellDef mat-sort-header> App Name </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.xapp}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="name">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Instance Name</mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.instance.name}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="status">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Status </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.instance.status}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="ip" >
- <mat-header-cell *matHeaderCellDef mat-sort-header> IP </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.instance.ip}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="port">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Port </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.instance.port}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="action">
- <mat-header-cell *matHeaderCellDef> Action </mat-header-cell>
- <!-- click on button should not expand/collapse the row -->
- <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
- <button mat-icon-button (click)="controlApp(element)">
- <mat-icon matTooltip="Adjust settings">settings</mat-icon>
- </button>
- <button mat-icon-button (click)="onUndeployApp(element)">
- <mat-icon matTooltip="Undeploy app">cloud_download</mat-icon>
- </button>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="expandedDetail">
- <td mat-cell *matCellDef="let element" [attr.colspan]="displayedColumns.length">
- <div [@messageExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
- <div>
- txMessages:
- </div>
- <li *ngFor="let rxmessage of element.instance.rxMessages">
- <span>{{rxmessage}}</span>
- </li>
- <div>
- rxMessages:
- </div>
- <li *ngFor="let txmessage of element.instance.txMessages">
- <span>{{txmessage}}</span>
- </li>
- </div>
- </td>
- </ng-container>
-
- <ng-container matColumnDef="noRecordsFound">
- <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
- </ng-container>
-
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
- <mat-row *matRowDef="let element; columns: displayedColumns;"
- [class.example-expanded-row]="expandedElement === element"
- (click)="expandedElement = expandedElement === element ? null : element"></mat-row>
- <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="message-row"></tr>
- <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': dataSource.rowCount > 0}"></mat-footer-row>
-
- </table>
-
- <div class="spinner-container" *ngIf="dataSource.loading$ | async">
- <mat-spinner diameter=50></mat-spinner>
- </div>
-
-</div>
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 232562f..0000000
--- 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 6648d81..0000000
--- 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<AppControlComponent>;
-
- 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 07b931d..0000000
--- 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<Object>) => {
- // 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 e97dc63..0000000
--- 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<XappControlRow> {
-
- private appControlSubject = new BehaviorSubject<XappControlRow[]>([]);
-
- private loadingSubject = new BehaviorSubject<boolean>(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<XappControlRow[]> {
- 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 e3258b6..0000000
--- a/dashboard/webapp-frontend/src/app/control/control.component.html
+++ /dev/null
@@ -1,24 +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===================================
- -->
-<div class="control__section">
- <rd-ran-control></rd-ran-control>
- <hr>
- <rd-app-control></rd-app-control>
-</div>
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 f06d0ce..0000000
--- 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 eb7d064..0000000
--- 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<ControlComponent>;
-
- 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 18545af..0000000
--- 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 5dd1c36..2970209 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 @@
<div class="copyright__text" [ngClass]="{'footer-dark': darkMode}">
Copyright (C) 2019 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0.
<br/>
+ Modifications Copyright (C) 2019 Nordix Foundation
+ <br/>
Version {{dashboardVersion}}
</div>
diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.ts b/dashboard/webapp-frontend/src/app/footer/footer.component.ts
index e119d70..66430ec 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 @@
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 0642baa..0000000
--- a/dashboard/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.html
+++ /dev/null
@@ -1,54 +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===================================
- -->
-
-<div mat-dialog-title>
- Setup RAN Connection
-</div>
-<form [formGroup]="ranDialogForm" novalidate autocomplete="off" (ngSubmit)="setupConnection(ranDialogForm.value)">
- <div mat-dialog-content>
- <div name="rantype">
- <label id="request-type-radio-group-label">RAN type:</label>
- <mat-radio-group aria-label="RAN Type" formControlName="ranType">
- <mat-radio-button class="ran-type-radio-button" value="endc">EN-DC</mat-radio-button>
- <mat-radio-button class="ran-type-radio-button" value="x2">X2</mat-radio-button>
- </mat-radio-group>
- </div>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="RAN Name" formControlName="ranName">
- <mat-hint align="end">Example: ABCD123456</mat-hint>
- <mat-error *ngIf="validateControl('ranName') && hasError('ranName', 'required')">Name is required</mat-error>
- <mat-error *ngIf="hasError('ranName', 'length')">Valid name is required</mat-error>
- </mat-form-field>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="IP" formControlName="ranIp">
- <mat-error *ngIf="validateControl('ranIp') && hasError('ranIp', 'required')">IP is required</mat-error>
- <mat-error *ngIf="hasError('ranIp', 'pattern')">Valid IP is required</mat-error>
- </mat-form-field>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="Port" formControlName="ranPort">
- <mat-error *ngIf="validateControl('ranPort') && hasError('ranPort', 'required')">Port is required</mat-error>
- <mat-error *ngIf="hasError('ranPort', 'pattern')">Valid port number is required</mat-error>
- </mat-form-field>
- </div>
- <div mat-dialog-actions class="modal-footer justify-content-center">
- <button class="mat-raised-button" (click)="onCancel()">Cancel</button>
- <button class="mat-raised-button mat-primary" [disabled]="!ranDialogForm.valid || processing">Connect</button>
- </div>
-</form>
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 484ceb9..0000000
--- 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 ad87121..0000000
--- 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<RanControlConnectDialogComponent>,
- 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<HttpResponse<Object>>;
- 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 01dd292..0000000
--- a/dashboard/webapp-frontend/src/app/ran-control/ran-control.component.html
+++ /dev/null
@@ -1,89 +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===================================
--->
-
-<div class="ran-control__section">
- <h3 class="rd-global-page-title">RAN Connections</h3>
-
- <button mat-raised-button (click)="setupRANConnection()">Setup Connection..</button>
- <button mat-raised-button color="warn" class="disconnect-all-button"
- (click)="disconnectAllRANConnections()">Disconnect All</button>
-
- <table mat-table class="ran-control-table mat-elevation-z8" [dataSource]="dataSource">
-
- <ng-template #noValue></ng-template>
-
- <ng-container matColumnDef="nbId">
- <mat-header-cell *matHeaderCellDef>Nodeb ID</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebIdentity.globalNbId; else noValue">{{ran.nodebIdentity.globalNbId.nbId}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="nodeType">
- <mat-header-cell *matHeaderCellDef>Node Type</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebStatus; else noValue">{{ran.nodebStatus.nodeType}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="ranName">
- <mat-header-cell *matHeaderCellDef>RAN Name</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebIdentity; else noValue">{{ran.nodebIdentity.inventoryName}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="ranIp">
- <mat-header-cell *matHeaderCellDef>IP</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebStatus; else noValue">{{ran.nodebStatus.ip}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="ranPort">
- <mat-header-cell *matHeaderCellDef>Port</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebStatus; else noValue">{{ran.nodebStatus.port}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="connectionStatus">
- <mat-header-cell *matHeaderCellDef>Connection Status</mat-header-cell>
- <mat-cell *matCellDef="let ran">
- <div *ngIf="ran.nodebStatus; else noValue">{{ran.nodebStatus.connectionStatus}}</div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="noRecordsFound">
- <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
- </ng-container>
-
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
- <mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
- <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': dataSource.rowCount > 0}">
- </mat-footer-row>
-
- </table>
-
- <div class="spinner-container" *ngIf="dataSource.loading$ | async">
- <mat-spinner diameter=50></mat-spinner>
- </div>
-
-</div>
\ 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 c86d062..0000000
--- 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 aa0e8b8..0000000
--- 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<RanControlComponent>;
-
- 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 b5aba66..0000000
--- 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 b23a3cd..0000000
--- 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<E2RanDetails> {
-
- private ranControlSubject = new BehaviorSubject<E2RanDetails[]>([]);
-
- private loadingSubject = new BehaviorSubject<boolean>(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<E2RanDetails[]> {
- 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 378374a..3ba8a40 100644
--- a/dashboard/webapp-frontend/src/app/rd.module.ts
+++ b/dashboard/webapp-frontend/src/app/rd.module.ts
@@ -35,15 +35,10 @@
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 { 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 @@
PolicyControlComponent,
PolicyInstanceComponent,
PolicyInstanceDialogComponent,
- RanControlComponent,
- RanControlConnectDialogComponent,
RdComponent,
SidenavListComponent,
- UserComponent
],
imports: [
BrowserModule,
@@ -140,17 +125,13 @@
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 ef29a83..0000000
--- a/dashboard/webapp-frontend/src/app/user/add-dashboard-user-dialog/add-dashboard-user-dialog.component.html
+++ /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===================================
--->
-<div mat-dialog-title>
- Add Dashboard User
-</div>
-
-<form [formGroup]="addUserDialogForm" novalidate autocomplete="off">
- <div mat-dialog-content>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="First Name" formControlName="firstName">
- </mat-form-field>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="Last Name" formControlName="lastName">
- </mat-form-field>
- </div>
- <div name="status">
- <label id="request-type-radio-group-label">Status:</label>
- <mat-radio-group aria-label="status" formControlName="status">
- <mat-radio-button value="Active">Active</mat-radio-button>
- <mat-radio-button value="Inactive">Inactive</mat-radio-button>
- </mat-radio-group>
- </div>
- <div mat-dialog-actions class="modal-footer justify-content-center">
- <button class="mat-raised-button" (click)="onCancel()">Cancel</button>
- <button class="mat-raised-button mat-primary" [disabled]="!addUserDialogForm.valid" (click)="addUser(addUserDialogForm.value)" >Add</button>
- </div>
-</form>
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 9717962..0000000
--- 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 faca105..0000000
--- 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<AddDashboardUserDialogComponent>,
- 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 f64d9df..0000000
--- a/dashboard/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.html
+++ /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===================================
--->
-<div mat-dialog-title>
- Edit Dashboard User
-</div>
-
-<form [formGroup]="editUserDialogForm" novalidate autocomplete="off">
- <div mat-dialog-content>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="First Name" formControlName="firstName" >
- </mat-form-field>
- <mat-form-field class="input-display-block">
- <input matInput type="text" placeholder="Last Name" formControlName="lastName" >
- </mat-form-field>
- </div>
- <div name="status">
- <label id="request-type-radio-group-label">Status:</label>
- <mat-radio-group aria-label="status" formControlName="status">
- <mat-radio-button value="Active">Active</mat-radio-button>
- <mat-radio-button value="Inactive">Inactive</mat-radio-button>
- </mat-radio-group>
- </div>
- <div mat-dialog-actions class="modal-footer justify-content-center">
- <button class="mat-raised-button" (click)="onCancel()">Cancel</button>
- <button class="mat-raised-button mat-primary" [disabled]="!editUserDialogForm.valid" (click)="editUser(editUserDialogForm.value)">Update</button>
- </div>
-</form>
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 9717962..0000000
--- 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 aef8860..0000000
--- 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<EditDashboardUserDialogComponent>,
- 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 5bffc79..0000000
--- a/dashboard/webapp-frontend/src/app/user/user.component.html
+++ /dev/null
@@ -1,76 +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===================================
--->
-<div class="user__section">
- <h3 class="rd-global-page-title">Users</h3>
- <button mat-raised-button (click)="addUser()">Add User</button>
- <div class="spinner-container" *ngIf="dataSource.loading$ | async">
- <mat-spinner></mat-spinner>
- </div>
- <table mat-table [dataSource]="dataSource" matSort class="user-table mat-elevation-z8">
-
- <ng-container matColumnDef="loginId">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Login ID </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.loginId}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="firstName">
- <mat-header-cell *matHeaderCellDef mat-sort-header> First Name </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.firstName}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="lastName">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Last Name </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.lastName}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="active">
- <mat-header-cell *matHeaderCellDef mat-sort-header> Active? </mat-header-cell>
- <mat-cell *matCellDef="let element"> {{element.active}} </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="action">
- <mat-header-cell *matHeaderCellDef> Action </mat-header-cell>
- <mat-cell *matCellDef="let element">
- <div class="user-button-row">
- <button mat-icon-button (click)="editUser(element)">
- <mat-icon matTooltip="Edit properties">edit</mat-icon>
- </button>
- <button mat-icon-button color="warn" (click)="deleteUser(element)">
- <mat-icon matTooltip="Delete user">delete</mat-icon>
- </button>
- </div>
- </mat-cell>
- </ng-container>
-
- <ng-container matColumnDef="noRecordsFound">
- <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
- </ng-container>
-
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
- <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
- <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': dataSource.rowCount > 0}"></mat-footer-row>
-
- </table>
-
- <div class="spinner-container" *ngIf="dataSource.loading$ | async">
- <mat-spinner diameter=50></mat-spinner>
- </div>
-
-</div>
\ 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 f3a5d89..0000000
--- 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 d4d822e..0000000
--- 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<UserComponent>;
-
- 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..0000000
--- 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 6b7805b..0000000
--- 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<EcompUser> {
-
- private userSubject = new BehaviorSubject<EcompUser[]>([]);
-
- private loadingSubject = new BehaviorSubject<boolean>(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<EcompUser[]> {
- 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);
- }
-
-}