From: Pere Diaz Bou Date: Wed, 17 May 2023 16:17:50 +0000 (+0200) Subject: mgr/dashboard: filte hosts by services X-Git-Tag: v17.2.7~346^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba0e509ce1572a4bd0d04df75bb7c13b13300609;p=ceph.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 69a942e56d28..297085aca972 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 c6c9369acfc6..3fc62a9d6738 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 );