Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 13 additions & 42 deletions src/WebAppDIRAC/WebApp/handler/PilotMonitorHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", [])
Expand All @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", {
{
name: "PilotJobReference",
},
{
name: "Owner",
},
{
name: "StatusIcon",
mapping: "Status",
Expand Down Expand Up @@ -177,7 +174,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", {
status: "Status",
computingElement: "Computing Element",
VO: "VO",
owner: "Owner",
};

var textFields = {
Expand All @@ -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", {
Expand Down Expand Up @@ -355,12 +350,6 @@ Ext.define("DIRAC.PilotMonitor.classes.PilotMonitor", {
BenchMark: {
dataIndex: "BenchMark",
},
Owner: {
dataIndex: "Owner",
properties: {
hidden: true,
},
},
VO: {
dataIndex: "VO",
},
Expand Down Expand Up @@ -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",
Expand Down