]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / dashboard / health / health.component.ts
index 3bc78c70074e19251a54b5767e54cc88c88c25af..7b6e5f8a0fbc92210348902c78f9f75bc20be9f5 100644 (file)
@@ -2,9 +2,10 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
 
 import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
-import { Subscription } from 'rxjs/Subscription';
+import { Subscription } from 'rxjs';
 
 import { HealthService } from '../../../shared/api/health.service';
+import { Icons } from '../../../shared/enum/icons.enum';
 import { Permissions } from '../../../shared/models/permissions';
 import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe';
 import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
@@ -27,6 +28,7 @@ export class HealthComponent implements OnInit, OnDestroy {
   interval = new Subscription();
   permissions: Permissions;
   enabledFeature$: FeatureTogglesMap$;
+  icons = Icons;
 
   rawCapacityChartConfig = {
     options: {
@@ -92,7 +94,7 @@ export class HealthComponent implements OnInit, OnDestroy {
     });
   }
 
-  prepareReadWriteRatio(chart) {
+  prepareReadWriteRatio(chart: Record<string, any>) {
     const ratioLabels = [];
     const ratioData = [];
 
@@ -118,7 +120,7 @@ export class HealthComponent implements OnInit, OnDestroy {
     chart.labels = ratioLabels;
   }
 
-  prepareRawUsage(chart, data) {
+  prepareRawUsage(chart: Record<string, any>, data: Record<string, any>) {
     const percentAvailable = this.calcPercentage(
       data.df.stats.total_bytes - data.df.stats.total_used_raw_bytes,
       data.df.stats.total_bytes
@@ -144,8 +146,8 @@ export class HealthComponent implements OnInit, OnDestroy {
     )} ${this.i18n('total')}`;
   }
 
-  preparePgStatus(chart, data) {
-    const categoryPgAmount = {};
+  preparePgStatus(chart: Record<string, any>, data: Record<string, any>) {
+    const categoryPgAmount: Record<string, number> = {};
     let totalPgs = 0;
 
     _.forEach(data.pg_info.statuses, (pgAmount, pgStatesText) => {
@@ -170,7 +172,7 @@ export class HealthComponent implements OnInit, OnDestroy {
     ];
   }
 
-  prepareObjects(chart, data) {
+  prepareObjects(chart: Record<string, any>, data: Record<string, any>) {
     const totalReplicas = data.pg_info.object_stats.num_object_copies;
     const healthy =
       totalReplicas -