]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / osd / osd-recv-speed-modal / osd-recv-speed-modal.component.ts
index f23430800e01a4d4478fcc2340b504368d891eb5..6546e086569edd56381f1563e1ec558c0b47ff91 100755 (executable)
@@ -1,18 +1,18 @@
 import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-import * as _ from 'lodash';
-import { BsModalRef } from 'ngx-bootstrap/modal';
-
-import { ConfigurationService } from '../../../../shared/api/configuration.service';
-import { OsdService } from '../../../../shared/api/osd.service';
-import { ConfigOptionTypes } from '../../../../shared/components/config-option/config-option.types';
-import { NotificationType } from '../../../../shared/enum/notification-type.enum';
-import { CdFormGroup } from '../../../../shared/forms/cd-form-group';
-import { Permissions } from '../../../../shared/models/permissions';
-import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
-import { NotificationService } from '../../../../shared/services/notification.service';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import _ from 'lodash';
+
+import { ConfigurationService } from '~/app/shared/api/configuration.service';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { ConfigOptionTypes } from '~/app/shared/components/config-option/config-option.types';
+import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
+import { NotificationType } from '~/app/shared/enum/notification-type.enum';
+import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
+import { Permissions } from '~/app/shared/models/permissions';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { NotificationService } from '~/app/shared/services/notification.service';
 
 @Component({
   selector: 'cd-osd-recv-speed-modal',
@@ -27,11 +27,11 @@ export class OsdRecvSpeedModalComponent implements OnInit {
   priorityAttrs = {};
 
   constructor(
-    public bsModalRef: BsModalRef,
+    public activeModal: NgbActiveModal,
+    public actionLabels: ActionLabelsI18n,
     private authStorageService: AuthStorageService,
     private configService: ConfigurationService,
     private notificationService: NotificationService,
-    private i18n: I18n,
     private osdService: OsdService
   ) {
     this.permissions = this.authStorageService.getPermissions();
@@ -42,28 +42,28 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     });
     this.priorityAttrs = {
       osd_max_backfills: {
-        text: this.i18n('Max Backfills'),
+        text: $localize`Max Backfills`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_max_active: {
-        text: this.i18n('Recovery Max Active'),
+        text: $localize`Recovery Max Active`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_max_single_start: {
-        text: this.i18n('Recovery Max Single Start'),
+        text: $localize`Recovery Max Single Start`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
         minValue: undefined
       },
       osd_recovery_sleep: {
-        text: this.i18n('Recovery Sleep'),
+        text: $localize`Recovery Sleep`,
         desc: '',
         patternHelpText: '',
         maxValue: undefined,
@@ -104,7 +104,7 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     if (Object.entries(configOptionValues).length === 4) {
       this.osdRecvSpeedForm.controls.customizePriority.setValue(true);
       return callbackFn(
-        Object({ name: 'custom', text: this.i18n('Custom'), values: configOptionValues })
+        Object({ name: 'custom', text: $localize`Custom`, values: configOptionValues })
       );
     }
 
@@ -189,7 +189,7 @@ export class OsdRecvSpeedModalComponent implements OnInit {
     if (this.osdRecvSpeedForm.getValue('customizePriority')) {
       const customPriority = {
         name: 'custom',
-        text: this.i18n('Custom'),
+        text: $localize`Custom`,
         values: values
       };
       this.setPriority(customPriority);
@@ -224,14 +224,14 @@ export class OsdRecvSpeedModalComponent implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Updated OSD recovery speed priority "{{value}}"', {
-            value: this.osdRecvSpeedForm.getValue('priority')
-          })
+          $localize`Updated OSD recovery speed priority '${this.osdRecvSpeedForm.getValue(
+            'priority'
+          )}'`
         );
-        this.bsModalRef.hide();
+        this.activeModal.close();
       },
       () => {
-        this.bsModalRef.hide();
+        this.activeModal.close();
       }
     );
   }