Updated Alarms

This commit is contained in:
gigi.mamaladze 2025-10-20 21:30:07 +04:00
parent 6de094d089
commit d76a3cfb7c

View File

@ -17,7 +17,7 @@
"system": { "system": {
"onStartup": { "onStartup": {
"config": { "config": {
"script": "\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Hit_List\").getChild(\"FlexContainer\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Historical_tab\").getChild(\"root\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30" "script": "\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Hit_List\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Historical_tab\").getChild(\"root\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30"
}, },
"scope": "G", "scope": "G",
"type": "script" "type": "script"
@ -1747,17 +1747,17 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1760665941637 1760981138025
], ],
"$ts": 1760665941636 "$ts": 1760981138025
}, },
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1760665941637 1760981138025
], ],
"$ts": 1760664141636 "$ts": 1760979338025
} }
}, },
"meta": { "meta": {
@ -1924,7 +1924,7 @@
} }
}, },
"props": { "props": {
"formattedValue": "Oct 17, 2025 5:22 AM", "formattedValue": "Oct 20, 2025 8:55 PM",
"minDate": { "minDate": {
"$": [ "$": [
"ts", "ts",
@ -2016,17 +2016,17 @@
} }
}, },
"props": { "props": {
"formattedValue": "Oct 17, 2025 5:52 AM", "formattedValue": "Oct 20, 2025 9:25 PM",
"style": { "style": {
"margin": 15 "margin": 15
}, },
"value": { "value": {
"$": [ "$": [
"ts", "ts",
201, 192,
1760665941637 1760981138025
], ],
"$ts": 1760665941636 "$ts": 1760981138025
} }
}, },
"scripts": { "scripts": {
@ -3315,7 +3315,7 @@
"component": { "component": {
"onActionPerformed": { "onActionPerformed": {
"config": { "config": {
"script": "\n\tfrom datetime import datetime\n\t\n\ttry:\n\t data \u003d self.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\").props.data\n\t\n\t column_order \u003d [\n\t \"FirstTimestamp\",\n\t \"LastTimestamp\", \n\t \"Count\",\n\t \"Duration\",\n\t \"Priority\",\n\t \"Location\",\n\t \"Description\",\n\t \"Tag\"\n\t ]\n\t\n\t csv_content \u003d \",\".join(column_order) + \"\\n\"\n\t \n\t def unwrap(v):\n\t if hasattr(v, \u0027value\u0027):\n\t return str(v.value)\n\t return str(v)\n\t\n\t if data and len(data) \u003e 0:\n\t for item in data:\n\t row_data \u003d []\n\t for col in column_order:\n\t if col in item:\n\t cell \u003d item[col]\n\t if isinstance(cell, dict) and \"value\" in cell:\n\t raw_value \u003d cell[\"value\"]\n\t else:\n\t raw_value \u003d cell\n\t else:\n\t raw_value \u003d \"\"\n\t\n\t processed_value \u003d unwrap(raw_value).replace(\",\", \";\")\n\t row_data.append(processed_value)\n\t\n\t csv_content +\u003d \",\".join(row_data) + \"\\n\"\n\t else:\n\t csv_content +\u003d \"No alarms in current view\\n\"\n\t\n\texcept Exception as e:\n\t system.perspective.print(\"Export Error: \" + str(e))\n\t csv_content \u003d \"Export failed\\n\"\n\t\n\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\tsystem.perspective.download(\"hitList_alarms.csv\", csv_bytes)" "script": "\t\t\n from datetime import datetime\n \n try:\n table \u003d self.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\")\n filtered_data \u003d table.props.filter.results.data\n data \u003d filtered_data if filtered_data and len(filtered_data) \u003e 0 else table.props.data\n \n column_order \u003d [\n \"FirstTimestamp\",\n \"LastTimestamp\",\n \"Count\",\n \"Duration\",\n \"Priority\",\n \"Location\",\n \"Description\",\n \"Tag\"\n ]\n \n csv_content \u003d \",\".join(column_order) + \"\\n\"\n \n def unwrap(v):\n if hasattr(v, \"value\"):\n return str(v.value)\n return str(v)\n \n if data and len(data) \u003e 0:\n for item in data:\n row_data \u003d []\n for col in column_order:\n cell \u003d item.get(col, \"\")\n if isinstance(cell, dict) and \"value\" in cell:\n raw_value \u003d cell[\"value\"]\n else:\n raw_value \u003d cell\n \n processed_value \u003d unwrap(raw_value).replace(\",\", \";\")\n row_data.append(processed_value)\n \n csv_content +\u003d \",\".join(row_data) + \"\\n\"\n else:\n csv_content +\u003d \"No alarms in current view\\n\"\n \n except Exception as e:\n system.perspective.print(\"Export Error: \" + str(e))\n csv_content \u003d \"Export failed\\n\"\n \n csv_bytes \u003d csv_content.encode(\"utf-8\")\n system.perspective.download(\"hitList_alarms.csv\", csv_bytes)"
}, },
"scope": "G", "scope": "G",
"type": "script" "type": "script"
@ -3489,17 +3489,17 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1760668996778 1760981138025
], ],
"$ts": 1760668996778 "$ts": 1760981138025
}, },
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1760668996778 1760981138025
], ],
"$ts": 1760667196778 "$ts": 1760979338025
} }
}, },
"meta": { "meta": {
@ -3765,10 +3765,10 @@
"value": { "value": {
"$": [ "$": [
"ts", "ts",
201, 192,
1760668996778 1760981138025
], ],
"$ts": 1760668996778 "$ts": 1760981138025
} }
}, },
"scripts": { "scripts": {
@ -5908,6 +5908,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"