From cc69ef4f2bba04e888daec0952bbd99d6afbce21 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 19 May 2025 14:22:42 +0200 Subject: [PATCH] fix: removed Owner from PilotMonitor --- .../WebApp/handler/PilotMonitorHandler.py | 55 +++++-------------- .../PilotMonitor/classes/PilotMonitor.js | 13 +---- 2 files changed, 14 insertions(+), 54 deletions(-) diff --git a/src/WebAppDIRAC/WebApp/handler/PilotMonitorHandler.py b/src/WebAppDIRAC/WebApp/handler/PilotMonitorHandler.py index 6f29b1b4..cc92073e 100644 --- a/src/WebAppDIRAC/WebApp/handler/PilotMonitorHandler.py +++ b/src/WebAppDIRAC/WebApp/handler/PilotMonitorHandler.py @@ -64,37 +64,19 @@ def web_getSelectionData(self): if (result := WebAppClient().getPilotMonitorSelectors())["OK"]: result = result["Value"] - if "Status" in result and len(result["Status"]) > 0: - status = [] - for i in result["Status"]: - status.append([str(i)]) - else: - status = [["Nothing to display"]] - callback["status"] = status - - if "GridType" in result and len(result["GridType"]) > 0: - gridtype = [] - for i in result["GridType"]: - gridtype.append([str(i)]) - else: - gridtype = [["Nothing to display"]] - callback["gridtype"] = gridtype - - if "VO" in result and len(result["VO"]) > 0: - VO = [] - for i in result["VO"]: - VO.append([str(i)]) - else: - VO = [["Nothing to display"]] - callback["VO"] = VO - - if "DestinationSite" in result and len(result["DestinationSite"]) > 0: - ce = [] - for i in result["DestinationSite"]: - ce.append([str(i)]) - else: - ce = [["Nothing to display"]] - callback["computingElement"] = ce + # Define the mapping of result keys to callback keys + fields = [ + ("Status", "status"), + ("GridType", "gridtype"), + ("VO", "VO"), + ("DestinationSite", "computingElement"), + ] + for result_key, callback_key in fields: + if result_key in result and len(result[result_key]) > 0: + values = [[str(i)] for i in result[result_key]] + else: + values = [["Nothing to display"]] + callback[callback_key] = values if "GridSite" in result and len(result["GridSite"]) > 0: tier1 = gConfig.getValue("/WebApp/PreferredSites", []) @@ -108,13 +90,6 @@ def web_getSelectionData(self): else: site = [["Error during RPC call"]] callback["site"] = site - if "Owner" in result and len(result["Owner"]) > 0: - owner = [] - for i in result["Owner"]: - owner.append([str(i)]) - else: - owner = [["Nothing to display"]] - callback["owner"] = owner return callback @@ -140,10 +115,6 @@ def __request(self): if ce: req["DestinationSite"] = ce - owner = list(json.loads(self.get_argument("owner", "[]"))) - if owner: - req["Owner"] = owner - VO = list(json.loads(self.get_argument("VO", "[]"))) if VO: req["VO"] = VO diff --git a/src/WebAppDIRAC/WebApp/static/DIRAC/PilotMonitor/classes/PilotMonitor.js b/src/WebAppDIRAC/WebApp/static/DIRAC/PilotMonitor/classes/PilotMonitor.js index abda8f4c..4b8644a0 100755 --- a/src/WebAppDIRAC/WebApp/static/DIRAC/PilotMonitor/classes/PilotMonitor.js +++ b/src/WebAppDIRAC/WebApp/static/DIRAC/PilotMonitor/classes/PilotMonitor.js @@ -114,9 +114,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", { { name: "PilotJobReference", }, - { - name: "Owner", - }, { name: "StatusIcon", mapping: "Status", @@ -177,7 +174,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", { status: "Status", computingElement: "Computing Element", VO: "VO", - owner: "Owner", }; var textFields = { @@ -192,7 +188,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", { ["status", "status"], ["computingElement", "computingElement"], ["VO", "VO"], - ["owner", "owner"], ]; me.leftPanel = Ext.create("Ext.dirac.utils.DiracBaseSelector", { @@ -355,12 +350,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", { BenchMark: { dataIndex: "BenchMark", }, - Owner: { - dataIndex: "Owner", - properties: { - hidden: true, - }, - }, VO: { dataIndex: "VO", }, @@ -425,7 +414,7 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", { mode: "local", store: new Ext.data.ArrayStore({ fields: ["category"], - data: [["Status"], ["Site"], ["Computing Element"], ["VO"], ["Owner"]], + data: [["Status"], ["Site"], ["Computing Element"], ["VO"]], }), triggerAction: "all", value: "Status",