PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 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 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 21 | <h3 class="rd-global-page-title">Policy Control</h3> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 22 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 23 | <table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows |
| 24 | class="policy-type-table mat-elevation-z8"> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 25 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 26 | <ng-container matColumnDef="name"> |
PatrikBuhr | 4712005 | 2019-11-19 09:56:44 +0100 | [diff] [blame^] | 27 | <mat-header-cell *matHeaderCellDef>Policy Type</mat-header-cell> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 28 | <mat-cell *matCellDef="let policyType"> |
| 29 | <mat-icon matTooltip="Properties">{{isInstancesShown(policyType) ? 'expand_less' : 'expand_more'}} |
| 30 | </mat-icon> |
PatrikBuhr | 4712005 | 2019-11-19 09:56:44 +0100 | [diff] [blame^] | 31 | {{policyType.name}} |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 32 | </mat-cell> |
| 33 | </ng-container> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 34 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 35 | <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> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 39 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 40 | <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> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 48 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 49 | <!-- =================== Policy instances for one type ======================== --> |
| 50 | <ng-container matColumnDef="instanceTableContainer"> |
| 51 | <mat-cell *matCellDef="let policyType"> |
PatrikBuhr | 4712005 | 2019-11-19 09:56:44 +0100 | [diff] [blame^] | 52 | <rd-policy-instance [policyType]=policyType [expanded]=this.getExpandedObserver(policyType)> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 53 | </rd-policy-instance> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 54 | </mat-cell> |
| 55 | </ng-container> |
| 56 | <!-- ======= --> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 57 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 58 | <ng-container matColumnDef="noRecordsFound"> |
| 59 | <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell> |
| 60 | </ng-container> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 61 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 62 | <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> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 66 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 67 | <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];" |
| 68 | [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden"> |
| 69 | </mat-row> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 70 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 71 | <mat-footer-row *matFooterRowDef="['noRecordsFound']" |
| 72 | [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}"> |
| 73 | </mat-footer-row> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 74 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 75 | </table> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 76 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 77 | <div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async"> |
| 78 | <mat-spinner diameter="50"></mat-spinner> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 79 | </div> |