2 ========================LICENSE_START=================================
5 Copyright (C) 2019 Nordix Foundation
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
11 http://www.apache.org/licenses/LICENSE-2.0
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===================================
21 Number of instances: {{instanceCount()}}
22 <button id="createButton" mat-icon-button (click)="createPolicyInstance(policyTypeSchema)">
23 <mat-icon id="createIcon" matTooltip="Create instance">add_box</mat-icon>
25 <button id="refreshButton" mat-icon-button color="primary" (click)="refreshTable()">
26 <mat-icon id="refreshIcon">refresh</mat-icon>
28 <div class="spinner-container" style="display: flex; justify-content: center; align-items: center;"
29 *ngIf="loading$ | async">
30 <mat-spinner></mat-spinner>
32 <div id="truncated" *ngIf="truncated" class="alert">
33 Too many instances! Only {{slice}} results will be shown.
37 <mat-table class="instances-table mat-elevation-z8" id="policiesTable" [dataSource]="instanceDataSource" matSort
38 (matSortChange)="getSortedData($event)" matSortDisableClear multiTemplateDataRows>
40 <ng-container matColumnDef="instanceId">
41 <mat-header-cell mat-sort-header *matHeaderCellDef matTooltip="The ID of the policy instance">
42 <div id="idSortStop" (click)="stopSort($event)">
43 <form style="display: flex" [formGroup]="policyInstanceForm">
45 <input id="policyInstanceIdFilter" matInput formControlName="id">
46 <mat-placeholder>Instance</mat-placeholder>
51 <mat-cell *matCellDef="let instance" (click)="modifyInstance(instance)">{{instance.policy_id}}
55 <ng-container matColumnDef="ric">
56 <mat-header-cell mat-sort-header *matHeaderCellDef
57 matTooltip="Element where the policy instance resides, e.g. a gNodeB or Near-RT RIC">
58 <div id="targetSortStop" (click)="stopSort($event)">
59 <form style="display: flex" [formGroup]="policyInstanceForm">
61 <input id="policyInstanceTargetFilter" matInput formControlName="target">
62 <mat-placeholder>Target</mat-placeholder>
67 <mat-cell *matCellDef="let instance" (click)="modifyInstance(instance)">{{instance.ric_id}}
71 <ng-container matColumnDef="service">
72 <mat-header-cell mat-sort-header *matHeaderCellDef
73 matTooltip="The service that created the policy instance, and is responsible for its lifecycle">
74 <div id="ownerSortStop" (click)="stopSort($event)">
75 <form style="display: flex" [formGroup]="policyInstanceForm">
77 <input id="policyInstanceOwnerFilter" matInput formControlName="owner">
78 <mat-placeholder>Owner</mat-placeholder>
83 <mat-cell *matCellDef="let instance" (click)="modifyInstance(instance)">{{instance.service_id}}
87 <ng-container matColumnDef="lastModified">
88 <mat-header-cell mat-sort-header *matHeaderCellDef
89 matTooltip="The time of the last modification of the policy instance">
90 <div id="lastModifiedSortStop" (click)="stopSort($event)">
91 <form style="display: flex" [formGroup]="policyInstanceForm">
93 <input id="policyInstanceLastModifiedFilter" matInput formControlName="lastModified">
94 <mat-placeholder>Last modified</mat-placeholder>
99 <mat-cell *matCellDef="let instance" (click)="modifyInstance(instance)">{{toLocalTime(instance.lastModified)}}
103 <ng-container matColumnDef="action">
104 <mat-header-cell class="action-cell" *matHeaderCellDef>Action</mat-header-cell>
105 <mat-cell class="action-cell" *matCellDef="let instance">
106 <button mat-icon-button id="{{instance.policy_id + 'EditButton'}}" (click)="modifyInstance(instance)" matTooltip="Edit the policy instance">
107 <mat-icon>edit</mat-icon>
109 <button mat-icon-button id="{{instance.policy_id + 'DeleteButton'}}" color="warn" (click)="deleteInstance(instance)"
110 matTooltip="Delete the policy instance">
111 <mat-icon>delete</mat-icon>
116 <ng-container matColumnDef="noRecordsFound">
117 <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
120 <mat-header-row *matHeaderRowDef="['instanceId', 'ric', 'service', 'lastModified', 'action']" [ngClass]="{'display-none': !this.hasInstances()}">
122 <mat-row *matRowDef="let instance; columns: ['instanceId', 'ric', 'service', 'lastModified', 'action'];"></mat-row>
124 <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasInstances()}">