From: Aashish Sharma Date: Wed, 17 May 2023 13:40:35 +0000 (+0530) Subject: mgr/dashboard: show the host's IP address on Hosts page X-Git-Tag: v17.2.7~346^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=06b9e69a6cee7844f647028445f3b7d489928129;p=ceph.git mgr/dashboard: show the host's IP address on Hosts page Fixes: https://tracker.ceph.com/issues/61222 Signed-off-by: Aashish Sharma (cherry picked from commit ef9d53027ad472d8ee5e0e8524fce6ce7a40af89) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html index 297085aca972..1aeaef1f95fb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html @@ -61,6 +61,17 @@ + + + {{ row.hostname }} +
+ + ({{ row.addr }}) + +
+
    diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts index 03a61e0834d0..2e76d1f43ed6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts @@ -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', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index b7cad7e3c337..3bdda8aca3ef 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -56,6 +56,8 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit orchTmpl: TemplateRef; @ViewChild('flashTmpl', { static: true }) flashTmpl: TemplateRef; + @ViewChild('hostNameTpl', { static: true }) + hostNameTpl: TemplateRef; @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`,