First version of NonRT RIC Controlpanel
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / policy-control / policy-control.component.html
1 <!--
2   ========================LICENSE_START=================================
3   O-RAN-SC
4   %%
5   Copyright (C) 2019 Nordix Foundation
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 <h3 class="rd-global-page-title">Policy Control</h3>
22
23 <table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows
24     class="policy-type-table mat-elevation-z8">
25
26     <ng-container matColumnDef="name">
27         <mat-header-cell *matHeaderCellDef>Policy Type</mat-header-cell>
28         <mat-cell *matCellDef="let policyType">
29             <mat-icon matTooltip="Properties">{{isInstancesShown(policyType)  ? 'expand_less' : 'expand_more'}}
30             </mat-icon>
31             {{this.getName(policyType)}}
32         </mat-cell>
33     </ng-container>
34
35     <ng-container matColumnDef="description">
36         <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
37         <mat-cell *matCellDef="let policyType"> {{policyType.schemaObject.description}}
38         </mat-cell>
39     </ng-container>
40
41     <ng-container matColumnDef="action">
42         <mat-header-cell class="action-cell" *matHeaderCellDef>Action </mat-header-cell>
43         <mat-cell class="action-cell" *matCellDef="let policyType" (click)="$event.stopPropagation()">
44             <button mat-icon-button (click)="createPolicyInstance(policyType)">
45                 <mat-icon matTooltip="Create instance">add_box</mat-icon>
46             </button>
47         </mat-cell>
48     </ng-container>
49
50     <!-- =================== Policy instances for one type ======================== -->
51     <ng-container matColumnDef="instanceTableContainer">
52         <mat-cell *matCellDef="let policyType">
53             <rd-policy-instance [policyType]=policyType [expanded]=this.getExpandedObserver(policyType)>
54             </rd-policy-instance>
55         </mat-cell>
56     </ng-container>
57     <!-- ======= -->
58
59     <ng-container matColumnDef="noRecordsFound">
60         <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
61     </ng-container>
62
63     <mat-header-row *matHeaderRowDef="['name', 'description', 'action']"></mat-header-row>
64     <mat-row *matRowDef="let policyType; columns: ['name', 'description', 'action']"
65         (click)="toggleListInstances(policyType)">
66     </mat-row>
67
68     <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];"
69         [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden">
70     </mat-row>
71
72     <mat-footer-row *matFooterRowDef="['noRecordsFound']"
73         [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
74     </mat-footer-row>
75
76 </table>
77
78 <div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async">
79     <mat-spinner diameter="50"></mat-spinner>
80 </div>