]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix multi-cluster context switcher 66583/head
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Wed, 10 Dec 2025 10:41:50 +0000 (16:11 +0530)
committerAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Tue, 30 Dec 2025 06:20:48 +0000 (11:50 +0530)
The multi-cluster context switcher stopped working because of a
regression caused by this PR https://github.com/ceph/ceph/pull/66034.
This PR tends to fix this issue

Signed-off-by: Aashish Sharma <aasharma@redhat.com>
12 files changed:
src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.po.ts
src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts

index c37dac2fe6a02b641b6b906d30ab8a0bb95615d4..ac10a7239fc030d37949128b984786d831cdebba 100644 (file)
@@ -26,7 +26,7 @@ describe('Muti-cluster management page', () => {
   });
 
   it('should edit the second cluster', () => {
-    multiCluster.edit(alias, editedAlias);
+    multiCluster.edit(alias, editedAlias, password);
     multiCluster.existTableCell(editedAlias);
   });
 
index 13856eefcbcd1e21193e32d0c635b2d2c7158491..e830365cb5aeef389a3afa77041f5e717dac98db 100644 (file)
@@ -2,7 +2,8 @@ import { PageHelper } from '../page-helper.po';
 
 const pages = {
   index: { url: '#/multi-cluster/overview', id: 'cd-multi-cluster' },
-  'manage-clusters': { url: '#/multi-cluster/manage-clusters', id: 'cd-multi-cluster-list' }
+  'manage-clusters': { url: '#/multi-cluster/manage-clusters', id: 'cd-multi-cluster-list' },
+  connect: { url: '#/multi-cluster/manage-clusters/connect', id: 'cd-multi-cluster-form' }
 };
 
 const WAIT_TIMER = 1000;
