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';
permission: Permission;
tableActions: CdTableAction[];
selection = new CdTableSelection();
- modalRef: BsModalRef;
+ modalRef: NgbModalRef;
peersExist = true;
siteName: any;
status: ViewCacheStatus;
constructor(
private authStorageService: AuthStorageService,
private rbdMirroringService: RbdMirroringService,
- private modalService: BsModalService,
- private i18n: I18n
+ private modalService: ModalService
) {
this.permission = this.authStorageService.getPermissions().rbdMirroring;
permission: 'update',
icon: Icons.edit,
click: () => this.editSiteNameModal(),
- name: this.i18n('Edit Site Name'),
+ name: $localize`Edit Site Name`,
canBePrimary: () => true,
disable: () => false
};
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];
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);
}
}