Add multi-layer RIC instance selector
[portal/ric-dashboard.git] / dashboard / webapp-frontend / src / app / app-control / app-control.component.html
1 <!--
2   ========================LICENSE_START=================================
3   O-RAN-SC
4   %%
5   Copyright (C) 2019 AT&T Intellectual Property
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
21 <div class="app-control__section">
22   <h3 class="rd-global-page-title">xApp Control</h3>
23
24   <table mat-table [dataSource]="dataSource" matSort multiTemplateDataRows class="app-control-table mat-elevation-z8">
25
26     <ng-container matColumnDef="xapp">
27       <mat-header-cell *matHeaderCellDef mat-sort-header> App Name </mat-header-cell>
28       <mat-cell *matCellDef="let element"> {{element.xapp}} </mat-cell>
29     </ng-container>
30
31     <ng-container matColumnDef="name">
32       <mat-header-cell *matHeaderCellDef mat-sort-header> Instance Name</mat-header-cell>
33       <mat-cell *matCellDef="let element"> {{element.instance.name}} </mat-cell>
34     </ng-container>
35
36     <ng-container matColumnDef="status">
37       <mat-header-cell *matHeaderCellDef mat-sort-header> Status </mat-header-cell>
38       <mat-cell *matCellDef="let element"> {{element.instance.status}} </mat-cell>
39     </ng-container>
40
41     <ng-container matColumnDef="ip" >
42       <mat-header-cell *matHeaderCellDef mat-sort-header> IP </mat-header-cell>
43       <mat-cell *matCellDef="let element"> {{element.instance.ip}} </mat-cell>
44     </ng-container>
45
46     <ng-container matColumnDef="port">
47       <mat-header-cell *matHeaderCellDef mat-sort-header> Port </mat-header-cell>
48       <mat-cell *matCellDef="let element"> {{element.instance.port}} </mat-cell>
49     </ng-container>
50
51     <ng-container matColumnDef="action">
52       <mat-header-cell *matHeaderCellDef> Action </mat-header-cell>
53       <!-- click on button should not expand/collapse the row -->
54       <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
55       <button mat-icon-button (click)="controlApp(element)">
56           <mat-icon matTooltip="Adjust settings">settings</mat-icon>
57         </button>
58         <button mat-icon-button (click)="onUndeployApp(element)">
59           <mat-icon matTooltip="Undeploy app">cloud_download</mat-icon>
60         </button>
61       </mat-cell>
62     </ng-container>
63
64     <ng-container matColumnDef="expandedDetail">
65       <td mat-cell *matCellDef="let element" [attr.colspan]="displayedColumns.length">
66         <div [@messageExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
67           <div>
68             txMessages:
69           </div>
70           <li *ngFor="let rxmessage of element.instance.rxMessages">
71             <span>{{rxmessage}}</span>
72           </li>
73           <div>
74             rxMessages:
75           </div>
76           <li *ngFor="let txmessage of element.instance.txMessages">
77             <span>{{txmessage}}</span>
78           </li>
79         </div>
80       </td>
81     </ng-container>
82
83     <ng-container matColumnDef="noRecordsFound">
84       <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
85     </ng-container>
86
87     <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
88     <mat-row *matRowDef="let element; columns: displayedColumns;"
89       [class.example-expanded-row]="expandedElement === element"
90       (click)="expandedElement = expandedElement === element ? null : element"></mat-row>
91     <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="message-row"></tr>
92     <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': dataSource.rowCount > 0}"></mat-footer-row>
93
94   </table>
95
96   <div class="spinner-container" *ngIf="dataSource.loading$ | async">
97     <mat-spinner diameter=50></mat-spinner>
98   </div>
99
100 </div>