@@ -18,18 +19,24 @@ export class MultiClusterPageHelper extends PageHelper {
   auth(url: string, alias: string, username: string, password: string) {
     cy.contains('button', 'Connect').click();
     cy.get('cd-multi-cluster-form').should('exist');
-    cy.get('cd-modal').within(() => {
-      cy.get('input[name=remoteClusterUrl]').type(url);
-      cy.get('input[name=clusterAlias]').type(alias);
-      cy.get('input[name=username]').type(username);
-      cy.get('input[name=password]').type(password);
-      cy.get('cd-submit-button').click();
-    });
+    this.navigateTo('connect');
+    cy.get('input[name=remoteClusterUrl]').type(url);
+    cy.get('input[name=clusterAlias]').type(alias);
+    cy.get('input[name=username]').type(username);
+    cy.get('#password').type(password);
+    cy.get('[data-testid=submitBtn]').click();
     cy.wait(WAIT_TIMER);
   }
 
   disconnect(alias: string) {
-    this.clickRowActionButton(alias, 'disconnect');
+    this.searchTable(alias);
+    cy.wait(3000);
+    cy.get(`[cdstablerow] [cdstabledata]:nth-child(${this.columnIndex.alias})`)
+      .filter((_i, el) => el.innerText.trim() === alias)
+      .parent('[cdstablerow]')
+      .find('[cdstabledata] [data-testid="table-action-btn"]')
+      .click({ force: true });
+    cy.get(`button.disconnect`).click({ force: true });
     cy.get('cds-modal').within(() => {
       cy.get('#confirmation_input').click({ force: true });
       cy.get('cd-submit-button').click();
@@ -38,35 +45,48 @@ export class MultiClusterPageHelper extends PageHelper {
   }
 
   reconnect(alias: string, password: string) {
-    this.clickRowActionButton(alias, 'reconnect');
-    cy.get('cd-modal').within(() => {
-      cy.get('input[name=password]').type(password);
-      cy.get('cd-submit-button').click();
-    });
+    this.searchTable(alias);
+    cy.wait(3000);
+    cy.get(`[cdstablerow] [cdstabledata]:nth-child(${this.columnIndex.alias})`)
+      .filter((_i, el) => el.innerText.trim() === alias)
+      .parent('[cdstablerow]')
+      .find('[cdstabledata] [data-testid="table-action-btn"]')
+      .click({ force: true });
+    cy.get(`button.reconnect`).click({ force: true });
+    cy.get('#password').type(password);
+    cy.get('[data-testid=submitBtn]').click();
     cy.wait(WAIT_TIMER);
   }
 
-  edit(alias: string, newAlias: string) {
-    this.clickRowActionButton(alias, 'edit');
-    cy.get('cd-modal').within(() => {
-      cy.get('input[name=clusterAlias]').clear().type(newAlias);
-      cy.get('cd-submit-button').click();
-    });
+  edit(alias: string, newAlias: string, password: string) {
+    this.searchTable(alias);
+    cy.wait(3000);
+    cy.get(`[cdstablerow] [cdstabledata]:nth-child(${this.columnIndex.alias})`)
+      .filter((_i, el) => el.innerText.trim() === alias)
+      .parent('[cdstablerow]')
+      .find('[cdstabledata] [data-testid="table-action-btn"]')
+      .click({ force: true });
+    cy.get(`button.edit`).click({ force: true });
+    cy.get('input[name=clusterAlias]').clear().type(newAlias);
+    cy.get('#password').type(password);
+    cy.get('[data-testid=submitBtn]').click();
     cy.wait(WAIT_TIMER);
   }
 
   checkConnectionStatus(alias: string, expectedStatus = 'CONNECTED', shouldReload = true) {
-    let aliasIndex = this.columnIndex.alias;
-    let statusIndex = this.columnIndex.connection;
+    const aliasIndex = this.columnIndex.alias;
+    const statusIndex = this.columnIndex.connection;
     if (shouldReload) {
       cy.reload(true, { log: true, timeout: 5 * 1000 });
     }
-
-    this.getTableCell(aliasIndex, alias)
+    this.searchTable(alias);
+    cy.wait(3000);
+    cy.get(`[cdstablerow] [cdstabledata]:nth-child(${aliasIndex})`)
+      .filter((_i, el) => el.innerText.trim() === alias)
       .parent()
       .find(`[cdstabledata]:nth-child(${statusIndex}) cds-tag`)
       .should(($ele) => {
-        const status = $ele.toArray().map((v) => v.innerText);
+        const status = $ele.toArray().map((v) => v.innerText.trim());
         expect(status).to.include(expectedStatus);
       });
   }
index 0de4ea6404ac1309e0b249407584beb03153ebb0..bf0268e1a59f2c9c5a40bb2ad3253060d80eea09 100644 (file)
@@ -49,7 +49,6 @@ import { CephfsVolumeFormComponent } from './ceph/cephfs/cephfs-form/cephfs-form
 import { UpgradeProgressComponent } from './ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component';
 import { MultiClusterComponent } from './ceph/cluster/multi-cluster/multi-cluster.component';
 import { MultiClusterListComponent } from './ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component';
-import { MultiClusterDetailsComponent } from './ceph/cluster/multi-cluster/multi-cluster-details/multi-cluster-details.component';
 import { SmbClusterFormComponent } from './ceph/smb/smb-cluster-form/smb-cluster-form.component';
 import { SmbShareFormComponent } from './ceph/smb/smb-share-form/smb-share-form.component';
 import { SmbJoinAuthFormComponent } from './ceph/smb/smb-join-auth-form/smb-join-auth-form.component';
@@ -228,10 +227,6 @@ const routes: Routes = [
                 path: `${URLVerbs.RECONNECT}/:name`,
                 component: MultiClusterFormComponent,
                 data: { breadcrumbs: ActionLabels.RECONNECT }
-              },
-              {
-                path: 'performance-details',
-                component: MultiClusterDetailsComponent
               }
             ]
           }
index 5fe7ac88d81fac16379a6938cd496b86d536369e..b2ffca0a87813f3ef13defd26358d9cd743f0665 100644 (file)
@@ -24,6 +24,7 @@ import {
 import Analytics from '@carbon/icons/es/analytics/16';
 import CloseFilled from '@carbon/icons/es/close--filled/16';
 import ProgressBarRoundIcon from '@carbon/icons/es/progress-bar--round/32';
+import Connect from '@carbon/icons/es/connect/32';
 import {
   NgbActiveModal,
   NgbDatepickerModule,
@@ -176,6 +177,6 @@ import { TextLabelListComponent } from '~/app/shared/components/text-label-list/
 })
 export class ClusterModule {
   constructor(private iconService: IconService) {
-    this.iconService.registerAll([Analytics, CloseFilled, ProgressBarRoundIcon]);
+    this.iconService.registerAll([Analytics, CloseFilled, ProgressBarRoundIcon, Connect]);
   }
 }
index ba249eacc9b0e61ce48d1cfff3e706327eb7ec0c..a6b2b1bdad4b1b41f07e701d0662db9071c127db 100644 (file)
@@ -1,12 +1,17 @@
-<div cdsCol [columnNumbers]="{md: 6}">
-  <ng-container>
-    <form name="remoteClusterForm"
-          #frm="ngForm"
-          [formGroup]="remoteClusterForm"
-          novalidate>
-
-      <div i18n="form title"
-           class="form-header">{{ action | titlecase }} Cluster</div>
+<form name="remoteClusterForm"
+      #frm="ngForm"
+      [formGroup]="remoteClusterForm"
+      novalidate>
+  <div cdsGrid
+       [useCssGrid]="true"
+       [narrow]="true"
+       [fullWidth]="true">
+    <div cdsCol
+         [columnNumbers]="{sm: 4, md: 8}">
+      <div cdsRow
+           class="form-heading">
+        <h3>{{ action | titlecase }} Cluster</h3>
+      </div>
 
       <cds-inline-notification
         *ngIf="connectionVerified !== undefined && !connectionVerified && connectionMessage !== 'Connection refused'"
@@ -22,7 +27,8 @@
         [subtitle]="connectionMessage">
       </cds-inline-notification>
 
-      <div class="form-item">
+      <div cdsRow
+           class="form-item">
         <cds-text-label
           cdRequiredField="Cluster API URL"
           [invalid]="remoteClusterForm.controls.remoteClusterUrl.invalid && remoteClusterForm.controls.remoteClusterUrl.dirty"
           for="remoteClusterUrl"
           i18n>
           Cluster API URL
-         
-          <input cdsText
-                 type="text"
-                 id="remoteClusterUrl"
-                 name="remoteClusterUrl"
-                 placeholder="https://localhost:4202"
-                 formControlName="remoteClusterUrl"
-                 [invalid]="remoteClusterForm.controls.remoteClusterUrl.invalid && remoteClusterForm.controls.remoteClusterUrl.dirty">
+        <input cdsText
+               type="text"
+               id="remoteClusterUrl"
+               name="remoteClusterUrl"
+               placeholder="https://localhost:4202"
+               formControlName="remoteClusterUrl"
+               [invalid]="remoteClusterForm.controls.remoteClusterUrl.invalid && remoteClusterForm.controls.remoteClusterUrl.dirty">
         </cds-text-label>
         <ng-template #urlErrorTpl>
-          <span
-            class="invalid-feedback"
-            *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'required')"
-            i18n
-            >This field is required.</span
-          >
-          <span
-            class="invalid-feedback"
-            *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'invalidURL')"
-            i18n
-            >Please enter a valid URL.</span
-          >
-          <span
-            class="invalid-feedback"
-            *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'hubUrlCheck')"
-            i18n
-            >The hub cluster cannot be connected.</span
-          >
+          <span class="invalid-feedback"
+                *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'required')"
+                i18n>This field is required.
+          </span>
+          <span class="invalid-feedback"
+                *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'invalidURL')"
+                i18n>Please enter a valid URL.
+          </span>
+          <span class="invalid-feedback"
+                *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'hubUrlCheck')"
+                i18n>The hub cluster cannot be connected.
+          </span>
         </ng-template>
