App metrics visualization manage
[portal/ric-dashboard.git] / dashboard / webapp-frontend / src / app / stats / stats.component.html
1 <!--
2   ========================LICENSE_START=================================
3   O-RAN-SC
4   %%
5   Copyright (C) 2019 AT&T Intellectual Property
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   <div class="stats__section">
21     <h3 class="rd-global-page-title">Platform stats</h3>
22     <button mat-raised-button (click)="setupAppMetrics()">Add App Metrics..</button>
23     <table mat-table class="stats-table mat-elevation-z8" [dataSource]="dataSource">
24       <ng-template #noValue></ng-template>
25
26
27       <ng-container matColumnDef="appName">
28         <mat-header-cell *matHeaderCellDef>App Name</mat-header-cell>
29         <mat-cell *matCellDef="let stats">
30           <div *ngIf="stats.statsDetails.appName; else noValue">{{stats.statsDetails.appName}}</div>
31         </mat-cell>
32       </ng-container>
33
34       <ng-container matColumnDef="metricUrl">
35         <mat-header-cell *matHeaderCellDef>Metrics Url</mat-header-cell>
36         <mat-cell *matCellDef="let stats">
37           <div *ngIf="stats.statsDetails.metricUrl; else noValue">{{stats.statsDetails.metricUrl}}</div>
38         </mat-cell>
39       </ng-container>
40
41       <ng-container matColumnDef="editmetricUrl">
42         <mat-header-cell *matHeaderCellDef>Action</mat-header-cell>
43         <mat-cell *matCellDef="let stats">
44           <div *ngIf="stats; else noValue"><button mat-icon-button (click)="editAppMetrics(stats)">
45             <mat-icon matTooltip="Edit name, url">edit</mat-icon>
46           </button></div>
47           <div *ngIf="stats; else noValue"><button mat-icon-button (click)="viewAppMetrics(stats)">
48             <mat-icon matTooltip="View metrics">pageview</mat-icon>
49           </button></div>
50           <div *ngIf="stats; else noValue"><button mat-icon-button (click)="deleteAppMetrics(stats)">
51             <mat-icon matTooltip="Delete metrics">delete</mat-icon>
52           </button></div>
53         </mat-cell>
54       </ng-container>
55
56       <ng-container matColumnDef="noRecordsFound">
57         <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
58       </ng-container>
59
60       <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
61       <mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
62       <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': dataSource.rowCount > 0}">
63       </mat-footer-row>
64
65     </table>
66     <div class="spinner-container" *ngIf="dataSource.loading$ | async">
67       <mat-spinner diameter=50></mat-spinner>
68     </div>
69
70     <mat-form-field [hidden]="true">
71       <input matInput type="number" [formControl]="selected">
72     </mat-form-field>
73
74     <mat-tab-group [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)" (selectedTabChange)="onTabChanged($event)">
75       <mat-tab *ngFor="let tab of tabs; let index = index" [label]="tab.statsDetails.appName">
76         <iframe [src]="metricsUrl"></iframe>
77       </mat-tab>
78     </mat-tab-group>
79   </div>