2 * ========================LICENSE_START=================================
5 * Copyright (C) 2019 AT&T Intellectual Property and Nokia
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================LICENSE_END===================================
20 import { Component, OnInit, Inject } from '@angular/core';
21 import { LocalDataSource } from 'ng2-smart-table';
22 import { SignalService } from '../services/signal/signal.service';
23 import { Router } from '@angular/router';
24 import { MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
25 import {MatFormFieldModule} from '@angular/material';
26 import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
27 import { HttpClient } from '@angular/common/http';
28 import { Observable } from 'rxjs/Rx';
30 export interface DialogData {
37 selector: 'app-signal',
38 templateUrl: 'signal.component.html',
39 styleUrls: ['signal.component.css']
41 export class SignalComponent {
46 columnTitle: 'Actions',
54 title: 'Request Type',
58 title: 'eNodeB/gNodeB Name',
80 source: LocalDataSource = new LocalDataSource();
88 constructor(private service: SignalService, public dialog: MatDialog, private http: HttpClient) {
89 this.service.getAll().subscribe((val: any[]) => this.source.load(val));
92 openRanConnectDialog() {
94 const dialogRef = this.dialog.open(AppRANConnectDialog, {
96 data: {ranName: this.ranName, ranIp: this.ranIp, ranPort: this.ranPort}
99 dialogRef.afterClosed().subscribe(result => {
100 this.service.getAll().subscribe((val: any[]) => this.source.load(val));
107 selector: 'app-signal-ranconnect-dialog',
108 templateUrl: 'signal.component.ranconnect-dialog.html',
109 styleUrls: ['signal.component.css']
112 export class AppRANConnectDialog implements OnInit {
114 constructor(public dialogRef: MatDialogRef<AppRANConnectDialog>,
115 private service: SignalService,
116 @Inject(MAT_DIALOG_DATA) public data: DialogData) {
123 this.dialogRef.close();
127 this.service.x2Setup(this.data).subscribe((val: any[]) => {});
128 this.dialogRef.close();