-         <cd-help-text>
-            Enter the Dashboard API URL. CLI: <b>{{ clusterApiUrlCmd }}</b>
-         </cd-help-text>
+        <cd-help-text>
+          Enter the Dashboard API URL. CLI: <b>{{ clusterApiUrlCmd }}</b>
+        </cd-help-text>
       </div>
 
-      <div class="form-item">
+      <div cdsRow
+           class="form-item">
         <cds-text-label
           cdRequiredField="Alias Name"
           [invalid]="remoteClusterForm.showError('clusterAlias', frm)"
                  placeholder="Name/Text to uniquely identify cluster"
                  formControlName="clusterAlias">
         </cds-text-label>
-
         <ng-template #aliasErrorTpl>
-          <span *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'required')" i18n>
+          <span *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'required')"
+                i18n>
             This field is required.
           </span>
-          <span *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'uniqueName')" i18n>
+          <span *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'uniqueName')"
+                i18n>
             The chosen alias name is already in use.
           </span>
         </ng-template>
       </div>
 
-      <div class="form-item" *ngIf="action !== 'edit'">
+      <div cdsRow
+           class="form-item"
+           *ngIf="action !== 'edit'">
         <cds-text-label
           cdRequiredField="Username"
           [invalid]="remoteClusterForm.showError('username', frm)"
                  name="username"
                  formControlName="username">
         </cds-text-label>
