]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Fri, 19 May 2023 08:46:31 +0000 (14:16 +0530)
Fixes: https://tracker.ceph.com/issues/61222
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
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 69a942e56d2854577d7b829f388a02aac7999bb5..0fbdbd7d1b5867a475f230e745474f328635cc3e 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 6089965fc748762ebb7b68bbeb6a4fee64080e57..3cba750f084129d346baf87ed76fe1602033961a 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`,