From 7635a665c46bb7a487a3b582bb3e98c7f12e799e Mon Sep 17 00:00:00 2001 From: "Sarkar, Anand (as0481)" Date: Fri, 26 Apr 2019 15:32:40 -0400 Subject: [PATCH] RIC signal gNB eNB, BE get, post call Show new columns with result code etc. Change-Id: If7d9b7a10b3702954455fb4055369caa189a0fdc Issue-Id: RICPLT-954 Signed-off-by: Sarkar, Anand (as0481) Signed-off-by: Lott, Christopher (cl778h) --- docs/release-notes.rst | 5 +- webapp-frontend/.gitignore | 1 + webapp-frontend/package-lock.json | 6 +- webapp-frontend/package.json | 9 +- webapp-frontend/src/app/app-routing.module.ts | 2 + webapp-frontend/src/app/app.module.ts | 23 +++- .../sidenav-list/sidenav-list.component.html | 5 +- .../src/app/services/signal/signal.service.spec.ts | 31 +++++ .../src/app/services/signal/signal.service.ts | 42 +++++++ .../src/app/signal/signal.component.css | 45 +++++++ .../src/app/signal/signal.component.html | 26 ++++ .../signal/signal.component.ranconnect-dialog.html | 40 +++++++ .../src/app/signal/signal.component.spec.ts | 44 +++++++ webapp-frontend/src/app/signal/signal.component.ts | 131 +++++++++++++++++++++ 14 files changed, 398 insertions(+), 12 deletions(-) create mode 100644 webapp-frontend/src/app/services/signal/signal.service.spec.ts create mode 100644 webapp-frontend/src/app/services/signal/signal.service.ts create mode 100644 webapp-frontend/src/app/signal/signal.component.css create mode 100644 webapp-frontend/src/app/signal/signal.component.html create mode 100644 webapp-frontend/src/app/signal/signal.component.ranconnect-dialog.html create mode 100644 webapp-frontend/src/app/signal/signal.component.spec.ts create mode 100644 webapp-frontend/src/app/signal/signal.component.ts diff --git a/docs/release-notes.rst b/docs/release-notes.rst index a56d8165..c4960108 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -20,11 +20,12 @@ RIC Dashboard Release Notes =========================== -Version 1.0.2, 9 May 2019 -------------------------- +Version 1.0.2, 10 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 Version 1.0.1, 6 May 2019 ------------------------- diff --git a/webapp-frontend/.gitignore b/webapp-frontend/.gitignore index a473c816..4cfece3d 100644 --- a/webapp-frontend/.gitignore +++ b/webapp-frontend/.gitignore @@ -15,6 +15,7 @@ /.settings /target/ /.mvn/wrapper/maven-wrapper.jar +/.vscode ### STS ### .apt_generated diff --git a/webapp-frontend/package-lock.json b/webapp-frontend/package-lock.json index 82dfbedb..add9d36a 100644 --- a/webapp-frontend/package-lock.json +++ b/webapp-frontend/package-lock.json @@ -8357,9 +8357,9 @@ } }, "rxjs-compat": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.4.0.tgz", - "integrity": "sha512-eo/O8RS83hJdJukCtA+IF6qnqa8FPOuVo+OPCzgVi+dbTle9KCdNv97IcQO0WwNVik7DJLKmf0F8uwzc0q40vw==" + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.3.3.tgz", + "integrity": "sha512-caGN7ixiabHpOofginKEquuHk7GgaCrC7UpUQ9ZqGp80tMc68msadOeP/2AKy2R4YJsT1+TX5GZCtxO82qWkyA==" }, "safe-buffer": { "version": "5.1.2", diff --git a/webapp-frontend/package.json b/webapp-frontend/package.json index 3cf535d1..9b4810e6 100644 --- a/webapp-frontend/package.json +++ b/webapp-frontend/package.json @@ -32,8 +32,8 @@ "ng2-charts": "^1.6.0", "ng2-completer": "^2.0.8", "ng2-smart-table": "1.3.5", - "rxjs": "~6.3.3", - "rxjs-compat": "^6.4.0", + "rxjs": "6.3.3", + "rxjs-compat": "6.3.3", "tslib": "^1.9.0", "zone.js": "~0.8.26" }, @@ -57,5 +57,10 @@ "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.2.2" + }, + "comments": { + "dependencies": { + "rxjs": "Its version needs to be same with rxjs-compat, otherwise apparently build is failing" + } } } diff --git a/webapp-frontend/src/app/app-routing.module.ts b/webapp-frontend/src/app/app-routing.module.ts index 52d75586..3620c0e5 100644 --- a/webapp-frontend/src/app/app-routing.module.ts +++ b/webapp-frontend/src/app/app-routing.module.ts @@ -23,6 +23,7 @@ import { Routes, RouterModule } from '@angular/router'; import { LoginComponent } from './login/login.component'; import { CatalogComponent } from './catalog/catalog.component'; import { ControlComponent } from './control/control.component'; +import { SignalComponent } from './signal/signal.component'; import { StatsComponent } from './stats/stats.component'; import { AdminComponent } from './admin/admin.component'; import { XappComponent } from './xapp/xapp.component'; @@ -32,6 +33,7 @@ const routes: Routes = [ {path: 'login', component: LoginComponent}, {path: 'catalog', component: CatalogComponent}, {path: 'control', component: ControlComponent}, + {path: 'signal', component: SignalComponent}, {path: 'stats', component: StatsComponent}, {path: 'admin', component: AdminComponent}, {path: 'xapp', component: XappComponent}, diff --git a/webapp-frontend/src/app/app.module.ts b/webapp-frontend/src/app/app.module.ts index 4a84c854..19d68560 100644 --- a/webapp-frontend/src/app/app.module.ts +++ b/webapp-frontend/src/app/app.module.ts @@ -21,7 +21,7 @@ import { BrowserModule } from '@angular/platform-browser'; // tslint:disable-next-line:max-line-length import { MatIconModule, MatCardModule, MatListModule, MatSidenavModule, MatButtonToggleModule, MatSliderModule, MatGridListModule, MatSlideToggleModule, - MatExpansionModule, MatTabsModule } from '@angular/material'; + MatExpansionModule, MatTabsModule, MatDialogModule, MatFormFieldModule, MatButtonModule, MatInputModule} from '@angular/material'; import { BrowserAnimationsModule} from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { Ng2SmartTableModule } from 'ng2-smart-table'; @@ -37,8 +37,10 @@ import { UiService} from './services/ui/ui.service'; import { AdminService} from './services/admin/admin.service'; import { CatalogService} from './services/catalog/catalog.service'; import { ControlService} from './services/control/control.service'; +import { SignalService} from './services/signal/signal.service'; import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.component'; import { ControlComponent } from './control/control.component'; +import { SignalComponent, AppRANConnectDialog} from './signal/signal.component'; import { StatsComponent } from './stats/stats.component'; import { AdminComponent } from './admin/admin.component'; import { CatalogCardComponent} from './ui/catalog-card/catalog-card.component'; @@ -47,7 +49,7 @@ import { StatCardComponent} from './ui/stat-card/stat-card.component'; import { ModalEventComponent } from './ui/modal-event/modal-event.component'; import { XappComponent } from './xapp/xapp.component'; import { ConfigEventComponent } from './ui/config-event/config-event.component'; -import { MatDialogModule } from '@angular/material'; + @NgModule({ declarations: [ @@ -59,12 +61,14 @@ import { MatDialogModule } from '@angular/material'; ControlCardComponent, StatCardComponent, ControlComponent, + SignalComponent, StatsComponent, AdminComponent, ModalEventComponent, XappComponent, ConfigEventComponent, AppCatalogDeployDialog, + AppRANConnectDialog ], imports: [ BrowserModule, @@ -72,6 +76,7 @@ import { MatDialogModule } from '@angular/material'; ChartsModule, AppRoutingModule, FormsModule, + MatDialogModule, ReactiveFormsModule, MatButtonToggleModule, MatExpansionModule, @@ -83,11 +88,15 @@ import { MatDialogModule } from '@angular/material'; MatSidenavModule, MatSlideToggleModule, MatTabsModule, + MatFormFieldModule, + MatButtonModule, + MatInputModule, Ng2SmartTableModule, MDBBootstrapModule.forRoot(), ], exports: [ - MatDialogModule, + FormsModule, + MatDialogModule, MatButtonToggleModule, MatExpansionModule, MatSliderModule, @@ -98,16 +107,22 @@ import { MatDialogModule } from '@angular/material'; MatSidenavModule, MatSlideToggleModule, MatTabsModule, + MatFormFieldModule, + MatButtonModule, + MatInputModule ], entryComponents: [ AppCatalogDeployDialog, + AppRANConnectDialog ], providers: [ UiService, AdminService, CatalogService, ControlService, + SignalService ], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule { }; + diff --git a/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.html b/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.html index 68f95ae8..c6a8c6c0 100644 --- a/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.html +++ b/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.html @@ -30,7 +30,10 @@ assessment Stats + + cast_connected RAN Connection + - assignment_ind Admin + assignment_ind Admin diff --git a/webapp-frontend/src/app/services/signal/signal.service.spec.ts b/webapp-frontend/src/app/services/signal/signal.service.spec.ts new file mode 100644 index 00000000..d454ff32 --- /dev/null +++ b/webapp-frontend/src/app/services/signal/signal.service.spec.ts @@ -0,0 +1,31 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ +import { TestBed } from '@angular/core/testing'; + +import { SignalService } from './signal.service'; + +describe('CatalogService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: SignalService = TestBed.get(SignalService); + expect(service).toBeTruthy(); + }); +}); diff --git a/webapp-frontend/src/app/services/signal/signal.service.ts b/webapp-frontend/src/app/services/signal/signal.service.ts new file mode 100644 index 00000000..4b1024a0 --- /dev/null +++ b/webapp-frontend/src/app/services/signal/signal.service.ts @@ -0,0 +1,42 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +@Injectable() +export class SignalService { + + constructor(private http: HttpClient) { + } + + getAll() { + return this.http.get('api/e2mgr/setup'); + } + + x2Setup(req) { + return this.http.post('api/e2mgr/x2Setup', req); + } + + endcSetup(req) { + return this.http.post('api/e2mgr/endcSetup', req); + } + +} diff --git a/webapp-frontend/src/app/signal/signal.component.css b/webapp-frontend/src/app/signal/signal.component.css new file mode 100644 index 00000000..c30bb3ca --- /dev/null +++ b/webapp-frontend/src/app/signal/signal.component.css @@ -0,0 +1,45 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * 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 { + position: relative; + top: -50px; +} + +.control__header { + text-align: center; + color: #432c85; + font-size: 50px; + font-weight: 200; + letter-spacing: .1em; + transform: translate(149 56); +} + +:host /deep/ ng2-smart-table tbody > tr > td{ + text-align: left; +} + +:host /deep/ ng2-smart-table thead th{ + text-align: left; +} + +/* used to place form fields on separate lines/rows in dialog */ +.input-display-block { + display: block; +} diff --git a/webapp-frontend/src/app/signal/signal.component.html b/webapp-frontend/src/app/signal/signal.component.html new file mode 100644 index 00000000..9b9fa167 --- /dev/null +++ b/webapp-frontend/src/app/signal/signal.component.html @@ -0,0 +1,26 @@ + +
+

