]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / mirroring / overview / overview.component.ts
index a73db2f62fafa7acb8fec31a5ff39297db849347..c919e03cdbb82680370a4ab4a603a1f19e4641f4 100644 (file)
@@ -1,17 +1,17 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
-import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
+import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { Subscription } from 'rxjs';
 
-import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
-import { Icons } from '../../../../shared/enum/icons.enum';
-import { ViewCacheStatus } from '../../../../shared/enum/view-cache-status.enum';
-import { CdTableAction } from '../../../../shared/models/cd-table-action';
-import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
-import { Permission } from '../../../../shared/models/permissions';
-import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
-import { Pool } from '../../../pool/pool';
+import { Pool } from '~/app/ceph/pool/pool';
+import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service';
+import { Icons } from '~/app/shared/enum/icons.enum';
+import { ViewCacheStatus } from '~/app/shared/enum/view-cache-status.enum';
+import { CdTableAction } from '~/app/shared/models/cd-table-action';
+import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
+import { Permission } from '~/app/shared/models/permissions';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { ModalService } from '~/app/shared/services/modal.service';
 import { BootstrapCreateModalComponent } from '../bootstrap-create-modal/bootstrap-create-modal.component';
 import { BootstrapImportModalComponent } from '../bootstrap-import-modal/bootstrap-import-modal.component';
 import { EditSiteNameModalComponent } from '../edit-site-name-modal/edit-site-name-modal.component';
@@ -25,7 +25,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
   permission: Permission;
   tableActions: CdTableAction[];
   selection = new CdTableSelection();
-  modalRef: BsModalRef;
+  modalRef: NgbModalRef;
   peersExist = true;
   siteName: any;
   status: ViewCacheStatus;
@@ -34,8 +34,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
   constructor(
     private authStorageService: AuthStorageService,
     private rbdMirroringService: RbdMirroringService,
-    private modalService: BsModalService,
-    private i18n: I18n
+    private modalService: ModalService
   ) {
     this.permission = this.authStorageService.getPermissions().rbdMirroring;
 
@@ -43,7 +42,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
       permission: 'update',
       icon: Icons.edit,
       click: () => this.editSiteNameModal(),
-      name: this.i18n('Edit Site Name'),
+      name: $localize`Edit Site Name`,
       canBePrimary: () => true,
       disable: () => false
     };
@@ -51,14 +50,14 @@ export class OverviewComponent implements OnInit, OnDestroy {
       permission: 'update',
       icon: Icons.upload,
       click: () => this.createBootstrapModal(),
-      name: this.i18n('Create Bootstrap Token'),
+      name: $localize`Create Bootstrap Token`,
       disable: () => false
     };
     const importBootstrapAction: CdTableAction = {
       permission: 'update',
       icon: Icons.download,
       click: () => this.importBootstrapModal(),
-      name: this.i18n('Import Bootstrap Token'),
+      name: $localize`Import Bootstrap Token`,
       disable: () => this.peersExist
     };
     this.tableActions = [editSiteNameAction, createBootstrapAction, importBootstrapAction];
@@ -84,20 +83,20 @@ export class OverviewComponent implements OnInit, OnDestroy {
     const initialState = {
       siteName: this.siteName
     };
-    this.modalRef = this.modalService.show(EditSiteNameModalComponent, { initialState });
+    this.modalRef = this.modalService.show(EditSiteNameModalComponent, initialState);
   }
 
   createBootstrapModal() {
     const initialState = {
       siteName: this.siteName
     };
-    this.modalRef = this.modalService.show(BootstrapCreateModalComponent, { initialState });
+    this.modalRef = this.modalService.show(BootstrapCreateModalComponent, initialState);
   }
 
   importBootstrapModal() {
     const initialState = {
       siteName: this.siteName
     };
-    this.modalRef = this.modalService.show(BootstrapImportModalComponent, { initialState });
+    this.modalRef = this.modalService.show(BootstrapImportModalComponent, initialState);
   }
 }