blob: e71fd8ab5e8ba60bc2779c683dd521b20f1b6991 [file] [log] [blame]
PatrikBuhra2bc79c2019-10-29 13:39:00 +01001<!--
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
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010021<h3 class="rd-global-page-title">Policy Control</h3>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010022
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010023<table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows
24 class="policy-type-table mat-elevation-z8">
PatrikBuhra2bc79c2019-10-29 13:39:00 +010025
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010026 <ng-container matColumnDef="name">
PatrikBuhr592589c2019-11-20 15:00:31 +010027 <mat-header-cell *matHeaderCellDef mat-sort-header>Policy Type</mat-header-cell>
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010028 <mat-cell *matCellDef="let policyType">
29 <mat-icon matTooltip="Properties">{{isInstancesShown(policyType) ? 'expand_less' : 'expand_more'}}
30 </mat-icon>
PatrikBuhr592589c2019-11-20 15:00:31 +010031 {{this.getName(policyType)}}
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010032 </mat-cell>
33 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010034
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010035 <ng-container matColumnDef="description">
36 <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
PatrikBuhr592589c2019-11-20 15:00:31 +010037 <mat-cell *matCellDef="let policyType"> {{this.getDescription(policyType)}}
38 </mat-cell>
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010039 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010040
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010041 <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>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010049
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010050 <!-- =================== Policy instances for one type ======================== -->
51 <ng-container matColumnDef="instanceTableContainer">
52 <mat-cell *matCellDef="let policyType">
PatrikBuhr47120052019-11-19 09:56:44 +010053 <rd-policy-instance [policyType]=policyType [expanded]=this.getExpandedObserver(policyType)>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010054 </rd-policy-instance>
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010055 </mat-cell>
56 </ng-container>
57 <!-- ======= -->
PatrikBuhra2bc79c2019-10-29 13:39:00 +010058
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010059 <ng-container matColumnDef="noRecordsFound">
60 <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
61 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010062
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010063 <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>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010067
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010068 <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];"
69 [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden">
70 </mat-row>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010071
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010072 <mat-footer-row *matFooterRowDef="['noRecordsFound']"
73 [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
74 </mat-footer-row>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010075
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010076</table>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010077
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010078<div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async">
79 <mat-spinner diameter="50"></mat-spinner>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010080</div>