-
         <ng-template #usernameErrorTpl>
-          <span *ngIf="remoteClusterForm.showError('username', frm, 'required')" i18n>
+          <span *ngIf="remoteClusterForm.showError('username', frm, 'required')"
+                i18n>
             This field is required.
           </span>
-          <span *ngIf="remoteClusterForm.showError('username', frm, 'uniqueUrlandUser')" i18n>
+          <span *ngIf="remoteClusterForm.showError('username', frm, 'uniqueUrlandUser')"
+                i18n>
             A cluster with the chosen user is already connected.
           </span>
         </ng-template>
       </div>
 
-      <div class="form-item" *ngIf="action !== 'edit'">
+      <div cdsRow
+           class="form-item"
+           *ngIf="action !== 'edit'">
         <cds-password-label labelInputID="password"
                             label="Password..."
                             i18n>Password
-        <input cdsPassword
-               type="password"
-               placeholder="Password..."
-               id="password"
-               autocomplete="new-password"
-               formControlName="password"
-               >
+          <input cdsPassword
+                 type="password"
+                 placeholder="Password..."
+                 id="password"
+                 name="password"
+                 autocomplete="new-password"
+                 formControlName="password">
         </cds-password-label>
       </div>
 
-      <div class="form-item" *ngIf="action !== 'edit'">
-        <cds-select   formControlName="ttl"
-                      name="ttl"
-                      for="ttl"
-                      label="Login Expiration"
-                      id="ttl"
-                      i18n>
+      <div cdsRow
+           class="form-item"
+           *ngIf="action !== 'edit'">
+        <cds-select formControlName="ttl"
+                    name="ttl"
+                    for="ttl"
+                    label="Login Expiration"
+                    id="ttl"
+                    i18n>
           <option value="1">1 day</option>
           <option value="7">1 week</option>
           <option value="15">15 days</option>
         </cds-select>
       </div>
 
-      <div class="form-item">
+      <div cdsRow
+           class="form-item">
         <cds-checkbox
           formControlName="ssl"
           id="ssl"
         </cds-checkbox>
       </div>
 
-      <div class="form-item" *ngIf="remoteClusterForm.get('ssl').value">
+      <div cdsRow
+           class="form-item"
+           *ngIf="remoteClusterForm.get('ssl').value">
         <cds-text-label
           label="Certificate"
           [helperText]="sslHelpTpl"
           [invalid]="remoteClusterForm.showError('ssl_cert', frm)"
           [invalidText]="sslCertErrorTpl"
           i18n>
