From 71df2fc96a9396fe8b82729951b412f0891244f9 Mon Sep 17 00:00:00 2001 From: HazelGrant Date: Thu, 14 Mar 2024 12:20:28 -0400 Subject: [PATCH] Fixes cluster/filter search functionality --- .../active_jobs/performance_report.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/dashboard/app/javascript/active_jobs/performance_report.js b/apps/dashboard/app/javascript/active_jobs/performance_report.js index 6fe88c7ab6..9d0835713e 100644 --- a/apps/dashboard/app/javascript/active_jobs/performance_report.js +++ b/apps/dashboard/app/javascript/active_jobs/performance_report.js @@ -2,22 +2,27 @@ const activeJobsConfig = $('#active_jobs_config')[0].dataset; +var filter_id = null; +var cluster_id = null; + if (activeJobsConfig.filterId.includes('localStorage')) { - var filter_id = localStorage.getItem('jobfilter') - if (filter_id == null) { - filter_id = activeJobsConfig.filterId.match(/localStorage(.*)/)[1]; - } + filter_id = localStorage.getItem('jobfilter'); } else { - var filter_id = activeJobsConfig.filter_id; + filter_id = activeJobsConfig.filterId; }; +if (filter_id == null || filter_id == undefined) { + filter_id = activeJobsConfig.filterId.match(/localStorage(.*)/)[1]; +} + if (activeJobsConfig.clusterId.includes('localStorage')) { - var cluster_id = localStorage.getItem('jobcluster'); - if (cluster_id == null) { - cluster_id = 'all'; - } + cluster_id = localStorage.getItem('jobcluster'); } else { - var cluster_id = activeJobsConfig.cluster_id; + cluster_id = activeJobsConfig.clusterId; +} + +if (cluster_id == null || cluster_id == undefined) { + cluster_id = 'all'; } var performance_tracking_enabled = false;