blob: 8c75d25bbeeddb7c884d35b4f125cea0af959a6c [file] [log] [blame]
SANDHYA.JS4a7a5422021-05-15 15:35:22 +05301<!--
2Copyright 2020 TATA ELXSI
3
4Licensed under the Apache License, Version 2.0 (the 'License');
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16Author: SANDHYA JS (sandhya.j@tataelxsi.co.in)
17-->
18<div class="row">
19 <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
20 <div class="row d-flex flex-row justify-content-between px-3 py-2">
21 <div class="d-flex align-items-center header-style">{{resourcesData.name}}</div>
22 <span class="button">
23 <label class="switch ml-1">
24 <input type="checkbox" (change)="changeChartType($event.target.checked)">
25 <div class="slider round">
26 <span class="on">{{ 'PAGE.VIMDETAILS.DOUGHNUT' | translate }}</span>
27 <span class="off">{{ 'PAGE.VIMDETAILS.PIE' | translate }}</span>
28 </div>
29 </label>
30 </span>
31 </div>
32 <ng-container *ngFor="let showData of chartData">
33 <div class="header-style ml-3 mt-2">{{showData.heading}}</div>
34 <div class="row mt-2">
35 <div class="col-xs-{{12/showData.length}} col-sm-{{12/showData.length}} col-md-{{12/showData.length}} col-lg-{{12/showData.length}} col-xl-{{12/showData.length}}"
36 *ngFor="let list of showData.data;let i = index;">
37 <div class="chartData-card card text-center text-primary">
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053038 <canvas class="my-2" *ngIf="list.values.total !== 0"
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053039 baseChart
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053040 [datasets]="list.data"
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053041 [labels]="chartLabels"
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053042 [type]="chartType"
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053043 [options]="chartOptions"
44 [legend]="chartLegend"
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +053045 [colors]="list.backgroundColor">
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053046 </canvas>
SANDHYA.JS0e9c0a42022-04-04 18:44:53 +053047 <div class="no-data" *ngIf="list.values.total === 0 || list.values.total === null">
48 <h4><strong>{{'PAGE.VIMDETAILS.NODATA' | translate}}</strong></h4>
49 </div>
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053050 <div class="card-body">
51 <h5 class="card-title"><strong>{{list.title}}</strong></h5>
52 <p class="card-text">
53 {{ (list.title === 'Floating IPs' ? 'PAGE.VIMDETAILS.ALLOCATED' : 'PAGE.VIMDETAILS.USED') | translate }}
54 {{list.values.used}}{{ list.title === 'RAM' || list.title === 'Volume Storage' ? list.values.used > 0 ? 'GB' : 'Bytes' : '' }}
55 of {{list.values.total}}{{ list.title === 'RAM' || list.title === 'Volume Storage' ? 'GB' : '' }}
56 </p>
57 </div>
58 </div>
59 </div>
60 </div>
61 </ng-container>
62 </div>
63</div>