-          <div cdsStack="vertical" gap="3">
-          <textarea cdsTextArea
-                    id="ssl_cert"
-                    rows="5"
-                    formControlName="ssl_cert"></textarea>
-
-          <input type="file" (change)="fileUpload($event.target.files, 'ssl_cert')">
+          <div cdsStack="vertical"
+               gap="3">
+            <textarea cdsTextArea
+                      id="ssl_cert"
+                      rows="5"
+                      formControlName="ssl_cert"></textarea>
+            <input type="file"
+                   (change)="fileUpload($event.target.files, 'ssl_cert')">
           </div>
         </cds-text-label>
-
         <ng-template #sslHelpTpl>
           <span i18n>The SSL certificate in PEM format.</span>
         </ng-template>
-
         <ng-template #sslCertErrorTpl>
-          <span *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'required')" i18n>
+          <span *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'required')"
+                i18n>
             This field is required.
           </span>
-          <span *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'pattern')" i18n>
+          <span *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'pattern')"
+                i18n>
             Invalid SSL certificate.
           </span>
         </ng-template>
                             [submitText]="(action | titlecase) + ' ' + 'Cluster'"
                             wrappingClass="text-right"></cd-form-button-panel>
 
-    </form>
-  </ng-container>
-</div>
+    </div>
+  </div>
+</form>
index 71521de56f111d957e5f4ef3945f6795df1ae148..fada4f33f4feeddd55ed149abc57868c0e667dc9 100644 (file)
@@ -6,10 +6,11 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 import { NotificationService } from '~/app/shared/services/notification.service';
 import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe';
-import { DatePipe } from '@angular/common';
-import { ReactiveFormsModule } from '@angular/forms';
+import { CommonModule, DatePipe } from '@angular/common';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { RouterTestingModule } from '@angular/router/testing';
 import { SharedModule } from '~/app/shared/shared.module';
