Giving same priority colors in the shelved table and fixed unshelving UI bug

This commit is contained in:
Salijoghli 2025-06-11 14:32:11 +04:00
parent b0b2751ad7
commit ef264bbed4

View File

@ -493,11 +493,10 @@
], ],
"custom": { "custom": {
"priorities": { "priorities": {
"critical": false, "diagnostic": true,
"diagnostic": false, "high": true,
"high": false, "low": true,
"low": false, "medium": true
"medium": false
} }
}, },
"events": { "events": {
@ -928,80 +927,6 @@
"filters": { "filters": {
"active": { "active": {
"results": { "results": {
"data": [
{
"ackNotes": "",
"ackPipeline": "",
"ackTime": "",
"ackUser": "",
"activePipeline": "",
"activeTime": "2025-06-10 14:02:45.721+0400",
"clearPipeline": "",
"clearTime": "",
"deadband": "0.0",
"displayPath": "System/wbsckt_logging/Alarm",
"eventId": "8ef553ea-ce84-47ca-9a64-66227511f6dd",
"eventTime": "2025-06-10 14:02:45.721+0400",
"eventValue": "true",
"isAcked": "false",
"isActive": "true",
"isClear": "false",
"label": "Alarm",
"name": "Alarm",
"notes": "",
"priority": "Critical",
"source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/wbsckt_logging:/alm:Alarm",
"state": "Active, Unacknowledged"
},
{
"ackNotes": "",
"ackPipeline": "",
"ackTime": "",
"ackUser": "",
"activePipeline": "",
"activeTime": "2025-06-10 14:11:27.172+0400",
"clearPipeline": "",
"clearTime": "",
"deadband": "0.0",
"displayPath": "System/DBConnected/NEEEWWWW",
"eventId": "91a21a7a-8eae-4985-ab42-7285e5205427",
"eventTime": "2025-06-10 14:11:27.172+0400",
"eventValue": "true",
"isAcked": "false",
"isActive": "true",
"isClear": "false",
"label": "NEEEWWWW",
"name": "NEEEWWWW",
"notes": "",
"priority": "High",
"source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/DBConnected:/alm:NEEEWWWW",
"state": "Active, Unacknowledged"
},
{
"ackNotes": "",
"ackPipeline": "",
"ackTime": "",
"ackUser": "",
"activePipeline": "",
"activeTime": "2025-06-10 14:23:42.047+0400",
"clearPipeline": "",
"clearTime": "",
"deadband": "0.0",
"displayPath": "System/close_socket/papapapa",
"eventId": "c51c44cb-2f8e-4cfd-ba0f-c2b862a1744d",
"eventTime": "2025-06-10 14:23:42.047+0400",
"eventValue": "true",
"isAcked": "false",
"isActive": "true",
"isClear": "false",
"label": "papapapa",
"name": "papapapa",
"notes": "",
"priority": "Diagnostic",
"source": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa",
"state": "Active, Unacknowledged"
}
],
"enabled": true "enabled": true
}, },
"states": { "states": {
@ -1093,7 +1018,7 @@
"component": { "component": {
"onActionPerformed": { "onActionPerformed": {
"config": { "config": {
"script": "\tshelved_alarm_table \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\")\n\t\n\tselected_alarms \u003d shelved_alarm_table.props.selection.data\n\tif(len(selected_alarms)\u003d\u003d0):\n\t\treturn\n\t\n\tfor alarm in selected_alarms:\n\t\tsystem.alarm.unshelve(alarm.path)\n\t\t\n\tshelved_alarm_table.props.data \u003d []" "script": "\n\tselected_alarms \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\").props.selection.data\n\tif len(selected_alarms) \u003d\u003d 0:\n\t\treturn\n\t\n\t# Unshelve selected alarms\n\tfor alarm in selected_alarms:\n\t\tsystem.alarm.unshelve(alarm[\u0027path\u0027])\n\t\t\n\tpaths_to_remove \u003d {alarm[\u0027path\u0027] for alarm in selected_alarms}\n\t\n\tshelved_alarms \u003d self.parent.parent.parent.parent.parent.getChild(\"TabContainer\").custom.shelvedAlarms\n\t\t\n\tif shelved_alarms is not None:\n\t\tremaining_data \u003d [a for a in shelved_alarms if a[\u0027path\u0027] not in paths_to_remove]\n\t\t\n\tself.parent.parent.parent.parent.parent.getChild(\"TabContainer\").custom.shelvedAlarms \u003d remaining_data"
}, },
"scope": "G", "scope": "G",
"type": "script" "type": "script"
@ -1168,9 +1093,6 @@
{ {
"children": [ "children": [
{ {
"custom": {
"shelvedAlarmsData": null
},
"meta": { "meta": {
"name": "AlarmsTable" "name": "AlarmsTable"
}, },
@ -1184,6 +1106,12 @@
"config": { "config": {
"path": "...../TabContainer.custom.shelvedAlarms" "path": "...../TabContainer.custom.shelvedAlarms"
}, },
"transforms": [
{
"code": " data \u003d []\n for row in value: \n keys \u003d row.keys() \n if row[\"priority\"] \u003d\u003d \"High\": \n style \u003d {\"backgroundColor\": \"#fd6059\"} \n elif row[\"priority\"] \u003d\u003d \"Low\": \n style \u003d {\"backgroundColor\": \"#fafa6c\"} \n elif row[\"priority\"] \u003d\u003d \"Diagnostic\": \n style \u003d {\"backgroundColor\": \"#5da0f9\"} \n elif row[\"priority\"] \u003d\u003d \"Medium\": \n style \u003d {\"backgroundColor\": \"#fca25f\"} \n elif row[\"priority\"] \u003d\u003d \"Critical\": \n style \u003d {\"backgroundColor\": \"#c86462\"} \n else:\n style \u003d {\"backgroundColor\": \"\"}\n \n formatted_rows \u003d [{\"value\": v, \"style\": style} for v in row.values()]\n \n row_dict \u003d dict(zip(keys, formatted_rows))\n data.append(row_dict)\n return data ",
"type": "script"
}
],
"type": "property" "type": "property"
} }
}, },
@ -1236,6 +1164,7 @@
"align": "center", "align": "center",
"justify": "left", "justify": "left",
"style": { "style": {
"backgroundColor": "#FFFEFE",
"classes": "" "classes": ""
}, },
"title": "" "title": ""
@ -1665,7 +1594,6 @@
"text": "No Shelved Alarms" "text": "No Shelved Alarms"
} }
}, },
"enableFooter": true,
"selection": { "selection": {
"mode": "multiple interval" "mode": "multiple interval"
} }
@ -1703,7 +1631,7 @@
"children": [ "children": [
{ {
"custom": { "custom": {
"SetFilter": true "SetFilter": false
}, },
"events": { "events": {
"component": { "component": {
@ -1806,17 +1734,17 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137258 1749561376741
], ],
"$ts": 1749545137258 "$ts": 1749561376741
}, },
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137258 1749561376741
], ],
"$ts": 1749543337258 "$ts": 1749559576741
} }
}, },
"meta": { "meta": {
@ -1989,7 +1917,7 @@
} }
}, },
"props": { "props": {
"formattedValue": "Jun 10, 2025 12:15 PM", "formattedValue": "Jun 10, 2025 4:46 PM",
"style": { "style": {
"margin": 15 "margin": 15
} }
@ -2074,7 +2002,7 @@
} }
}, },
"props": { "props": {
"formattedValue": "Jun 10, 2025 12:45 PM", "formattedValue": "Jun 10, 2025 5:16 PM",
"maxDate": { "maxDate": {
"$": [ "$": [
"ts", "ts",
@ -2089,10 +2017,10 @@
"value": { "value": {
"$": [ "$": [
"ts", "ts",
192, 201,
1749545137258 1749561376741
], ],
"$ts": 1749545137258 "$ts": 1749561376741
} }
}, },
"scripts": { "scripts": {
@ -2216,13 +2144,14 @@
} }
], ],
"custom": { "custom": {
"ShowFilters": true "ShowFilters": false
}, },
"meta": { "meta": {
"name": "Filters" "name": "Filters"
}, },
"position": { "position": {
"basis": "180px", "basis": "180px",
"display": false,
"grow": 1, "grow": 1,
"shrink": 0 "shrink": 0
}, },
@ -2277,22 +2206,22 @@
], ],
"$ts": 1747562336635 "$ts": 1747562336635
}, },
"priority_filters": "", "priority_filters": "low",
"time_from_filter": { "time_from_filter": {
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137263 1749634338103
], ],
"$ts": 1749543337258 "$ts": 1749559576741
}, },
"time_to_filter": { "time_to_filter": {
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137263 1749634338103
], ],
"$ts": 1749545137258 "$ts": 1749561376741
} }
}, },
"meta": { "meta": {
@ -3092,158 +3021,6 @@
"filter": { "filter": {
"enabled": true, "enabled": true,
"results": { "results": {
"data": [
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:00:40",
"EndTimestamp": 1749545054000,
"ID": 194,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749545014000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749545012000,
"ID": 191,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544890000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544888000,
"ID": 188,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544766000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544764000,
"ID": 185,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544642000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544640000,
"ID": 182,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544518000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544516000,
"ID": 179,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544394000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544392000,
"ID": 176,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544270000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:03",
"EndTimestamp": 1749544268000,
"ID": 173,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544145000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544143000,
"ID": 170,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749544021000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749544019000,
"ID": 167,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543897000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749543895000,
"ID": 164,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543773000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:03",
"EndTimestamp": 1749543771000,
"ID": 161,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543648000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:00:15",
"EndTimestamp": 1749543646000,
"ID": 158,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543631000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:02",
"EndTimestamp": 1749543629000,
"ID": 155,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543507000,
"Tag": "alm:papapapa"
},
{
"Description": "alm:papapapa - papapapa",
"Duration": "00:02:04",
"EndTimestamp": 1749543505000,
"ID": 152,
"MCM": "System",
"Priority": "Low",
"StartTimestamp": 1749543381000,
"Tag": "alm:papapapa"
}
],
"enabled": true "enabled": true
} }
}, },
@ -3255,12 +3032,12 @@
"data": [ "data": [
{ {
"Description": "alm:papapapa - papapapa", "Description": "alm:papapapa - papapapa",
"Duration": "00:01:45", "Duration": "00:00:09",
"EndTimestamp": 1749547975000, "EndTimestamp": 1749565341000,
"ID": 293, "ID": 668,
"MCM": "System", "MCM": "System",
"Priority": "Low", "Priority": "Diagnostic",
"StartTimestamp": 1749547870000, "StartTimestamp": 1749565332000,
"Tag": "alm:papapapa" "Tag": "alm:papapapa"
} }
], ],
@ -3385,22 +3162,22 @@
"custom": { "custom": {
"download_in_progress": true, "download_in_progress": true,
"enable_timeout": false, "enable_timeout": false,
"priority_filters": "", "priority_filters": "low",
"time_from_filter": { "time_from_filter": {
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137263 1749634338103
], ],
"$ts": 1749543337258 "$ts": 1749559576741
}, },
"time_to_filter": { "time_to_filter": {
"$": [ "$": [
"ts", "ts",
192, 192,
1749545137263 1749634338103
], ],
"$ts": 1749545137258 "$ts": 1749561376741
}, },
"type_filters": null "type_filters": null
}, },
@ -3636,36 +3413,7 @@
} }
], ],
"custom": { "custom": {
"shelvedAlarms": [ "shelvedAlarms": []
{
"activeTime": "2025-06-10 13:46:26",
"expirationTime": "Tue Jun 10 14:55:04 GET 2025",
"name": "Alarm",
"path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:MCM01/hello world:/alm:Alarm",
"priority": "Diagnostic"
},
{
"activeTime": "2025-06-10 14:23:42",
"expirationTime": "Tue Jun 10 14:55:04 GET 2025",
"name": "papapapa",
"path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/close_socket:/alm:papapapa",
"priority": "Diagnostic"
},
{
"activeTime": "2025-06-10 14:11:27",
"expirationTime": "Tue Jun 10 14:55:04 GET 2025",
"name": "NEEEWWWW",
"path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/DBConnected:/alm:NEEEWWWW",
"priority": "High"
},
{
"activeTime": "2025-06-10 14:02:45",
"expirationTime": "Tue Jun 10 14:55:04 GET 2025",
"name": "Alarm",
"path": "prov:MTN6_SCADA_TAG_PROVIDER:/tag:System/wbsckt_logging:/alm:Alarm",
"priority": "Critical"
}
]
}, },
"meta": { "meta": {
"name": "TabContainer" "name": "TabContainer"
@ -3686,6 +3434,7 @@
"contentStyle": { "contentStyle": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"
}, },
"currentTabIndex": 1,
"menuType": "modern", "menuType": "modern",
"style": { "style": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"