Apply mat-table to control and catalog
[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" multiTemplateDataRows class="control-table mat-elevation-z8">
26
27     <ng-container matColumnDef="xapp">
28       <mat-header-cell *matHeaderCellDef> xApp 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> 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> 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> 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> 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       <mat-cell *matCellDef="let element">
55         <button mat-icon-button
56                 (click)="view()">
57           <mat-icon>settings</mat-icon>
58         </button>
59         <button mat-icon-button
60                 color="warn"
61                 (click)="undeploy(element.xapp)">
62           <mat-icon>delete</mat-icon>
63         </button>
64       </mat-cell>
65     </ng-container>
66
67     <ng-container matColumnDef="expandedDetail">
68       <td mat-cell *matCellDef="let element" [attr.colspan]="displayedColumns.length">
69         <div [@messageExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
70           <div>
71             txMessages:
72           </div>
73           <li *ngFor="let rxmessage of element.instance.rxMessage">
74             <span>{{rxmessage}}</span>
75           </li>
76           <div>
77             rxMessages:
78           </div>
79           <li *ngFor="let txmessage of element.instance.txMessage">
80             <span>{{txmessage}}</span>
81           </li>
82         </div>
83       </td>
84     </ng-container>
85
86     <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
87     <mat-row *matRowDef="let element; columns: displayedColumns;"
88              [class.example-expanded-row]="expandedElement === element"
89              (click)="expandedElement = expandedElement === element ? null : element"></mat-row>
90     <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="message-row"></tr>
91   </table>
92 </div>