blob: 1eef5c5a045ba35df38775d04d56c4da413092f7 [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">
PatrikBuhr47120052019-11-19 09:56:44 +010027 <mat-header-cell *matHeaderCellDef>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>
PatrikBuhr47120052019-11-19 09:56:44 +010031 {{policyType.name}}
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>
37 <mat-cell *matCellDef="let policyType"> {{policyType.description}} </mat-cell>
38 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010039
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010040 <ng-container matColumnDef="action">
41 <mat-header-cell class="action-cell" *matHeaderCellDef>Action </mat-header-cell>
42 <mat-cell class="action-cell" *matCellDef="let policyType" (click)="$event.stopPropagation()">
43 <button mat-icon-button (click)="createPolicyInstance(policyType)">
44 <mat-icon matTooltip="Create instance">add_box</mat-icon>
45 </button>
46 </mat-cell>
47 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010048
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010049 <!-- =================== Policy instances for one type ======================== -->
50 <ng-container matColumnDef="instanceTableContainer">
51 <mat-cell *matCellDef="let policyType">
PatrikBuhr47120052019-11-19 09:56:44 +010052 <rd-policy-instance [policyType]=policyType [expanded]=this.getExpandedObserver(policyType)>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010053 </rd-policy-instance>
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010054 </mat-cell>
55 </ng-container>
56 <!-- ======= -->
PatrikBuhra2bc79c2019-10-29 13:39:00 +010057
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010058 <ng-container matColumnDef="noRecordsFound">
59 <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
60 </ng-container>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010061
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010062 <mat-header-row *matHeaderRowDef="['name', 'description', 'action']"></mat-header-row>
63 <mat-row *matRowDef="let policyType; columns: ['name', 'description', 'action']"
64 (click)="toggleListInstances(policyType)">
65 </mat-row>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010066
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010067 <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];"
68 [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden">
69 </mat-row>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010070
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010071 <mat-footer-row *matFooterRowDef="['noRecordsFound']"
72 [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
73 </mat-footer-row>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010074
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010075</table>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010076
PatrikBuhrdbb8eba2019-11-15 14:12:11 +010077<div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async">
78 <mat-spinner diameter="50"></mat-spinner>
PatrikBuhra2bc79c2019-10-29 13:39:00 +010079</div>