RAN Connection

+ + + + +
diff --git a/webapp-frontend/src/app/signal/signal.component.ranconnect-dialog.html b/webapp-frontend/src/app/signal/signal.component.ranconnect-dialog.html new file mode 100644 index 00000000..715943c3 --- /dev/null +++ b/webapp-frontend/src/app/signal/signal.component.ranconnect-dialog.html @@ -0,0 +1,40 @@ + + +
+ Setup RAN Connection +
+ +
+ + + + + + + + + +
+ + diff --git a/webapp-frontend/src/app/signal/signal.component.spec.ts b/webapp-frontend/src/app/signal/signal.component.spec.ts new file mode 100644 index 00000000..a0d29141 --- /dev/null +++ b/webapp-frontend/src/app/signal/signal.component.spec.ts @@ -0,0 +1,44 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * 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 { SignalComponent } from './signal.component'; + +describe('SignalComponent', () => { + let component: SignalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SignalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SignalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webapp-frontend/src/app/signal/signal.component.ts b/webapp-frontend/src/app/signal/signal.component.ts new file mode 100644 index 00000000..a3ad5a24 --- /dev/null +++ b/webapp-frontend/src/app/signal/signal.component.ts @@ -0,0 +1,131 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * 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, Inject } from '@angular/core'; +import { LocalDataSource } from 'ng2-smart-table'; +import { SignalService } from '../services/signal/signal.service'; +import { Router } from '@angular/router'; +import { MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; +import {MatFormFieldModule} from '@angular/material'; +import { FormGroup, FormControl, FormBuilder } from '@angular/forms'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs/Rx'; + +export interface DialogData { + ranName: string; + ranIp: number; + ranPort: number; +} + +@Component({ + selector: 'app-signal', + templateUrl: 'signal.component.html', + styleUrls: ['signal.component.css'] +}) +export class SignalComponent { + + settings = { + hideSubHeader: true, + actions: { + columnTitle: 'Actions', + add: false, + edit: false, + delete: false, + position: 'right' + }, + columns: { + requestType: { + title: 'Request Type', + type: 'string', + }, + ranName: { + title: 'eNodeB/gNodeB Name', + type: 'string', + }, + ranIp: { + title: 'IP', + type: 'number', + }, + ranPort: { + title: 'Port', + type: 'number', + }, + responseCode: { + title: 'Response', + type: 'number', + }, + timeStamp: { + title: 'Time Stamp', + type: 'string', + } + } + }; + + source: LocalDataSource = new LocalDataSource(); + + ranName: string; + + ranIp: number; + + ranPort: number; + + constructor(private service: SignalService, public dialog: MatDialog, private http: HttpClient) { + this.service.getAll().subscribe((val: any[]) => this.source.load(val)); + } + + openRanConnectDialog() { + + const dialogRef = this.dialog.open(AppRANConnectDialog, { + width: '450px', + data: {ranName: this.ranName, ranIp: this.ranIp, ranPort: this.ranPort} + }) + + dialogRef.afterClosed().subscribe(result => { + this.service.getAll().subscribe((val: any[]) => this.source.load(val)); + }); + + } +} + +@Component({ + selector: 'app-signal-ranconnect-dialog', + templateUrl: 'signal.component.ranconnect-dialog.html', + styleUrls: ['signal.component.css'] +}) + +export class AppRANConnectDialog implements OnInit { + + constructor(public dialogRef: MatDialogRef, + private service: SignalService, + @Inject(MAT_DIALOG_DATA) public data: DialogData) { + } + + ngOnInit() { + } + + close() { + this.dialogRef.close(); + } + + connectRAN(): void { + this.service.x2Setup(this.data).subscribe((val: any[]) => {}); + this.dialogRef.close(); + } + +} -- 2.16.6