]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: small fixes to directories view
authorNizamudeen A <nia@redhat.com>
Thu, 7 Dec 2023 17:28:52 +0000 (22:58 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 16 Jan 2024 06:41:52 +0000 (12:11 +0530)
Increased the precedence for Directories
Expand the node by default and select them as well

Fixes: https://tracker.ceph.com/issues/63754
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 4eb42ff15db14680c0798ceb752fa6578b76fb92)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.scss
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.html

index ce6cc71c5ea498518bd8f6a7feb02ba3afb815e9..c4c4728bab5da21a5423c00c61180172ef8de226 100644 (file)
@@ -10,7 +10,7 @@
              [class.fa-spin]="loadingIndicator"></i>
         </button>
       </div>
-      <div class="card-body">
+      <div class="card-body card-tree">
         <tree-root *ngIf="nodes"
                    [nodes]="nodes"
                    [options]="treeOptions">
index 841d635b1a0957c1b8d067952397b784ff3589ac..387a21b6f5769b158a75a76728791c6b29fd9e4d 100644 (file)
@@ -293,6 +293,10 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
         this.updateTree();
         resolve(this.getChildren(path));
         this.setLoadingIndicator(path, false);
+
+        if (path === '/' && this.treeComponent.treeModel.activeNodes?.length === 0) {
+          this.selectNode(this.getNode('/'));
+        }
       });
     });
   }
@@ -318,6 +322,13 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
     if (!subTree) {
       this.getSubTree(dir.parent);
     }
+
+    if (dir.path === '/volumes') {
+      const innerNode = this.treeComponent.treeModel.getNodeById('/volumes');
+      if (innerNode) {
+        innerNode.expand();
+      }
+    }
     return {
       name: dir.name,
       id: dir.path,
index 6a50ad2e07869059868e7f2b06df832274e099dc..e032634346326483ebaef4dcf43dfa644bd0ce80 100644 (file)
         </cd-cephfs-detail>
       </ng-template>
     </ng-container>
+    <ng-container ngbNavItem="directories">
+      <a ngbNavLink
+         i18n>Directories</a>
+      <ng-template ngbNavContent>
+        <cd-cephfs-directories [id]="id"></cd-cephfs-directories>
+      </ng-template>
+    </ng-container>
     <ng-container ngbNavItem="subvolumes">
       <a ngbNavLink
          i18n>Subvolumes</a>
         </cd-cephfs-clients>
       </ng-template>
     </ng-container>
-    <ng-container ngbNavItem="directories">
-      <a ngbNavLink
-         i18n>Directories</a>
-      <ng-template ngbNavContent>
-        <cd-cephfs-directories [id]="id"></cd-cephfs-directories>
-      </ng-template>
-    </ng-container>
     <ng-container ngbNavItem="performance-details">
       <a ngbNavLink
          i18n>Performance Details</a>