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 | 592589c | 2019-11-20 15:00:31 +0100 | [diff] [blame^] | 27 | <mat-header-cell *matHeaderCellDef mat-sort-header>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 | 592589c | 2019-11-20 15:00:31 +0100 | [diff] [blame^] | 31 | {{this.getName(policyType)}} |
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> |
PatrikBuhr | 592589c | 2019-11-20 15:00:31 +0100 | [diff] [blame^] | 37 | <mat-cell *matCellDef="let policyType"> {{this.getDescription(policyType)}} |
| 38 | </mat-cell> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 39 | </ng-container> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 40 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 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> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 49 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 50 | <!-- =================== Policy instances for one type ======================== --> |
| 51 | <ng-container matColumnDef="instanceTableContainer"> |
| 52 | <mat-cell *matCellDef="let policyType"> |
PatrikBuhr | 4712005 | 2019-11-19 09:56:44 +0100 | [diff] [blame] | 53 | <rd-policy-instance [policyType]=policyType [expanded]=this.getExpandedObserver(policyType)> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 54 | </rd-policy-instance> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 55 | </mat-cell> |
| 56 | </ng-container> |
| 57 | <!-- ======= --> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 58 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 59 | <ng-container matColumnDef="noRecordsFound"> |
| 60 | <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell> |
| 61 | </ng-container> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 62 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 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> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 67 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 68 | <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];" |
| 69 | [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden"> |
| 70 | </mat-row> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 71 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 72 | <mat-footer-row *matFooterRowDef="['noRecordsFound']" |
| 73 | [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}"> |
| 74 | </mat-footer-row> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 75 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 76 | </table> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 77 | |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 78 | <div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async"> |
| 79 | <mat-spinner diameter="50"></mat-spinner> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 80 | </div> |