]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / mirroring / pool-edit-mode-modal / pool-edit-mode-modal.component.ts
index 137e787174d7a0e545382746cf5fbf9cf182afcc..ef30c888c8ba6207be4ff0a0ec9f2756d3d477fc 100644 (file)
@@ -1,5 +1,7 @@
+import { Location } from '@angular/common';
 import { Component, OnDestroy, OnInit } from '@angular/core';
 import { AbstractControl, FormControl, Validators } from '@angular/forms';
+import { ActivatedRoute } from '@angular/router';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { Subscription } from 'rxjs';
@@ -40,7 +42,9 @@ export class PoolEditModeModalComponent implements OnInit, OnDestroy {
     public activeModal: NgbActiveModal,
     public actionLabels: ActionLabelsI18n,
     private rbdMirroringService: RbdMirroringService,
-    private taskWrapper: TaskWrapperService
+    private taskWrapper: TaskWrapperService,
+    private route: ActivatedRoute,
+    private location: Location
   ) {
     this.createForm();
   }
@@ -54,6 +58,9 @@ export class PoolEditModeModalComponent implements OnInit, OnDestroy {
   }
 
   ngOnInit() {
+    this.route.params.subscribe((params: { pool_name: string }) => {
+      this.poolName = params.pool_name;
+    });
     this.pattern = `${this.poolName}`;
     this.rbdMirroringService.getPool(this.poolName).subscribe((resp: PoolEditModeResponseModel) => {
       this.setResponse(resp);
@@ -97,7 +104,7 @@ export class PoolEditModeModalComponent implements OnInit, OnDestroy {
       error: () => this.editModeForm.setErrors({ cdSubmitButton: true }),
       complete: () => {
         this.rbdMirroringService.refresh();
-        this.activeModal.close();
+        this.location.back();
       }
     });
   }