From: Pere Diaz Bou Date: Wed, 17 May 2023 16:17:50 +0000 (+0200) Subject: mgr/dashboard: filte hosts by services X-Git-Tag: v18.1.2~81^2~21 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c721bb559247b0a6a947085d0b9d52ab05d90860;p=ceph-ci.git mgr/dashboard: filte hosts by services Fixes: https://tracker.ceph.com/issues/61242 Signed-off-by: Pere Diaz Bou (cherry picked from commit 510a582fa8bd04125a565afe12d245fc4dadff2f) --- 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 69a942e56d2..297085aca97 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 @@ -11,6 +11,7 @@ columnMode="flex" (fetchData)="getHosts($event)" selectionType="single" + [searchableObjects]="true" [hasDetails]="hasTableDetails" (setExpandedRow)="setExpandedRow($event)" (updateSelection)="updateSelection($event)" diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index c6c9369acfc..3fc62a9d673 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -879,12 +879,6 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O return false; } - if (_.isArray(cellValue)) { - cellValue = cellValue.join(' '); - } else if (_.isNumber(cellValue) || _.isBoolean(cellValue)) { - cellValue = cellValue.toString(); - } - if (_.isObjectLike(cellValue)) { if (this.searchableObjects) { cellValue = JSON.stringify(cellValue); @@ -893,6 +887,12 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O } } + if (_.isArray(cellValue)) { + cellValue = cellValue.join(' '); + } else if (_.isNumber(cellValue) || _.isBoolean(cellValue)) { + cellValue = cellValue.toString(); + } + return cellValue.toLowerCase().indexOf(searchTerm) !== -1; }).length > 0 );