| SANDHYA.JS | 4a7a542 | 2021-05-15 15:35:22 +0530 | [diff] [blame^] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: 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"> |
| 38 | <canvas class="my-2" |
| 39 | baseChart |
| 40 | [data]="list.data" |
| 41 | [labels]="chartLabels" |
| 42 | [chartType]="chartType" |
| 43 | [options]="chartOptions" |
| 44 | [legend]="chartLegend" |
| 45 | [colors]="list.colorValues"> |
| 46 | </canvas> |
| 47 | <div class="card-body"> |
| 48 | <h5 class="card-title"><strong>{{list.title}}</strong></h5> |
| 49 | <p class="card-text"> |
| 50 | {{ (list.title === 'Floating IPs' ? 'PAGE.VIMDETAILS.ALLOCATED' : 'PAGE.VIMDETAILS.USED') | translate }} |
| 51 | {{list.values.used}}{{ list.title === 'RAM' || list.title === 'Volume Storage' ? list.values.used > 0 ? 'GB' : 'Bytes' : '' }} |
| 52 | of {{list.values.total}}{{ list.title === 'RAM' || list.title === 'Volume Storage' ? 'GB' : '' }} |
| 53 | </p> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | </div> |
| 58 | </ng-container> |
| 59 | </div> |
| 60 | </div> |