4189 lines
189 KiB
JSON
4189 lines
189 KiB
JSON
{
|
|
"custom": {
|
|
"activityLogger": {
|
|
"alt_pageid": "alarms",
|
|
"pageid": "alarms/ActiveAlarms",
|
|
"start_time": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1748425447154
|
|
],
|
|
"$ts": 1748425447154
|
|
}
|
|
}
|
|
},
|
|
"params": {
|
|
"page_name": "Alarms-RealTime"
|
|
},
|
|
"propConfig": {
|
|
"custom.activityLogger": {
|
|
"persistent": true
|
|
},
|
|
"params.page_name": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 1080,
|
|
"width": 1920
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label_0"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpriority \u003d \u0027critical\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\"\n\n"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_4"
|
|
},
|
|
"position": {
|
|
"basis": "125px"
|
|
},
|
|
"propConfig": {
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({this.custom.background_on}\u003d\"true\",1,0)"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/Critical"
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": "Buttons/PB_1"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"color": "#FFFFFF",
|
|
"path": "material/error"
|
|
}
|
|
},
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Critical"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-filters",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background\n\t",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"custom": {
|
|
"Severity": "High",
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpriority \u003d \u0027high\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\""
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_0"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"propConfig": {
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": ""
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/High"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "Alarms-Styles/Alt-Colours/High"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/priority_high"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "High"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-filters",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_1"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_4"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"Severity": "Medium",
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpriority \u003d \u0027medium\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\""
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_1"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"propConfig": {
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Buttons/PB_1",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": ""
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/Medium"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "Alarms-Styles/Alt-Colours/Medium"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/priority_high"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Medium"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-filters",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_2"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"Severity": "Low",
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpriority \u003d \u0027low\u0027\n\t# Copy and toggle the filter\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\""
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_2"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"propConfig": {
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Buttons/PB_1",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": ""
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/Low"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "Alarms-Styles/Alt-Colours/Low"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/low_priority"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Low"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-filters",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_3"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpriority \u003d \u0027diagnostic\u0027\n\n\tpriorities \u003d dict(self.parent.custom.priorities)\n\tpriorities[priority] \u003d not priorities.get(priority, False)\n\tself.parent.custom.priorities \u003d priorities\n\t\n\tself.custom.background_on \u003d \"true\" if priorities[priority] else \"false\""
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_3"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"propConfig": {
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({this.custom.background_on}\u003d\"false\",0,\r\nif({session.custom.colours.colour_impaired},2,1))"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Buttons/PB_1",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": ""
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/Diagnostic"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "Alarms-Styles/Alt-Colours/Diagnostic"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/warning"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Diagnostic"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-filters",
|
|
"pageScope": true,
|
|
"script": "\t# implement your handler here\n\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"reset\"]\n\tif severity \u003d\u003d \"false\":\n\t\tbackground \u003d \"false\"\n\telse:\n\t\tbackground \u003d \"true\"\n\tself.custom.background_on \u003d background",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"custom": {
|
|
"priorities": {
|
|
"diagnostic": false,
|
|
"high": false,
|
|
"low": false,
|
|
"medium": false
|
|
}
|
|
},
|
|
"events": {
|
|
"system": {
|
|
"onStartup": {
|
|
"config": {
|
|
"script": "\tself.custom.priorities \u003d {\n\t \"diagnostic\": False,\n\t \"low\": False,\n\t \"medium\": False,\n\t \"high\": False,\n\t}"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "700px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"padding": 0
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "20px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"Severity": "Critical",
|
|
"background_on": "false"
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpayload \u003d {}\n\tfilter_on \u003d \"false\"\n\tpayload[\"reset\"] \u003d filter_on\n\tsystem.perspective.sendMessage(\"reset-filters\", payload \u003dpayload, scope \u003d \"page\")\n\tdefault_priorities \u003d {\n\t \"diagnostic\": False,\n\t \"low\": False,\n\t \"medium\": False,\n\t \"high\": False,\n\t \"critical\": False\n\t}\n\tself.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\").props.filter.text \u003d \"\"\n\tself.parent.parent.getChild(\"FlexContainer\").custom.priorities \u003d default_priorities"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"color": "#000000",
|
|
"path": "material/clear"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Reset"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "button-severity-indicator",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"severity\"]\n\tbutton_severity \u003d self.custom.Severity\n\tif severity \u003d\u003d button_severity:\n\t\tbackground \u003d \"true\"\n\telse:\n\t\tbackground \u003d \"false\"\n\t\n\tself.custom.background_on \u003d background\n\t",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_2"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"Severity": "High",
|
|
"background_on": "true",
|
|
"update_on": false
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\ttry:\n\t # Get table data\n\t data \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\").props.data\n\t\n\t # CSV header\n\t csv_content \u003d \"Event Timestamp,Duration,Name,Priority,Description,Tag\\n\"\n\t\n\t if data and len(data) \u003e 0:\n\t for row in data:\n\t val \u003d row.get(\"value\", {})\n\t row_data \u003d [\n\t str(val.get(\"EventTimestamp\", \"\")),\n\t str(val.get(\"Duration\", \"\")),\n\t str(val.get(\"Name\", \"\")),\n\t str(val.get(\"Priority\", \"\")),\n\t str(val.get(\"Description\", \"\")),\n\t str(val.get(\"Tag\", \"\"))\n\t ]\n\t\n\t # Escape commas for CSV safety\n\t row_data \u003d [field.replace(\",\", \";\") for field in row_data]\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(\"Error during CSV export: \" + str(e))\n\t csv_content \u003d \"Error exporting alarm data\\n\"\n\t\n\t# Convert to bytes and trigger download\n\tcsv_bytes \u003d csv_content.encode(\u0027utf-8\u0027)\n\tsystem.perspective.download(\"active_alarms.csv\", csv_bytes)\n "
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button_1"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/import_export"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"text": "Export"
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "button-severity-indicator",
|
|
"pageScope": true,
|
|
"script": "\tbackground \u003d \"false\"\n\tseverity \u003d payload[\"severity\"]\n\tbutton_severity \u003d self.custom.Severity\n\tif severity \u003d\u003d button_severity:\n\t\tbackground \u003d \"true\"\n\telse:\n\t\tbackground \u003d \"false\"\n\t\n\tself.custom.background_on \u003d background",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_0"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_1"
|
|
},
|
|
"position": {
|
|
"basis": "10px"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"alarms_to_shelve": [
|
|
{
|
|
"style": {
|
|
"classes": "Alarms-Styles/Medium"
|
|
},
|
|
"value": {
|
|
"Alarm_id": {
|
|
"value": 13
|
|
},
|
|
"Duration": {
|
|
"value": 10495
|
|
},
|
|
"Expiration": {
|
|
"value": {
|
|
"$": [
|
|
"ts",
|
|
0,
|
|
1704730823344
|
|
],
|
|
"$ts": 0
|
|
}
|
|
},
|
|
"Message": {
|
|
"value": "Photo eye blocked"
|
|
},
|
|
"Priority": {
|
|
"value": "3. Medium"
|
|
},
|
|
"Shelve": {
|
|
"value": false
|
|
},
|
|
"SourceId": {
|
|
"value": "PLC09/1210_07_44/B830_3"
|
|
},
|
|
"State": {
|
|
"value": "Active"
|
|
},
|
|
"Timestamp": {
|
|
"value": {
|
|
"$": [
|
|
"ts",
|
|
0,
|
|
1704730823344
|
|
],
|
|
"$ts": 1704720394486
|
|
}
|
|
},
|
|
"Unshelve": {
|
|
"value": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\t\n\tselected_alarms \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\").props.selection.data\n\t\n\tif len(selected_alarms) \u003d\u003d 0:\n\t\tself.props.value \u003d None\n\t\treturn\n\t\n\tduration \u003d self.props.value \n\t\n\tif(duration):\n\t\tfor alarm in selected_alarms:\n\t\t\tsystem.alarm.shelve(alarm.value[\"Device\"], duration * 60) #60 - seconds.\n\t\t\n\t\tself.props.value \u003d None"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.fc"
|
|
},
|
|
"enabled": false,
|
|
"transforms": [
|
|
{
|
|
"code": "\twhid \u003d value.lower()\n\tWHID \u003d value.upper()\n\tsiterole \u003d \u0027Authenticated/Roles/rme-ignition-\u0027+whid+\u0027-alarm-shelving\u0027\n\tSITErole \u003d \u0027Authenticated/Roles/rme-ignition-\u0027+WHID+\u0027-alarm-shelving\u0027\n# Example: rme-ignition-BRS1-alarm-shelving\n\troles \u003d [\u0027Authenticated/Roles/eurme-ignition-admins\u0027, siterole, SITErole]\n\tauth \u003d system.perspective.isAuthorized(False, securityLevels\u003droles)\n\treturn auth",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "15 mins",
|
|
"value": 15
|
|
},
|
|
{
|
|
"label": "30 min",
|
|
"value": 30
|
|
},
|
|
{
|
|
"label": "45 min",
|
|
"value": 45
|
|
},
|
|
{
|
|
"label": "1 hr",
|
|
"value": 60
|
|
},
|
|
{
|
|
"label": "2 hr",
|
|
"value": 120
|
|
},
|
|
{
|
|
"label": "4 hr",
|
|
"value": 240
|
|
},
|
|
{
|
|
"label": "8 hr",
|
|
"value": 480
|
|
},
|
|
{
|
|
"label": "1 Day",
|
|
"value": 1440
|
|
},
|
|
{
|
|
"label": "2 Days",
|
|
"value": 2880
|
|
},
|
|
{
|
|
"label": "1 week",
|
|
"value": 10080
|
|
},
|
|
{
|
|
"label": "2 weeks",
|
|
"value": 20160
|
|
},
|
|
{
|
|
"label": "Out of Service",
|
|
"value": 263000
|
|
}
|
|
],
|
|
"placeholder": {
|
|
"color": "#000000",
|
|
"icon": {
|
|
"color": "#000000",
|
|
"path": "material/archive",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"text": "Shelve"
|
|
},
|
|
"search": {
|
|
"enabled": false
|
|
},
|
|
"showClearIcon": true,
|
|
"style": {
|
|
"borderBottomLeftRadius": "5px",
|
|
"borderBottomRightRadius": "5px",
|
|
"borderTopLeftRadius": "5px",
|
|
"borderTopRightRadius": "5px",
|
|
"classes": "Dropdown/DropDownBox",
|
|
"margin": 15
|
|
},
|
|
"value": null
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "alarms-to-shelve",
|
|
"pageScope": true,
|
|
"script": "\t# implement your handler here\n\tself.custom.alarms_to_shelve \u003d payload",
|
|
"sessionScope": false,
|
|
"viewScope": true
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer_0"
|
|
},
|
|
"position": {
|
|
"basis": "513px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"padding": 0
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "70px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"alignContent": "flex-start",
|
|
"style": {
|
|
"overflow": "visible"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"custom": {
|
|
"rawData": [
|
|
{
|
|
"style": {
|
|
"backgroundColor": "#ffeb3b"
|
|
},
|
|
"value": {
|
|
"Description": "MCM01 Hello world",
|
|
"Device": "prov:MTN6_SIMULATION_SCADA_TAG_PROVIDER:/tag:System/MCM/MCM01/Beacon_Light:/alm:Hello world",
|
|
"Duration": "00:00:35",
|
|
"EventTimestamp": "2025-06-19 21:38:34",
|
|
"Location": "MCM01",
|
|
"NumberID": 57,
|
|
"Priority": "Low",
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"meta": {
|
|
"name": "Table"
|
|
},
|
|
"position": {
|
|
"basis": "972.9px"
|
|
},
|
|
"propConfig": {
|
|
"custom.priorities": {
|
|
"binding": {
|
|
"config": {
|
|
"path": ".../FlexContainer/FlexContainer.custom.priorities"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.data": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.rawData"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\t\n\tpriorities \u003d self.custom.priorities if hasattr(self.custom, \"priorities\") else []\n\t\n\tactivePriorities \u003d [k.capitalize() for k, v in priorities.items() if v]\n\t\n\tif not activePriorities:\n\t return value\n\t\n\tfiltered_data \u003d []\n\t\n\tfor row in value:\n\t\tpriority \u003d row[\"value\"][\"Priority\"]\n\t\tif priority in activePriorities:\n\t \t filtered_data.append(row)\n\t\n\treturn filtered_data",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.query": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "now(2000)"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\tfrom system import date\n\t\n\ttag_provider \u003d \"[\" + self.session.custom.fc + \"_SCADA_TAG_PROVIDER]\"\n\n\t# Helper: format row for table\n\tdef testRow(eventTimeStamp, duration, location, priority, description, tag, color, numberId, device):\n\t\treturn {\n\t\t \"value\": {\n\t\t \"NumberID\": numberId,\n\t\t \"EventTimestamp\": eventTimeStamp,\n\t\t \"Duration\": duration,\n\t\t \"Priority\": priority,\n\t\t \"Location\": location,\n\t\t \"Description\": description,\n\t\t \"Tag\": tag,\n\t\t \"Device\": device\n\t\t },\n\t\t \"style\": {\n\t\t \"backgroundColor\": color,\n\t\t }\n\t\t}\n\t\n\t# Query active alarms\n\tresults \u003d system.alarm.queryStatus(state\u003d[\"ActiveUnacked\", \"ActiveAcked\"])\n\t\n\t# Build rows\n\tdata \u003d []\n\tcolor \u003d \"\"\n\tnumberID \u003d \"\"\n\t\n\tif(results \u003d\u003d0):\n\t\treturn\n\t\n\tfor i, alarm in enumerate(results):\n\t\tactiveTime \u003d alarm.eventTime\n\t\tOPCItemTag \u003d system.tag.read(tag_provider + alarm.myTag + \".OpcItemPath\").value\n\t\tparts \u003d OPCItemTag.split(\".\")\n\t\ttag \u003d str(alarm.displayPath) +\".\" + parts[1] + \".\" + parts[2]\n\t\t\n\t\t\n\n\ttry:\n\t query \u003d system.db.runQuery(\"SELECT id, eventtime FROM alarm_events WHERE eventid \u003d \" + \"\u0027\" + str(alarm.id) + \"\u0027\",\"MariaDB\")\n\t if(query):\n\t \tnumberID \u003d query[0][0]\n\t durationSeconds \u003d date.secondsBetween(activeTime, date.now())\n\t durationStr \u003d date.format(date.addSeconds(date.midnight(date.now()), durationSeconds), \"HH:mm:ss\")\n\t \n\t priority \u003d alarm.priority.toString()\n\t if priority \u003d\u003d \"High\":\n\t color \u003d \"#f45d56\"\n\t elif priority \u003d\u003d \"Medium\":\n\t color \u003d \"#d32f2f\"\n\t elif priority \u003d\u003d \"Low\":\n\t color \u003d \"#ffeb3b\"\n\t elif priority \u003d\u003d \"Diagnostic\":\n\t color \u003d \"#2196f3\"\n\t elif priority \u003d\u003d \"Critical\":\n\t color \u003d \"#b71c1c\"\n\t else:\n\t color \u003d \"#ffffff\"\n\t \n\t\tsystem.perspective.print(alarm.myTag)\n\t\tsystem.perspective.print(\"tag is printed\")\n\t \n#\t\tOPCItemTag \u003d system.tag.read(tag_provider + alarm.myTag).OpcItemPath\n\t\tself.session.custom.fc\n\t data.append(testRow(\n\t eventTimeStamp \u003d date.format(activeTime, \"yyyy-MM-dd HH:mm:ss\"),\n\t duration \u003d durationStr,\n\t location \u003d alarm.displayPath,\n\t numberId \u003d numberID,\n\t priority \u003d priority,\n\t description \u003d alarm.myLocation + \" \" + alarm.name,\n\t tag \u003d tag,\n\t color \u003d color,\n\t device \u003d alarm.source,\n\t ))\n\texcept:\n\t system.perspective.print(\"Something went wrong\")\n\t\n\tself.custom.rawData \u003d data"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "NumberID",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Number (ID)"
|
|
},
|
|
"justify": "left",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 70
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "EventTimestamp",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Event Timestamp"
|
|
},
|
|
"justify": "auto",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 70
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Duration",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "equals",
|
|
"value": ""
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "string",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 70
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Priority",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 70
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Location",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 70
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Description",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 100
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Tag",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "auto",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": 150
|
|
}
|
|
],
|
|
"emptyMessage": {
|
|
"noData": {
|
|
"text": "No Active Alarms"
|
|
}
|
|
},
|
|
"filter": {
|
|
"enabled": true
|
|
},
|
|
"selection": {
|
|
"mode": "multiple interval"
|
|
}
|
|
},
|
|
"type": "ia.display.table"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer_0"
|
|
},
|
|
"position": {
|
|
"basis": "480px",
|
|
"grow": 1
|
|
},
|
|
"props": {
|
|
"direction": "column"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Active_tab"
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"justify": "space-evenly"
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"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",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button"
|
|
},
|
|
"position": {
|
|
"basis": "153px"
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"color": "#000000",
|
|
"path": "material/archive"
|
|
}
|
|
},
|
|
"style": {
|
|
"classes": "Dropdown/DropDownBox"
|
|
},
|
|
"text": "Unshelve",
|
|
"value": ""
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "alarms-to-shelve",
|
|
"pageScope": true,
|
|
"script": "\t# implement your handler here\n\tself.props.enabled \u003d True\n\tself.custom.alarms_to_shelve \u003d payload",
|
|
"sessionScope": false,
|
|
"viewScope": true
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer_0"
|
|
},
|
|
"position": {
|
|
"basis": "450px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"padding": 5
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer"
|
|
},
|
|
"position": {
|
|
"basis": "40px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"alignContent": "flex-start",
|
|
"style": {
|
|
"overflow": "visible"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "AlarmsTable"
|
|
},
|
|
"position": {
|
|
"basis": "1080px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.data": {
|
|
"binding": {
|
|
"config": {
|
|
"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"
|
|
}
|
|
},
|
|
"props.editingCell": {
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\tall_alarms \u003d system.alarm.queryStatus(includeShelved\u003dTrue)\n\tshelved_alarms \u003d [alarm for alarm in all_alarms if alarm.isShelved()]\n\t\n\t# Build dataset for table\n\theaders \u003d [\u0027ID\u0027, \u0027StartTimestamp\u0027, \u0027EndTimestamp\u0027, \u0027Duration\u0027, \u0027Description\u0027, \u0027Priority\u0027, \u0027Tag\u0027, \u0027MCM\u0027]\n\tdata \u003d []\n\t\n\tfor alarm in shelved_alarms:\n\t # Calculate duration (time since shelved)\n\t if alarm.activeTime:\n\t duration_ms \u003d system.date.now().getTime() - alarm.activeTime.getTime()\n\t duration_seconds \u003d duration_ms / 1000\n\t hours \u003d int(duration_seconds / 3600)\n\t minutes \u003d int((duration_seconds % 3600) / 60)\n\t seconds \u003d int(duration_seconds % 60)\n\t duration \u003d \"%02d:%02d:%02d\" % (hours, minutes, seconds)\n\t else:\n\t duration \u003d \"00:00:00\"\n\t \n\t # Extract tag name from source\n\t tag_name \u003d alarm.source.split(\u0027/\u0027)[-1] if \u0027/\u0027 in alarm.source else alarm.source\n\t \n\t row \u003d [\n\t str(alarm.id) if hasattr(alarm, \u0027id\u0027) else \u0027\u0027,\n\t alarm.activeTime if alarm.activeTime else system.date.now(),\n\t None, # End timestamp (shelved alarms don\u0027t have end time yet)\n\t duration,\n\t alarm.displayPath if alarm.displayPath else alarm.source,\n\t alarm.priority.name if alarm.priority else \u0027Unknown\u0027,\n\t tag_name,\n\t \u0027System\u0027 # Adjust based on your source format\n\t ]\n\t data.append(row)\n\t\n\t# Create dataset and update the custom property\n\tdataset \u003d system.dataset.toDataSet(headers, data)\n\tself.custom.shelvedAlarmsData \u003d dataset"
|
|
}
|
|
},
|
|
"props.selection": {
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "Description",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"backgroundColor": "#FFFEFE",
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "auto",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "value",
|
|
"dateFormat": "MM-DD-YYYY HH:mm:ss",
|
|
"editable": false,
|
|
"field": "path",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Start Timestamp"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "none",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM-DD-YYYY HH:mm:ss",
|
|
"editable": false,
|
|
"field": "activeTime",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Active Time"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "expirationTime",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Expiration Time"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "none",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "priority",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": true
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
}
|
|
],
|
|
"emptyMessage": {
|
|
"noData": {
|
|
"text": "No Shelved Alarms"
|
|
}
|
|
},
|
|
"selection": {
|
|
"mode": "multiple interval"
|
|
}
|
|
},
|
|
"type": "ia.display.table"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "FlexContainer_0"
|
|
},
|
|
"position": {
|
|
"basis": "500px",
|
|
"grow": 1
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Shelved tab"
|
|
},
|
|
"position": {
|
|
"tabIndex": 1
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"justify": "space-evenly"
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"custom": {
|
|
"SetFilter": true
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tpayload \u003d {}\n\tif self.custom.SetFilter \u003d\u003d True:\n\t\tpayload[\"data\"] \u003d False\n\t\tself.custom.SetFilter \u003d False\n\t\t\n\t\n\telif self.custom.SetFilter \u003d\u003d False:\n\t\tpayload[\"data\"] \u003d True\n\t\tself.custom.SetFilter \u003d True\n\t\n\tsystem.perspective.sendMessage(\"show-historical-filters\", payload \u003d payload, scope \u003d \"page\")\n\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Button",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"style": {
|
|
"background-color": "white",
|
|
"borderColor": "#000000",
|
|
"borderStyle": "solid",
|
|
"borderWidth": "1px",
|
|
"box-shadow": "5px 5px 5px grey",
|
|
"color": "#000000",
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "normal"
|
|
},
|
|
"text": "Show Filters"
|
|
}
|
|
},
|
|
"position": {
|
|
"basis": "120px"
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/filter_alt"
|
|
},
|
|
"position": "center"
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15,
|
|
"marginLeft": 20
|
|
},
|
|
"text": ""
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "281px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"color": "#FF0000",
|
|
"margin-left": "20px"
|
|
},
|
|
"text": "ALL TIMESTAMPS ARE IN UTC"
|
|
},
|
|
"type": "ia.display.label"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Show filters"
|
|
},
|
|
"position": {
|
|
"basis": "70px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label_1"
|
|
},
|
|
"position": {
|
|
"basis": "100px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "bold",
|
|
"textAlign": "center"
|
|
},
|
|
"text": "Period:"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"customTime": false,
|
|
"endDate": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615331
|
|
],
|
|
"$ts": 1750354615331
|
|
},
|
|
"startDate": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615331
|
|
],
|
|
"$ts": 1750352815331
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "200px"
|
|
},
|
|
"propConfig": {
|
|
"props.value": {
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\n\tstart \u003d \"\"\n\tend \u003d \"\"\n\tnow \u003d system.date.now()\n\tpreviousDay \u003d system.date.addDays(now, -1)\n\tvalue \u003d currentValue.value \n\n\tif value \u003d\u003d \"custom\":\n\t\tself.custom.customTime \u003d True\n\t\treturn\n\telif value \u003d\u003d \"currentDay\":\n\t\tstart \u003d system.date.setTime(now, 0, 0, 0)\n\t\tend \u003d now\n\telif value \u003d\u003d \"morning\":\n\t\tstart \u003d system.date.setTime(now, 2, 30, 0)\n\t\tend \u003d system.date.setTime(now, 7, 30, 0)\n\telif value \u003d\u003d \"daylight\":\n\t\tstart \u003d system.date.setTime(now, 7, 30, 0)\n\t\tend \u003d system.date.setTime(now, 13, 0, 0)\n\telif value \u003d\u003d \"twilight\":\n\t\tstart \u003d system.date.setTime(now, 13, 0, 0)\n\t\tend \u003d now\n\telif value \u003d\u003d \"night\":\n\t\tstart \u003d system.date.setTime(previousDay, 18, 30, 0)\n\t\tend \u003d system.date.setTime(previousDay, 23, 30, 0)\n\telif value \u003d\u003d \"wrapDown\":\n\t\tstart \u003d system.date.setTime(previousDay, 23, 30, 0)\n\t\tend \u003d system.date.setTime(now, 2, 30, 0)\n\telif value \u003d\u003d \"currentShot\":\n\t\tstart \u003d system.date.setTime(now, 13, 0, 0)\n\t\tend \u003d now\n\telse:\n\t\tstart \u003d system.date.addMinutes(now, -int(value))\n\t\tend \u003d now\n\n\tself.custom.customTime \u003d False\n\tself.custom.startDate \u003d start\n\tself.custom.endDate \u003d end"
|
|
},
|
|
"persistent": false
|
|
}
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "Past 30 Min",
|
|
"value": 30
|
|
},
|
|
{
|
|
"label": "Past Hour",
|
|
"value": 60
|
|
},
|
|
{
|
|
"label": "Past 2 Hour",
|
|
"value": 120
|
|
},
|
|
{
|
|
"label": "Past 4 Hour",
|
|
"value": 240
|
|
},
|
|
{
|
|
"label": "Past 8 Hour",
|
|
"value": 480
|
|
},
|
|
{
|
|
"label": "Current Day",
|
|
"value": "currentDay"
|
|
},
|
|
{
|
|
"label": "Morning",
|
|
"value": "morning"
|
|
},
|
|
{
|
|
"label": "Daylight",
|
|
"value": "daylight"
|
|
},
|
|
{
|
|
"label": "Twilight",
|
|
"value": "twilight"
|
|
},
|
|
{
|
|
"label": "Night",
|
|
"value": "night"
|
|
},
|
|
{
|
|
"label": "Wrap Down",
|
|
"value": "wrapDown"
|
|
},
|
|
{
|
|
"label": "Current Shot",
|
|
"value": "currentShot"
|
|
},
|
|
{
|
|
"label": "Custom",
|
|
"value": "custom"
|
|
}
|
|
],
|
|
"style": {
|
|
"margin": 15
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "100px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "bold",
|
|
"textAlign": "center"
|
|
},
|
|
"text": "Start Date"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"custom": {
|
|
"max_duration_days": 10
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tmessaging.message_handler.set_time_from_filters(self)\n\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "DateTimeInput",
|
|
"tooltip": {
|
|
"enabled": true
|
|
}
|
|
},
|
|
"position": {
|
|
"basis": "200px"
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "../Dropdown.custom.customTime"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.maxDate": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "now()"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.minDate": {
|
|
"access": "PUBLIC",
|
|
"binding": {
|
|
"config": {
|
|
"expression": "addDays(now(),-{this.custom.max_duration_days})"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "../Dropdown.custom.startDate"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\tmessaging.message_handler.set_time_from_filters(self)"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"formattedValue": "Jun 19, 2025 9:06 PM",
|
|
"style": {
|
|
"margin": 15
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.date-time-input"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label_0"
|
|
},
|
|
"position": {
|
|
"basis": "89px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "bold",
|
|
"textAlign": "center"
|
|
},
|
|
"text": "End Date"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "DateTimeInput_0"
|
|
},
|
|
"position": {
|
|
"basis": "200px"
|
|
},
|
|
"propConfig": {
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "../Dropdown.custom.customTime"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.maxDate": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "now()"
|
|
},
|
|
"enabled": false,
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.minDate": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "addDays(now(),-10)"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "../Dropdown.custom.endDate"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\tmessaging.message_handler.set_time_to_filters(self)"
|
|
},
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"formattedValue": "Jun 19, 2025 9:36 PM",
|
|
"maxDate": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1749542669794
|
|
],
|
|
"$ts": 1749715452000
|
|
},
|
|
"style": {
|
|
"margin": 15
|
|
},
|
|
"value": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615331
|
|
],
|
|
"$ts": 1750354615331
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.date-time-input"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Time"
|
|
},
|
|
"position": {
|
|
"basis": "70px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "100px"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "bold",
|
|
"textAlign": "center"
|
|
},
|
|
"text": "Priority"
|
|
},
|
|
"type": "ia.display.label"
|
|
},
|
|
{
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": "\tmessaging.message_handler.set_priority_filters(self)"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Dropdown"
|
|
},
|
|
"position": {
|
|
"basis": "490px"
|
|
},
|
|
"propConfig": {
|
|
"props.value": {
|
|
"persistent": false
|
|
}
|
|
},
|
|
"props": {
|
|
"options": [
|
|
{
|
|
"label": "Diagnostic",
|
|
"value": "diagnostic"
|
|
},
|
|
{
|
|
"label": "Low",
|
|
"value": "low"
|
|
},
|
|
{
|
|
"label": "Medium",
|
|
"value": "medium"
|
|
},
|
|
{
|
|
"label": "High",
|
|
"value": "high"
|
|
},
|
|
{
|
|
"label": "All",
|
|
"value": ""
|
|
}
|
|
],
|
|
"style": {
|
|
"margin": 15
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\treset \u003d payload[\"data\"]\n\tself.props.value \u003d None",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.dropdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Priority"
|
|
},
|
|
"position": {
|
|
"basis": "70px",
|
|
"shrink": 0
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"custom": {
|
|
"ShowFilters": true
|
|
},
|
|
"meta": {
|
|
"name": "Filters"
|
|
},
|
|
"position": {
|
|
"basis": "180px",
|
|
"grow": 1,
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"position.display": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.ShowFilters"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"borderStyle": "solid",
|
|
"borderWidth": "1px",
|
|
"box-shadow": "0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",
|
|
"marginBottom": 10,
|
|
"marginLeft": 20,
|
|
"marginRight": 20,
|
|
"marginTop": 10
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "show-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\tshow \u003d payload[\"data\"]\n\tself.custom.ShowFilters \u003d show",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"custom": {
|
|
"initial_data": [],
|
|
"max_duration": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1748426336635
|
|
],
|
|
"$ts": 1747562336635
|
|
},
|
|
"priority_filters": "",
|
|
"time_from_filter": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615332
|
|
],
|
|
"$ts": 1750352815331
|
|
},
|
|
"time_to_filter": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615332
|
|
],
|
|
"$ts": 1750354615331
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Table"
|
|
},
|
|
"position": {
|
|
"basis": "1920px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.columns[1].filter.date.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.time_from_filter"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.columns[2].filter.date.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.time_to_filter"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.columns[2].filter.number.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.time_to_filter"
|
|
},
|
|
"enabled": false,
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.columns[5].filter.string.value": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "this.custom.priority_filters"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.data": {
|
|
"binding": {
|
|
"config": {
|
|
"polling": {
|
|
"enabled": true,
|
|
"rate": "3"
|
|
},
|
|
"queryPath": "GetAlarms"
|
|
},
|
|
"type": "query"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"box-shadow": "0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",
|
|
"columns": [
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "ID",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": "",
|
|
"paddingLeft": 12
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY HH:mm:ss",
|
|
"editable": false,
|
|
"field": "StartTimestamp",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "later than date time"
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Start Timestamp"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "none",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY HH:mm:ss",
|
|
"editable": false,
|
|
"field": "EndTimestamp",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "earlier than date time"
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "End Timestamp"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "Duration",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": "",
|
|
"paddingLeft": 12
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "none",
|
|
"editable": false,
|
|
"field": "Description",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": false,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"visible": "on-hover"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Priority",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "contains"
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": "Severity"
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "MCM",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "equals",
|
|
"value": ""
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
},
|
|
{
|
|
"align": "center",
|
|
"boolean": "checkbox",
|
|
"dateFormat": "MM/DD/YYYY",
|
|
"editable": false,
|
|
"field": "Tag",
|
|
"filter": {
|
|
"boolean": {
|
|
"condition": ""
|
|
},
|
|
"date": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"enabled": true,
|
|
"number": {
|
|
"condition": "",
|
|
"value": ""
|
|
},
|
|
"string": {
|
|
"condition": "contains",
|
|
"value": ""
|
|
},
|
|
"visible": "never"
|
|
},
|
|
"footer": {
|
|
"align": "center",
|
|
"justify": "left",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"header": {
|
|
"align": "center",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"title": ""
|
|
},
|
|
"justify": "center",
|
|
"nullFormat": {
|
|
"includeNullStrings": false,
|
|
"nullFormatValue": "",
|
|
"strict": false
|
|
},
|
|
"number": "value",
|
|
"numberFormat": "0,0.##",
|
|
"progressBar": {
|
|
"bar": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"max": 100,
|
|
"min": 0,
|
|
"track": {
|
|
"color": "",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
},
|
|
"value": {
|
|
"enabled": true,
|
|
"format": "0,0.##",
|
|
"justify": "center",
|
|
"style": {
|
|
"classes": ""
|
|
}
|
|
}
|
|
},
|
|
"render": "auto",
|
|
"resizable": true,
|
|
"sort": "none",
|
|
"sortable": true,
|
|
"strictWidth": false,
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"toggleSwitch": {
|
|
"color": {
|
|
"selected": "",
|
|
"unselected": ""
|
|
}
|
|
},
|
|
"viewParams": {},
|
|
"viewPath": "",
|
|
"visible": true,
|
|
"width": ""
|
|
}
|
|
],
|
|
"enabled": true,
|
|
"filter": {
|
|
"enabled": true,
|
|
"results": {
|
|
"data": [
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 35,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 36,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 35,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 36,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 35,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 36,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 35,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
},
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:42",
|
|
"EndTimestamp": 1750354587000,
|
|
"ID": 36,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354545000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
}
|
|
],
|
|
"enabled": true
|
|
}
|
|
},
|
|
"pager": {
|
|
"bottom": false
|
|
},
|
|
"selection": {
|
|
"data": [
|
|
{
|
|
"Description": "MCM01 - Hello world",
|
|
"Duration": "00:00:02",
|
|
"EndTimestamp": 1750354703000,
|
|
"ID": 47,
|
|
"MCM": "MCM01",
|
|
"Priority": "Low",
|
|
"StartTimestamp": 1750354701000,
|
|
"Tag": "MCM01.HMI.Beacon_Light"
|
|
}
|
|
],
|
|
"selectedColumn": "MCM",
|
|
"selectedRow": 0
|
|
},
|
|
"style": {
|
|
"margin": 20
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "update-first-request",
|
|
"pageScope": true,
|
|
"script": "\tdata \u003d payload[\"data\"]\n\tinitial_data \u003d payload[\"initial_data\"]\n\tself.props.data \u003d data\n\tself.custom.initial_data \u003d initial_data",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "update-historical-data",
|
|
"pageScope": true,
|
|
"script": "\thistorical_data \u003d payload[\"data\"]\n\tself.props.data \u003d historical_data",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "load_initial_data",
|
|
"pageScope": true,
|
|
"script": "\trequest \u003d payload[\"data\"]\n\tsystem.perspective.print(\"initial message received\")\n\tif request \u003d\u003d True:\n\t\tself.props.data \u003d self.custom.initial_data",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\treset \u003d payload[\"data\"]\n\tif reset \u003d\u003d \"reset\":\n\t\tself.props.data \u003d []\n\t\tself.custom.device_filters \u003d None\n\t\tself.custom.priority_filters \u003d None\n\t\tself.custom.source_id_filters \u003d None\n\t\tself.custom.time_from_filter \u003d None\n\t\tself.custom.time_to_filter \u003d None\n\t\tself.custom.type_filters \u003d None\n\t\tself.custom.duration_filter \u003d None\n\t\tself.props.enabled \u003dTrue",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-source-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.source_id_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-device-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.device_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-priority-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.priority_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-from-filters",
|
|
"pageScope": true,
|
|
"script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_from_filter \u003d time",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-to-filters",
|
|
"pageScope": true,
|
|
"script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_to_filter \u003d time",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-type-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.type_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-duration-filters",
|
|
"pageScope": true,
|
|
"script": "\tduration \u003d payload[\"data\"]\n\tself.custom.duration_filter \u003d duration",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.display.table"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Table"
|
|
},
|
|
"position": {
|
|
"basis": "980px",
|
|
"grow": 1
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "update-historical-data",
|
|
"pageScope": true,
|
|
"script": "#\tdata \u003d payload[\"data\"]\n#\tself.getChild(\"Table\").props.data \u003d data",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.container.flex"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"custom": {
|
|
"download_in_progress": true,
|
|
"enable_timeout": false,
|
|
"priority_filters": "",
|
|
"time_from_filter": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615332
|
|
],
|
|
"$ts": 1750352815331
|
|
},
|
|
"time_to_filter": {
|
|
"$": [
|
|
"ts",
|
|
192,
|
|
1750354615332
|
|
],
|
|
"$ts": 1750354615331
|
|
},
|
|
"type_filters": null
|
|
},
|
|
"events": {
|
|
"component": {
|
|
"onActionPerformed": {
|
|
"config": {
|
|
"script": " try:\n # Get filtered data from table (array of dicts)\n filtered_results \u003d self.parent.parent.getChild(\"Table\").getChild(\"Table\").props.filter.results\n filtered_data \u003d filtered_results.data\n \n # Ensure data is valid\n if not filtered_data:\n return\n \n # Get columns from first record\n columns \u003d filtered_data[0].keys()\n \n # Create a list of rows\n rows \u003d []\n for i in range(len(filtered_data)):\n row_dict \u003d filtered_data[i]\n row \u003d [row_dict.get(col) for col in columns]\n rows.append(row)\n \n # Convert to dataset and export\n dataset \u003d system.dataset.toDataSet(columns, rows)\n html_data \u003d system.dataset.dataSetToHTML(1, dataset, \"Filtered Results\")\n system.perspective.download(\"filtered_alarms_history.html\", html_data)\n \n print \"Export completed successfully! Exported\", len(rows), \"records.\"\n \n except Exception as e:\n print \"Export failed:\", str(e)\n\n\t"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "Export",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"text": "Exports the data displayed in the table."
|
|
}
|
|
},
|
|
"position": {
|
|
"basis": "120px",
|
|
"shrink": 0
|
|
},
|
|
"propConfig": {
|
|
"custom.disable": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(isNull({this.custom.start_time}), False, secondsBetween({this.custom.start_time}, {this.custom.time_now}))"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tif value \u003e 60:\n\t\tself.custom.enable_timeout \u003d False\n\t\treturn False\n\telse:\n\t\treturn True",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"custom.download_complete": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.downloads"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tif value \u003d\u003d True:\n\t\tself.custom.download_in_progress \u003d False",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"custom.priority_filters": {
|
|
"persistent": true
|
|
},
|
|
"custom.start_time": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{this.custom.enable_timeout}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\tif value \u003d\u003d True:\n\t\treturn self.custom.time_now",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"custom.time_from_filter": {
|
|
"persistent": true
|
|
},
|
|
"custom.time_now": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "now()"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"custom.time_to_filter": {
|
|
"persistent": true
|
|
},
|
|
"props.enabled": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "!{this.custom.enable_timeout} || !{this.custom.download_in_progress} "
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.text": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(!{this.custom.enable_timeout}, \"Export\",\r\nif({this.custom.download_in_progress}, \"Exporting...\",\r\n\"Export\"))"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"image": {
|
|
"icon": {
|
|
"path": "material/import_export"
|
|
}
|
|
},
|
|
"primary": false,
|
|
"style": {
|
|
"margin": 15,
|
|
"marginLeft": 20
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "set-source-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.source_id_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-device-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.device_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-message-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.message_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-priority-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.priority_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-from-filters",
|
|
"pageScope": true,
|
|
"script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_from_filter \u003d time",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-to-filters",
|
|
"pageScope": true,
|
|
"script": "\ttime \u003d payload[\"data\"]\n\tself.custom.time_to_filter \u003d time",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "reset-historical-filters",
|
|
"pageScope": true,
|
|
"script": "\taction \u003d payload[\"data\"]\n\tif action \u003d\u003d \"reset\":\n\t\tself.custom.device_filters \u003d None\n\t\tself.custom.priority_filters \u003d None\n\t\tself.custom.source_id_filters \u003d None\n\t\tself.custom.time_from_filter \u003d None\n\t\tself.custom.time_to_filter \u003d None\n\t\tself.custom.type_filters \u003d None\n\t\tself.custom.duration_filter \u003d None\n\t\tself.props.enabled \u003dTrue\n\t\t",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-type-filters",
|
|
"pageScope": true,
|
|
"script": "\tfilters \u003d payload[\"data\"]\n\tself.custom.type_filters \u003d filters",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
},
|
|
{
|
|
"messageType": "set-duration-filters",
|
|
"pageScope": true,
|
|
"script": "\tduration \u003d payload[\"data\"]\n\tself.custom.duration_filter \u003d duration",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.input.button"
|
|
},
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"basis": "580px",
|
|
"grow": 1
|
|
},
|
|
"type": "ia.display.label"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Paginate"
|
|
},
|
|
"position": {
|
|
"basis": "70px",
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"justify": "space-evenly"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"style": {
|
|
"classes": "Background-Styles/Grey-Background"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "Historical_tab"
|
|
},
|
|
"position": {
|
|
"tabIndex": 2
|
|
},
|
|
"props": {
|
|
"direction": "column",
|
|
"justify": "space-evenly"
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"custom": {
|
|
"shelvedAlarms": []
|
|
},
|
|
"meta": {
|
|
"name": "TabContainer"
|
|
},
|
|
"position": {
|
|
"basis": "300px",
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.currentTabIndex": {
|
|
"onChange": {
|
|
"enabled": null,
|
|
"script": "\n\tif self.props.currentTabIndex !\u003d 0:\n\t\tpayload \u003d {}\n\t\tfilter_on \u003d \"false\"\n\t\tpayload[\"reset\"] \u003d filter_on\n\t\tsystem.perspective.sendMessage(\"reset-filters\", payload \u003dpayload, scope \u003d \"page\")\n\t\t\n\tif currentValue.value \u003d\u003d 1:\n\t shelved_info \u003d system.alarm.getShelvedPaths()\n\t alarms \u003d system.alarm.queryStatus(includeShelved\u003dTrue)\n\t \n\t tableData \u003d []\n\t \n\t for alarm in alarms:\n\t if alarm.isShelved() and not alarm.isAcked() and not alarm.isCleared():\n\t # Get alarm path as string\n\t alarm_path \u003d str(alarm.getSource())\n\t \n\t # Get active time\n\t activeData \u003d alarm.getActiveData()\n\t startTime \u003d activeData.getTimestamp() if activeData else None\n\t \n\t # Find shelved info for this alarm\n\t shelveEntry \u003d \"\"\n\t \n\t for shelved_item in shelved_info:\n\t shelved_str \u003d str(shelved_item)\n\t \n\t if alarm_path in shelved_str:\n\t # Extract the value part (after the first comma)\n\t if \",\" in shelved_str:\n\t start_idx \u003d shelved_str.find(\",\")\n\t shelveEntry \u003d shelved_str[start_idx + 1:].rstrip(\"}\")\n\t break\n\t \n\t # Parse shelved information\n\t expiration \u003d \"\"\n\t \n\t if shelveEntry:\n\t \n\t # Extract expiration (between \"expiration:\" and \",\")\n\t if \"expiration:\" in shelveEntry:\n\t exp_part \u003d shelveEntry.split(\"expiration:\")[1]\n\t if \",\" in exp_part:\n\t expiration \u003d exp_part.split(\",\")[0].strip()\n\t else:\n\t expiration \u003d exp_part.strip()\n\t \n\t tableData.append({\n\t \"name\": alarm.getName(),\n\t \"path\": alarm_path,\n\t \"activeTime\": system.date.format(system.date.fromMillis(startTime), \"yyyy-MM-dd HH:mm:ss\"),\n\t \"expirationTime\": expiration,\n\t \"priority\": str(alarm.getPriority())\n\t })\n\t \n\t self.custom.shelvedAlarms \u003d tableData\n\t \n\t\t\n\ttry:\n\t\tpageid \u003d self.view.custom.activityLogger.alt_pageid + \u0027/\u0027+ self.props.tabs[previousValue.value]\n\t\tpageid \u003d pageid.replace(\u0027 \u0027,\u0027\u0027)\n\t\tpayload \u003d activityLog.productMetrics.createActivityPayload(self.view, \u0027page\u0027, pageid, pageid)\n\t\tself.view.custom.activityLogger.start_time \u003d system.date.now()\n\t\tif payload:\n\t\t\tsystem.perspective.sendMessage(\u0027activityLogger-TabChanged\u0027, payload \u003d payload, scope \u003d \u0027page\u0027)\n\texcept:\n\t\tpass"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"contentStyle": {
|
|
"classes": "Background-Styles/Grey-Background"
|
|
},
|
|
"menuType": "modern",
|
|
"style": {
|
|
"classes": "Background-Styles/Grey-Background"
|
|
},
|
|
"tabSize": {
|
|
"width": 140
|
|
},
|
|
"tabStyle": {
|
|
"active": {
|
|
"backgroundColor": "#EEEEEE",
|
|
"borderLeftColor": "#7FFF00",
|
|
"borderLeftStyle": "solid",
|
|
"borderLeftWidth": 5,
|
|
"borderTopLeftRadius": 5,
|
|
"borderTopRightRadius": 5,
|
|
"color": "#000000",
|
|
"fontFamily": "Arial",
|
|
"fontWeight": "bold",
|
|
"outlineStyle": "none",
|
|
"textDecoration": "underline"
|
|
},
|
|
"inactive": {
|
|
"backgroundColor": "#D7D7D7",
|
|
"borderLeftColor": "#FFFFFF",
|
|
"borderTopLeftRadius": 5,
|
|
"borderTopRightRadius": 5,
|
|
"color": "#969696",
|
|
"fontFamily": "Arial"
|
|
}
|
|
},
|
|
"tabs": [
|
|
"Active Alarms",
|
|
"Shelved Alarms",
|
|
"Historical"
|
|
]
|
|
},
|
|
"type": "ia.container.tab"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"classes": "Background-Styles/Main-Background"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"customMethods": [],
|
|
"extensionFunctions": null,
|
|
"messageHandlers": [
|
|
{
|
|
"messageType": "activityLogger-TabChanged",
|
|
"pageScope": true,
|
|
"script": "\t# implement your handler here\n\tif payload:\n\t\tactivityLog.productMetrics.callActivityLoggerAPI(payload)",
|
|
"sessionScope": false,
|
|
"viewScope": false
|
|
}
|
|
]
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |