From beff8eb10e87db27c8734fa49653e28911e5bcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Ros?= Date: Thu, 30 Mar 2023 12:37:26 -0700 Subject: [PATCH] Add custom fields to search in dashboard --- src/components/AgentTable.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue index e60a93b..5ce7718 100644 --- a/src/components/AgentTable.vue +++ b/src/components/AgentTable.vue @@ -373,6 +373,7 @@ export default { "local_ips", "make_model", "physical_disks", + "custom_fields" ]; // quasar filter only does visible columns so this is a hack to add hidden columns we want to filter // originally I was modifying cols directly but this led to phantom colum so doing it this way now @@ -432,7 +433,11 @@ export default { // Normal text filter return allColumns.some((col) => { - const val = cellValue(col, row) + ""; + let valObj = cellValue(col, row); + if (Array.isArray(valObj)) { + valObj = valObj.map((item) => item.value ? item.value : item); + } + const val = valObj + ""; const haystack = val === "undefined" || val === "null" ? "" : val.toLowerCase(); return haystack.indexOf(search) !== -1;