+import { CheckboxModule, GridModule, InputModule, SelectModule } from 'carbon-components-angular';
 
 describe('MultiClusterFormComponent', () => {
   let component: MultiClusterFormComponent;
@@ -19,7 +20,13 @@ describe('MultiClusterFormComponent', () => {
     await TestBed.configureTestingModule({
       imports: [
         SharedModule,
+        CommonModule,
+        FormsModule,
+        CheckboxModule,
+        GridModule,
         ReactiveFormsModule,
+        InputModule,
+        SelectModule,
         RouterTestingModule,
         HttpClientTestingModule,
         ToastrModule.forRoot()
index 7abe686107d8fe270ec47172ac8f5ba142583bb4..4abf5cbf34c113fbf14cc64bec71ab063bb11ce6 100644 (file)
@@ -6,8 +6,6 @@ import { Icons } from '~/app/shared/enum/icons.enum';
 import { CdTableAction } from '~/app/shared/models/cd-table-action';
 import { CdTableColumn } from '~/app/shared/models/cd-table-column';
 import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
-import { ModalService } from '~/app/shared/services/modal.service';
-import { MultiClusterFormComponent } from '../multi-cluster-form/multi-cluster-form.component';
 import { TableComponent } from '~/app/shared/datatable/table/table.component';
 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 import { Permissions } from '~/app/shared/models/permissions';
@@ -16,7 +14,7 @@ import { NotificationService } from '~/app/shared/services/notification.service'
 import { NotificationType } from '~/app/shared/enum/notification-type.enum';
 import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
 import { MultiCluster } from '~/app/shared/models/multi-cluster';
-import { ActivatedRoute, Router } from '@angular/router';
+import { Router } from '@angular/router';
 import { CookiesService } from '~/app/shared/services/cookie.service';
 import { Observable, Subscription } from 'rxjs';
 import { SettingsService } from '~/app/shared/api/settings.service';
@@ -62,11 +60,9 @@ export class MultiClusterListComponent extends ListWithDetails implements OnInit
     public actionLabels: ActionLabelsI18n,
     private notificationService: NotificationService,
     private authStorageService: AuthStorageService,
-    private modalService: ModalService,
     private cookieService: CookiesService,
     private settingsService: SettingsService,
     private cdsModalService: ModalCdsService,
-    private route: ActivatedRoute,
     private urlBuilder: URLBuilderService
   ) {
     super();
@@ -216,23 +212,6 @@ export class MultiClusterListComponent extends ListWithDetails implements OnInit
     }
   }
 
-  openRemoteClusterInfoModal(action: string) {
-    const initialState = {
-      clustersData: this.data,
-      action: action,
-      cluster: this.selection.first()
-    };
-    this.bsModalRef = this.modalService.show(MultiClusterFormComponent, initialState, {
-      size: 'xl'
-    });
-    this.bsModalRef.componentInstance.submitAction.subscribe(() => {
-      const currentRoute = this.router.url.split('?')[0];
-      this.multiClusterService.refreshMultiCluster(currentRoute);
-      this.checkClusterConnectionStatus();
-      this.multiClusterService.isClusterAdded(true);
-    });
-  }
-
   openDeleteClusterModal() {
     const cluster = this.selection.first();
     this.modalRef = this.cdsModalService.show(DeleteConfirmationModalComponent, {
@@ -277,7 +256,6 @@ export class MultiClusterListComponent extends ListWithDetails implements OnInit
 
   setExpandedRow(expandedRow: any) {
     super.setExpandedRow(expandedRow);
-    this.router.navigate(['performance-details'], { relativeTo: this.route });
   }
 
   refresh() {
index 708b9cbd63255c67bfca2a16d1302819bbb46fd5..2daec3654d65b20c732860cc85f25b80d84b740c 100644 (file)
@@ -3,36 +3,36 @@
                 *ngIf="managedByConfig$ | async as managedByConfig">
     <div class="row h-100 justify-content-center align-items-center">
       <div class="blank-page">
-        <i class="mx-auto d-block"
-           [ngClass]="[icons.large, icons.wrench]">
-        </i>
-      <div class="mt-4 text-center"
-           *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length === 0">
-        <h3 class="fw-bold">Connect Cluster</h3>
-        <h4 class="mt-3">Upgrade your current cluster to a multi-cluster setup effortlessly.
-            Click on the "Connect Cluster" button to begin the process.</h4>
-      </div>
-      <div class="mt-4 text-center"
-           *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length > 0">
-        <h4 class="mt-3">This cluster is already managed by cluster -
-          <a target="_blank"
-             [href]="managedByConfig['MANAGED_BY_CLUSTERS'][0]['url']">
-             {{ managedByConfig['MANAGED_BY_CLUSTERS'][0]['fsid'] }}
-            <i class="fa fa-external-link"></i>
-          </a>
-        </h4>
-      </div>
-      <div class="mt-4"
-           *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length === 0">
-        <div class="text-center">
-          <button class="btn btn-primary"
-                  (click)="openRemoteClusterInfoModal()">
-            <i class="mx-auto"
-               [ngClass]="icons.add">
-            </i> Connect Cluster
-          </button>
+        <svg cdsIcon="connect"
+             size="32"
+             class="mx-auto d-block"></svg>
+        <div class="mt-4 text-center"
+             *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length === 0">
+          <h3 class="fw-bold">Connect Cluster</h3>
+          <h4 class="mt-3">Upgrade your current cluster to a multi-cluster setup effortlessly.
+              Click on the "Connect Cluster" button to begin the process.</h4>
+        </div>
+        <div class="mt-4 text-center"
+             *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length > 0">
+          <h4 class="mt-3">This cluster is already managed by cluster -
+            <a target="_blank"
+               [href]="managedByConfig['MANAGED_BY_CLUSTERS'][0]['url']">
+               {{ managedByConfig['MANAGED_BY_CLUSTERS'][0]['fsid'] }}
+              <i class="fa fa-external-link"></i>
+            </a>
+          </h4>
+        </div>
+        <div class="mt-4"
+             *ngIf="managedByConfig['MANAGED_BY_CLUSTERS'].length === 0">
+          <div class="text-center">
+            <button class="btn btn-primary"
+                    (click)="openConnectClusterForm()">
+              <i class="mx-auto"
+                 [ngClass]="icons.add">
+              </i> Connect Cluster
+            </button>
+          </div>
         </div>
-      </div>
       </div>
     </div>
   </ng-container>
index 370c1ee7f1adca8a1f84732362986ee7e8613918..dcd232d9a7fd32faa79e4fcc56f34877414b0253 100644 (file)
@@ -3,8 +3,6 @@ import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { Observable, Subscription } from 'rxjs';
 import { MultiClusterService } from '~/app/shared/api/multi-cluster.service';
 import { Icons } from '~/app/shared/enum/icons.enum';
-import { ModalService } from '~/app/shared/services/modal.service';
-import { MultiClusterFormComponent } from './multi-cluster-form/multi-cluster-form.component';
 import { PrometheusService } from '~/app/shared/api/prometheus.service';
 import { CdTableColumn } from '~/app/shared/models/cd-table-column';
 import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
@@ -51,7 +49,7 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
     POOL_CAPACITY_UTILIZATION: 0,
     POOL_IOPS_UTILIZATION: 0,
     POOL_THROUGHPUT_UTILIZATION: 0,
-    TOTAL_CAPACITY: 0,
+    TOTAL_CAPACITY: [],
     USED_CAPACITY: 0,
     HOSTS: 0,
     POOLS: 0,
@@ -103,7 +101,6 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
   constructor(
     private multiClusterService: MultiClusterService,
     private settingsService: SettingsService,
-    private modalService: ModalService,
     private router: Router,
     private prometheusService: PrometheusService,
     private notificationService: NotificationService
@@ -213,21 +210,8 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
     }
   }
 
-  openRemoteClusterInfoModal() {
-    const initialState = {
-      action: 'connect'
-    };
-    this.bsModalRef = this.modalService.show(MultiClusterFormComponent, initialState, {
-      size: 'lg'
-    });
-    this.bsModalRef.componentInstance.submitAction.subscribe(() => {
-      this.loading = true;
-      setTimeout(() => {
-        const currentRoute = this.router.url.split('?')[0];
-        this.multiClusterService.refreshMultiCluster(currentRoute);
-        this.getPrometheusData(this.prometheusService.lastHourDateObject);
-      }, this.PROMETHEUS_DELAY);
-    });
+  openConnectClusterForm() {
+    this.router.navigate(['multi-cluster/manage-clusters/connect']);
   }
 
   getPrometheusData(selectedTime: any, selectedQueries?: string) {
index 26506d2bc893858f7f7aa4cbd7ba2aef01ea3329..612ef52ddc3707312e5e4be6133f0609ca48ad3f 100644 (file)
@@ -186,7 +186,7 @@ export class NavigationComponent implements OnInit, OnDestroy {
               const clusterUser = clusterDetails[USER];
 
               if (
-                clusterName === this.selectedCluster[USER] &&
+                clusterName === this.selectedCluster['name'] &&
                 clusterUser === this.selectedCluster[USER] &&
                 clusterDetails['cluster_alias'] !== 'local-cluster'
               ) {
index 697fc17d101887117dbe320408a633c5d8b00725..50db9d77e826cb81a5000ebfc871943d0032859c 100644 (file)
@@ -86,6 +86,7 @@ export enum Icons {
   idea = 'idea',
   userAccessLocked = 'user--access-locked', // User access locked
   chevronDown = 'chevron--down',
+  connect = 'connect',
   /* Icons for special effect */
   size16 = '16',
   size20 = '20',