]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: show the host's IP address on Hosts page
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Wed, 17 May 2023 13:40:35 +0000 (19:10 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 26 May 2023 06:30:58 +0000 (12:00 +0530)
Fixes: https://tracker.ceph.com/issues/61222
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit ef9d53027ad472d8ee5e0e8524fce6ce7a40af89)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts

index 297085aca972e8a3c1cf2cfadf9b469f63ddb1e2..1aeaef1f95fb3758fbc47dbae7614e6043ff692a 100644 (file)
   </span>
 </ng-template>
 
+<ng-template #hostNameTpl
+             let-row="row">
+  <span [ngClass]="row">
+    {{ row.hostname }}
+  </span><br>
+  <span class="text-muted fst-italic"
+        *ngIf="row.addr">
+    ({{ row.addr }})
+  </span>
+</ng-template>
+
 <ng-template #maintenanceConfirmTpl>
   <div *ngFor="let msg of errorMessage; let last=last">
     <ul *ngIf="!last || errorMessage.length === '1'">
index 03a61e0834d034c2f2ca1d1edd3e90e935f307e8..2e76d1f43ed63645d9e1497d9883b76690ac9bd1 100644 (file)
@@ -114,7 +114,7 @@ describe('HostsComponent', () => {
     const spans = fixture.debugElement.nativeElement.querySelectorAll(
       '.datatable-body-cell-label span'
     );
-    expect(spans[0].textContent).toBe(hostname);
+    expect(spans[0].textContent.trim()).toBe(hostname);
   });
 
   it('should show the exact count of the repeating daemons', () => {
index b7cad7e3c33780e9a1557987245a7dc37bcdc2cc..3bdda8aca3ef4d79ddfd2e35ed241969f105977a 100644 (file)
@@ -56,6 +56,8 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   orchTmpl: TemplateRef<any>;
   @ViewChild('flashTmpl', { static: true })
   flashTmpl: TemplateRef<any>;
+  @ViewChild('hostNameTpl', { static: true })
+  hostNameTpl: TemplateRef<any>;
 
   @Input()
   hiddenColumns: string[] = [];
@@ -193,7 +195,8 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
       {
         name: $localize`Hostname`,
         prop: 'hostname',
-        flexGrow: 1
+        flexGrow: 1,
+        cellTemplate: this.hostNameTpl
       },
       {
         name: $localize`Service Instances`,