cb41f1992f787f1d048a8fc1f13c35df7efe415b
[portal/ric-dashboard.git] / webapp-frontend / src / app / control / control.component.html
1 <!--
2   ========================LICENSE_START=================================
3   O-RAN-SC
4   %%
5   Copyright (C) 2019 AT&T Intellectual Property and Nokia
6   %%
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
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
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===================================
19   -->
20 <div class="control__section">
21   <h3 class="control__header">xApp Control</h3>
22   <div class="spinner-container" *ngIf="dataSource.loading$ | async">
23     <mat-spinner></mat-spinner>
24   </div>
25   <table mat-table [dataSource]="dataSource" matSort multiTemplateDataRows class="control-table mat-elevation-z8">
26
27     <ng-container matColumnDef="xapp">
28       <mat-header-cell *matHeaderCellDef mat-sort-header> App Name </mat-header-cell>
29       <mat-cell *matCellDef="let element"> {{element.xapp}} </mat-cell>
30     </ng-container>
31
32     <ng-container matColumnDef="name">
33       <mat-header-cell *matHeaderCellDef mat-sort-header> Instance Name</mat-header-cell>
34       <mat-cell *matCellDef="let element"> {{element.instance.name}} </mat-cell>
35     </ng-container>
36
37     <ng-container matColumnDef="status">
38       <mat-header-cell *matHeaderCellDef mat-sort-header> Status </mat-header-cell>
39       <mat-cell *matCellDef="let element"> {{element.instance.status}} </mat-cell>
40     </ng-container>
41
42     <ng-container matColumnDef="ip" >
43       <mat-header-cell *matHeaderCellDef mat-sort-header> IP </mat-header-cell>
44       <mat-cell *matCellDef="let element"> {{element.instance.ip}} </mat-cell>
45     </ng-container>
46
47     <ng-container matColumnDef="port">
48       <mat-header-cell *matHeaderCellDef mat-sort-header> Port </mat-header-cell>
49       <mat-cell *matCellDef="let element"> {{element.instance.port}} </mat-cell>
50     </ng-container>
51
52     <ng-container matColumnDef="action">
53       <mat-header-cell *matHeaderCellDef> Action </mat-header-cell>
54       <!-- click on button should not expand/collapse the row -->
55       <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
56         <button mat-icon-button (click)="controlApp(element)">
57           <mat-icon>settings</mat-icon>
58         </button>
59         <button mat-icon-button color="warn" (click)="undeployApp(element)">
60           <mat-icon>delete</mat-icon>
61         </button>
62       </mat-cell>
63     </ng-container>
64
65     <ng-container matColumnDef="expandedDetail">
66       <td mat-cell *matCellDef="let element" [attr.colspan]="displayedColumns.length">
67         <div [@messageExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
68           <div>
69             txMessages:
70           </div>
71           <li *ngFor="let rxmessage of element.instance.rxMessages">
72             <span>{{rxmessage}}</span>
73           </li>
74           <div>
75             rxMessages:
76           </div>
77           <li *ngFor="let txmessage of element.instance.txMessages">
78             <span>{{txmessage}}</span>
79           </li>
80         </div>
81       </td>
82     </ng-container>
83
84     <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
85     <mat-row *matRowDef="let element; columns: displayedColumns;"
86       [class.example-expanded-row]="expandedElement === element"
87       (click)="expandedElement = expandedElement === element ? null : element"></mat-row>
88     <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="message-row"></tr>
89   </table>
90 </div>