4874 lines
216 KiB
JSON
4874 lines
216 KiB
JSON
{
|
||
"custom": {
|
||
"Update": 1,
|
||
"activityLogger": {
|
||
"alt_pageid": "alarms",
|
||
"pageid": "alarms/ActiveAlarms",
|
||
"start_time": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1748425447154
|
||
],
|
||
"$ts": 1748425447154
|
||
}
|
||
}
|
||
},
|
||
"events": {
|
||
"system": {
|
||
"onStartup": {
|
||
"config": {
|
||
"script": "\tself.custom.Update \u003d 1\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Hit_List\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Hit_List\").getChild(\"Filters\").getChild(\"Priority\").getChild(\"Dropdown\").props.value \u003d \"medium\"\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Historical_tab\").getChild(\"root\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\").props.value \u003d 30\n\tself.getChild(\"root\").getChild(\"TabContainer\").getChild(\"Historical_tab\").getChild(\"root\").getChild(\"Filters\").getChild(\"Priority\").getChild(\"Dropdown\").props.value \u003d \"medium\""
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"params": {},
|
||
"propConfig": {
|
||
"custom.Update": {
|
||
"persistent": true
|
||
},
|
||
"custom.activityLogger": {
|
||
"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"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Label"
|
||
},
|
||
"position": {
|
||
"basis": "176px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "Minumum Priority:"
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"events": {
|
||
"component": {
|
||
"onActionPerformed": {
|
||
"config": {
|
||
"script": "\tmessaging.message_handler.set_priority_filters(self)"
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "Dropdown_0"
|
||
},
|
||
"position": {
|
||
"basis": "490px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "view.custom.Update"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"fallback": "",
|
||
"inputType": "scalar",
|
||
"mappings": [
|
||
{
|
||
"input": 1,
|
||
"output": "medium"
|
||
}
|
||
],
|
||
"outputType": "scalar",
|
||
"type": "map"
|
||
}
|
||
],
|
||
"type": "property"
|
||
},
|
||
"persistent": false
|
||
}
|
||
},
|
||
"props": {
|
||
"options": [
|
||
{
|
||
"label": "Diagnostic",
|
||
"value": "diagnostic"
|
||
},
|
||
{
|
||
"label": "Low",
|
||
"value": "low"
|
||
},
|
||
{
|
||
"label": "Medium",
|
||
"value": "medium"
|
||
},
|
||
{
|
||
"label": "High",
|
||
"value": "high"
|
||
}
|
||
],
|
||
"placeholder": {
|
||
"text": ""
|
||
},
|
||
"style": {
|
||
"margin": 15
|
||
}
|
||
},
|
||
"type": "ia.input.dropdown"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Label_1"
|
||
},
|
||
"position": {
|
||
"basis": "176px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "MCM:"
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Dropdown"
|
||
},
|
||
"position": {
|
||
"basis": "200px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"persistent": false
|
||
}
|
||
},
|
||
"props": {
|
||
"options": [
|
||
{
|
||
"label": "All",
|
||
"value": ""
|
||
},
|
||
{
|
||
"label": "MCM01",
|
||
"value": "MCM01"
|
||
},
|
||
{
|
||
"label": "MCM02",
|
||
"value": "MCM02"
|
||
},
|
||
{
|
||
"label": "MCM03",
|
||
"value": "MCM03"
|
||
},
|
||
{
|
||
"label": "MCM04",
|
||
"value": "MCM04"
|
||
},
|
||
{
|
||
"label": "MCM05",
|
||
"value": "MCM05"
|
||
},
|
||
{
|
||
"label": "MCM06",
|
||
"value": "MCM06"
|
||
},
|
||
{
|
||
"label": "MCM07",
|
||
"value": "MCM07"
|
||
},
|
||
{
|
||
"label": "SMC",
|
||
"value": "SMC"
|
||
},
|
||
{
|
||
"label": "CMC",
|
||
"value": "CMC"
|
||
}
|
||
],
|
||
"placeholder": {
|
||
"text": "Filter MCMs..."
|
||
},
|
||
"style": {
|
||
"margin": 15
|
||
}
|
||
},
|
||
"scripts": {
|
||
"customMethods": [],
|
||
"extensionFunctions": null,
|
||
"messageHandlers": [
|
||
{
|
||
"messageType": "hjsgdfn",
|
||
"pageScope": false,
|
||
"script": "\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
}
|
||
]
|
||
},
|
||
"type": "ia.input.dropdown"
|
||
}
|
||
],
|
||
"custom": {
|
||
"priorities": {
|
||
"diagnostic": false,
|
||
"high": true,
|
||
"low": false,
|
||
"medium": true
|
||
}
|
||
},
|
||
"events": {
|
||
"system": {
|
||
"onStartup": {
|
||
"config": {
|
||
"script": "\tself.custom.priorities \u003d {\n\t \"diagnostic\": False,\n\t \"low\": False,\n\t \"medium\": True,\n\t \"high\": True,\n\t}"
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "FlexContainer"
|
||
},
|
||
"position": {
|
||
"basis": "881px",
|
||
"shrink": 0
|
||
},
|
||
"propConfig": {
|
||
"custom.FilterStatus": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "./Dropdown_0.props.value"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"fallback": 2,
|
||
"inputType": "scalar",
|
||
"mappings": [
|
||
{
|
||
"input": "low",
|
||
"output": 1
|
||
},
|
||
{
|
||
"input": "medium",
|
||
"output": 2
|
||
},
|
||
{
|
||
"input": "high",
|
||
"output": 3
|
||
},
|
||
{
|
||
"input": "diagnostic",
|
||
"output": 0
|
||
}
|
||
],
|
||
"outputType": "scalar",
|
||
"type": "map"
|
||
}
|
||
],
|
||
"type": "property"
|
||
},
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\t\n\ttag_path \u003d \"[\" + self.session.custom.fc + \"_SCADA_TAG_PROVIDER]System/Queries/Alarms/Priority\"\n\tsystem.tag.writeBlocking([tag_path],[currentValue])"
|
||
}
|
||
}
|
||
},
|
||
"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\n\tself.parent.parent.getChild(\"FlexContainer\").getChild(\"Dropdown\").props.value \u003d \"\""
|
||
},
|
||
"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": "\tfrom datetime import datetime\n\timport system\n\t\n\tdef format_timestamp(ts):\n\t\tif not ts:\n\t\t\treturn \"\"\n\t\tts_str \u003d str(ts).strip()\n\t\ttry:\n\t\t\t# ISO: \"2025-11-17 14:30:18.0\"\n\t\t\tif \".\" in ts_str:\n\t\t\t\tts_str \u003d ts_str.split(\".\")[0]\n\t\t\t# \"2025-11-17 14:30:18\"\n\t\t\tif \"-\" in ts_str and len(ts_str.split(\"-\")[0]) \u003d\u003d 4:\n\t\t\t\tdt \u003d datetime.strptime(ts_str, \"%Y-%m-%d %H:%M:%S\")\n\t\t\t\treturn dt.strftime(\"%m/%d/%Y %H:%M:%S\")\n\t\t\t# JS Date: \"Mon Nov 17 2025 14:21:26 GMT+0400...\"\n\t\t\tif \"GMT\" in ts_str:\n\t\t\t\tdt \u003d datetime.strptime(ts_str.split(\" GMT\")[0], \"%a %b %d %Y %H:%M:%S\")\n\t\t\t\treturn dt.strftime(\"%m/%d/%Y %H:%M:%S\")\n\t\texcept Exception as e:\n\t\t\tsystem.perspective.print(\n\t\t\t\t\"Timestamp format error: %s, value: %s\" % (str(e), ts_str)\n\t\t\t)\n\t\treturn ts_str\n\t\n\t\n\tdef safe_str(v):\n\t\tif v is None:\n\t\t\treturn \"\"\n\t\ttry:\n\t\t\treturn str(v)\n\t\texcept:\n\t\t\treturn \"\"\n\t\n\t\n\ttry:\n\t\ttable \u003d self.parent.parent.parent.getChild(\"FlexContainer_0\").getChild(\"Table\")\n\t\n\t\t# Prefer filtered rows if filter is enabled\n\t\ttry:\n\t\t\tif (\n\t\t\t\ttable.props.filter.enabled\n\t\t\t\tand hasattr(table.props.filter, \"results\")\n\t\t\t\tand table.props.filter.results.data\n\t\t\t\tand len(table.props.filter.results.data) \u003e 0\n\t\t\t):\n\t\t\t\tdata \u003d table.props.filter.results.data\n\t\t\telse:\n\t\t\t\tdata \u003d table.props.data\n\t\texcept Exception as e:\n\t\t\tsystem.perspective.print(\"Error getting data: %s\" % str(e))\n\t\t\tdata \u003d table.props.data\n\t\n\t\t# CSV columns and mapping to keys inside row[\"value\"]\n\t\tcolumn_order \u003d [\"ID\", \"StartTimestamp\", \"Duration\", \"Priority\", \"Location\", \"Description\", \"Tag\"]\n\t\tcolumn_map \u003d {\n\t\t\t\"ID\": \"NumberID\",\n\t\t\t\"StartTimestamp\": \"EventTimestamp\",\n\t\t\t\"Duration\": \"Duration\",\n\t\t\t\"Priority\": \"Priority\",\n\t\t\t\"Location\": \"Location\",\n\t\t\t\"Description\": \"Description\",\n\t\t\t\"Tag\": \"Tag\",\n\t\t}\n\t\n\t\tlines \u003d []\n\t\tlines.append(\",\".join(column_order))\n\t\n\t\tif data and len(data) \u003e 0:\n\t\t\tfor item in data:\n\t\t\t\t# unwrap {style, value} → just the inner value dict\n\t\t\t\trow_val \u003d item.get(\"value\", item)\n\t\n\t\t\t\trow_out \u003d []\n\t\t\t\tfor col in column_order:\n\t\t\t\t\ttry:\n\t\t\t\t\t\tkey \u003d column_map.get(col, col)\n\t\t\t\t\t\traw_value \u003d row_val.get(key, \"\")\n\t\n\t\t\t\t\t\tif col \u003d\u003d \"StartTimestamp\":\n\t\t\t\t\t\t\tprocessed_value \u003d format_timestamp(raw_value)\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\tprocessed_value \u003d safe_str(raw_value).replace(\",\", \";\")\n\t\n\t\t\t\t\t\trow_out.append(processed_value)\n\t\t\t\t\texcept Exception as e:\n\t\t\t\t\t\tsystem.perspective.print(\n\t\t\t\t\t\t\t\"Error processing column %s: %s\" % (col, str(e))\n\t\t\t\t\t\t)\n\t\t\t\t\t\trow_out.append(\"\")\n\t\t\t\tlines.append(\",\".join(row_out))\n\t\telse:\n\t\t\tlines.append(\"No alarms in current view\")\n\t\t\n\t\tcsv_content \u003d \"\\n\".join(lines)\n\t\n\texcept Exception as e:\n\t\terror_msg \u003d \"Export Error: %s\" % str(e)\n\t\tsystem.perspective.print(error_msg)\n\t\timport traceback\n\t\tsystem.perspective.print(traceback.format_exc())\n\t\tcsv_content \u003d \"Export failed: \" + error_msg\n\t\n\t# Download\n\ttry:\n\t\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\t\tsystem.perspective.download(\"active_alarms.csv\", csv_bytes)\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"Download error: %s\" % str(e))"
|
||
},
|
||
"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"
|
||
}
|
||
],
|
||
"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": [
|
||
{
|
||
"meta": {
|
||
"name": "Table"
|
||
},
|
||
"position": {
|
||
"basis": "",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"props.columns[4].filter.string.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": ".../FlexContainer/FlexContainer/Dropdown.props.value"
|
||
},
|
||
"type": "property"
|
||
}
|
||
},
|
||
"props.data": {
|
||
"binding": {
|
||
"config": {
|
||
"fallbackDelay": 2.5,
|
||
"mode": "indirect",
|
||
"references": {
|
||
"fc": "{session.custom.fc}"
|
||
},
|
||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsTable"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"code": "\tfrom system.dataset import toPyDataSet\n\t\n\tif value is None:\n\t return []\n\t\n\tds \u003d toPyDataSet(value)\n\tcols \u003d list(ds.columnNames)\n\tdata \u003d []\n\t\n\tfor row in ds:\n\t className \u003d row[\"Style\"] # style class from the dataset\n\t\n\t row_dict \u003d {}\n\t for col in cols:\n\t row_dict[col] \u003d {\n\t \"value\": row[col],\n\t \"style\": {\"classes\": className}\n\t }\n\t data.append(row_dict)\n\t\n\treturn data",
|
||
"type": "script"
|
||
}
|
||
],
|
||
"type": "tag"
|
||
}
|
||
},
|
||
"props.query": {
|
||
"binding": {
|
||
"config": {
|
||
"expression": "now(3000)"
|
||
},
|
||
"enabled": false,
|
||
"type": "expr"
|
||
},
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\tfrom system import date\n\timport system\n\t\n\t# Build one row for the table\n\tdef makeRow(number, eventTimeStamp, duration, priorityText, location, description, tag, styleClass):\n\t return {\n\t \"value\": {\n\t \"NumberID\": number,\n\t \"EventTimestamp\": eventTimeStamp,\n\t \"Duration\": duration,\n\t \"Priority\": priorityText,\n\t \"Location\": location,\n\t \"Description\": description,\n\t \"Tag\": tag\n\t },\n\t \"style\": {\n\t \"classes\": styleClass\n\t }\n\t }\n\t\n\t# Map priority text -\u003e style class\n\tdef styleClassFromPriority(priority_str):\n\t p \u003d (priority_str or \"\").lower()\n\t if p in (\"high\", \"critical\"):\n\t return \"Alarms-Styles/High\"\n\t elif p \u003d\u003d \"medium\":\n\t return \"Alarms-Styles/Medium\"\n\t elif p \u003d\u003d \"low\":\n\t return \"Alarms-Styles/Low\"\n\t elif p \u003d\u003d \"diagnostic\":\n\t return \"Alarms-Styles/Diagnostic\"\n\t else:\n\t return \"Alarms-Styles/NoAlarm\"\n\t\n\t# -------------------- 0) Priority filter from FilterStatus --------------------\n\ttry:\n\t filterVal \u003d self.parent.parent.getChild(\"FlexContainer\").getChild(\"FlexContainer\").custom.FilterStatus\n\texcept:\n\t filterVal \u003d None\n\t\n\tallPriorities \u003d [0, 1, 2, 3, 4]\n\t\n\tif filterVal is None:\n\t allowedPriorities \u003d allPriorities\n\telse:\n\t try:\n\t f \u003d int(filterVal)\n\t except:\n\t f \u003d -1\n\t\n\t if f \u003d\u003d 3: # High + Critical\n\t allowedPriorities \u003d [3, 4]\n\t elif f \u003d\u003d 2: # Medium and above\n\t allowedPriorities \u003d [2, 3, 4]\n\t elif f \u003d\u003d 1: # Low and above\n\t allowedPriorities \u003d [1, 2, 3, 4]\n\t elif f \u003d\u003d 0: # Diagnostic and above (all)\n\t allowedPriorities \u003d [0, 1, 2, 3, 4]\n\t else:\n\t allowedPriorities \u003d allPriorities\n\t\n\t# -------------------- 1) queryStatus (runtime only) ---------------------------\n\tresults \u003d system.alarm.queryStatus(\n\t state\u003d[\"ActiveUnacked\", \"ActiveAcked\"],\n\t priority\u003dallowedPriorities\n\t)\n\t\n\tif not results:\n\t self.props.data \u003d []\n\t return\n\t\n\tnow \u003d date.now()\n\tmidnightToday \u003d date.midnight(now)\n\tdata \u003d []\n\t\n\tfor idx, event in enumerate(results):\n\t try:\n\t displayPath \u003d event.getDisplayPath() or \"\"\n\t sourcePath \u003d event.getSource() or \"\"\n\t\n\t # Optional: skip startup/shutdown system events\n\t text \u003d displayPath + \" \" + sourcePath\n\t if \"System Startup\" in text or \"System Shutdown\" in text:\n\t continue\n\t\n\t # Associated data\n\t location \u003d event.getOrElse(\"myLocation\", \"\") or \"\"\n\t tagPath \u003d event.getOrElse(\"myTag\", \"\") or \"\"\n\t\n\t # Priority text from event / associated data\n\t priorityText \u003d str(event.getOrElse(\"priority\", event.getPriority()))\n\t\n\t # Event time for duration (when it went active)\n\t eventTime \u003d event.getOrElse(\"eventTime\", None)\n\t if eventTime:\n\t seconds \u003d date.secondsBetween(eventTime, now)\n\t durTime \u003d date.addSeconds(midnightToday, seconds)\n\t duration_str \u003d date.format(durTime, \"HH:mm:ss\")\n\t event_ts_str \u003d date.format(eventTime, \"yyyy-MM-dd HH:mm:ss\")\n\t else:\n\t duration_str \u003d \"00:00:00\"\n\t event_ts_str \u003d date.format(now, \"yyyy-MM-dd HH:mm:ss\")\n\t\n\t styleClass \u003d styleClassFromPriority(priorityText)\n\t\n\t # Description \u003d displayPath (fixed) + name from source\n\t if \":/alm:\" in sourcePath:\n\t desc_suffix \u003d sourcePath.split(\":/alm:\", 1)[1]\n\t else:\n\t desc_suffix \u003d sourcePath\n\t description \u003d (displayPath.replace(\"_\", \"-\") + \" \" + desc_suffix).strip()\n\t\n\t # NumberID: use alarm id if available, else index+30000 (similar to old logic)\n\t num_id \u003d event.getOrElse(\"id\", None)\n\t if num_id is None:\n\t num_id \u003d 30000 + idx\n\t\n\t data.append(\n\t makeRow(\n\t num_id,\n\t event_ts_str,\n\t duration_str,\n\t priorityText,\n\t location,\n\t description,\n\t tagPath,\n\t styleClass\n\t )\n\t )\n\t\n\t except Exception, e:\n\t system.perspective.print(\"Alarm row error (queryStatus only): %s\" % e)\n\t\n\tself.props.data \u003d data"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"columns": [
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "NumberID",
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": "Number (ID)"
|
||
},
|
||
"justify": "center",
|
||
"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": 40
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "EventTimestamp",
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": "Event Timestamp"
|
||
},
|
||
"justify": "center",
|
||
"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": "descending",
|
||
"sortable": true,
|
||
"strictWidth": false,
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"toggleSwitch": {
|
||
"color": {
|
||
"selected": "",
|
||
"unselected": ""
|
||
}
|
||
},
|
||
"viewParams": {},
|
||
"viewPath": "",
|
||
"visible": true,
|
||
"width": 60
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "Duration",
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"justify": "center",
|
||
"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": 40
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "Priority",
|
||
"filter": {
|
||
"boolean": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"date": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"enabled": false,
|
||
"number": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"string": {
|
||
"condition": "contains",
|
||
"value": ""
|
||
},
|
||
"visible": "always"
|
||
},
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"justify": "center",
|
||
"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": 30
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "Location",
|
||
"filter": {
|
||
"boolean": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"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": "Location"
|
||
},
|
||
"justify": "center",
|
||
"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": 40
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "Description",
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"justify": "center",
|
||
"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": 250
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY",
|
||
"editable": false,
|
||
"field": "Tag",
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "left",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"justify": "center",
|
||
"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": 200
|
||
}
|
||
],
|
||
"filter": {
|
||
"enabled": true,
|
||
"results": {
|
||
"enabled": true
|
||
}
|
||
},
|
||
"pager": {
|
||
"activeOption": 100
|
||
},
|
||
"query": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1764526300928
|
||
],
|
||
"$ts": 1764526300928
|
||
},
|
||
"sortOrder": [
|
||
"EventTimestamp"
|
||
],
|
||
"style": {
|
||
"margin": 25
|
||
}
|
||
},
|
||
"type": "ia.display.table"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "FlexContainer_0"
|
||
},
|
||
"position": {
|
||
"basis": "",
|
||
"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": [
|
||
{
|
||
"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\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,
|
||
1768672910731
|
||
],
|
||
"$ts": 1768672910729
|
||
},
|
||
"startDate": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1768672910730
|
||
],
|
||
"$ts": 1768671110729
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "Dropdown"
|
||
},
|
||
"position": {
|
||
"basis": "200px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\t# e.g. Dropdown onChange / propertyChange\n\tnow \u003d system.date.now()\n\ttoday0 \u003d system.date.setTime(now, 0, 0, 0) # today 00:00:00\n\tyday0 \u003d system.date.addDays(today0, -1) # yesterday 00:00:00\n\t\n\tval \u003d str(currentValue.value or \u0027\u0027).strip()\n\t\n\t# Custom range: let user pick dates, don\u0027t touch start/end.\n\tif val \u003d\u003d \"custom\":\n\t self.custom.customTime \u003d True\n\t return\n\t\n\tself.custom.customTime \u003d False\n\t\n\tdef t(day, h, m, s):\n\t \"\"\"time of day on a given day anchor\"\"\"\n\t return system.date.setTime(day, h, m, s)\n\t\n\tif val \u003d\u003d \"currentDay\":\n\t start, end \u003d today0, now\n\t\n\telif val \u003d\u003d \"morning\": # 02:30–07:30 today\n\t start, end \u003d t(today0, 2, 30, 0), t(today0, 7, 30, 0)\n\t\n\telif val \u003d\u003d \"daylight\": # 07:30–13:00 today\n\t start, end \u003d t(today0, 7, 30, 0), t(today0, 13, 0, 0)\n\t\n\telif val \u003d\u003d \"twilight\": # 13:00–now (if before 13:00, use 13:00 yesterday–now)\n\t if now \u003e\u003d t(today0, 13, 0, 0):\n\t start, end \u003d t(today0, 13, 0, 0), now\n\t else:\n\t start, end \u003d t(yday0, 13, 0, 0), now\n\t\n\telif val \u003d\u003d \"night\": # 18:30–23:30 yesterday (your original intent)\n\t start, end \u003d t(yday0, 18, 30, 0), t(yday0, 23, 30, 0)\n\t\n\telif val \u003d\u003d \"wrapDown\": # 23:30 yesterday – 02:30 today\n\t start, end \u003d t(yday0, 23, 30, 0), t(today0, 2, 30, 0)\n\t\n\telif val \u003d\u003d \"currentShot\": # alias of twilight per your use\n\t if now \u003e\u003d t(today0, 13, 0, 0):\n\t start, end \u003d t(today0, 13, 0, 0), now\n\t else:\n\t start, end \u003d t(yday0, 13, 0, 0), now\n\t\n\telse:\n\t # Treat any other value as \"last N minutes\"\n\t try:\n\t mins \u003d int(val)\n\t except:\n\t mins \u003d 60\n\t end \u003d now\n\t start \u003d system.date.addMinutes(end, -mins)\n\t\n\t# Final assign\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\n\tpass",
|
||
"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": 365
|
||
},
|
||
"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"
|
||
},
|
||
"props.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "../Dropdown.custom.startDate"
|
||
},
|
||
"type": "property"
|
||
},
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\tmessaging.message_handler.set_time_from_filters(self)\n\t\t\n\tif system.date.secondsBetween(self.props.value,self.getSibling(\"DateTimeInput_0\").props.value) \u003e 604800:\n\t\tself.getSibling(\"DateTimeInput_0\").props.value \u003d system.date.addSeconds(self.props.value,604800)"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"formattedValue": "Jan 17, 2026 9:23 AM",
|
||
"minDate": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1759755629641
|
||
],
|
||
"$ts": 1728219629641
|
||
},
|
||
"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\n\tpass",
|
||
"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": "if(dateDiff({../DateTimeInput.props.value},now(),\"day\") \u003c 7, now(),dateArithmetic({../DateTimeInput.props.value}, 7, \"days\"))"
|
||
},
|
||
"type": "expr"
|
||
}
|
||
},
|
||
"props.minDate": {
|
||
"binding": {
|
||
"config": {
|
||
"expression": "{../DateTimeInput.props.value}"
|
||
},
|
||
"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": "Jan 17, 2026 9:53 AM",
|
||
"style": {
|
||
"margin": 15
|
||
},
|
||
"value": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1768672910731
|
||
],
|
||
"$ts": 1768672910729
|
||
}
|
||
},
|
||
"scripts": {
|
||
"customMethods": [],
|
||
"extensionFunctions": null,
|
||
"messageHandlers": [
|
||
{
|
||
"messageType": "reset-historical-filters",
|
||
"pageScope": true,
|
||
"script": "#\tsystem.perspective.print(payload)\n#\treset \u003d payload[\"data\"]\n#\tself.props.value \u003d None\n\tpass",
|
||
"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": "132px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "Minumum 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": "All",
|
||
"value": ""
|
||
},
|
||
{
|
||
"label": "Diagnostic",
|
||
"value": "diagnostic"
|
||
},
|
||
{
|
||
"label": "Low",
|
||
"value": "low"
|
||
},
|
||
{
|
||
"label": "Medium",
|
||
"value": "medium"
|
||
},
|
||
{
|
||
"label": "High",
|
||
"value": "high"
|
||
}
|
||
],
|
||
"placeholder": {
|
||
"text": ""
|
||
},
|
||
"style": {
|
||
"margin": 15
|
||
}
|
||
},
|
||
"type": "ia.input.dropdown"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Label_0"
|
||
},
|
||
"position": {
|
||
"basis": "100px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "MCM"
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Dropdown_0"
|
||
},
|
||
"position": {
|
||
"basis": "200px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"persistent": false
|
||
}
|
||
},
|
||
"props": {
|
||
"options": [
|
||
{
|
||
"label": "All",
|
||
"value": ""
|
||
},
|
||
{
|
||
"label": "MCM01",
|
||
"value": "MCM01"
|
||
},
|
||
{
|
||
"label": "MCM02",
|
||
"value": "MCM02"
|
||
},
|
||
{
|
||
"label": "MCM03",
|
||
"value": "MCM03"
|
||
},
|
||
{
|
||
"label": "MCM04",
|
||
"value": "MCM04"
|
||
},
|
||
{
|
||
"label": "MCM05",
|
||
"value": "MCM05"
|
||
},
|
||
{
|
||
"label": "MCM06",
|
||
"value": "MCM06"
|
||
},
|
||
{
|
||
"label": "MCM07",
|
||
"value": "MCM07"
|
||
},
|
||
{
|
||
"label": "SMC",
|
||
"value": "SMC"
|
||
},
|
||
{
|
||
"label": "CMC",
|
||
"value": "CMC"
|
||
}
|
||
],
|
||
"placeholder": {
|
||
"text": "Filter MCMs..."
|
||
},
|
||
"style": {
|
||
"margin": 15
|
||
}
|
||
},
|
||
"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",
|
||
"shrink": 0
|
||
},
|
||
"propConfig": {
|
||
"custom.FilterStatus": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "./Priority/Dropdown.props.value"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"fallback": 0,
|
||
"inputType": "scalar",
|
||
"mappings": [
|
||
{
|
||
"input": "high",
|
||
"output": 3
|
||
},
|
||
{
|
||
"input": "medium",
|
||
"output": 2
|
||
},
|
||
{
|
||
"input": "low",
|
||
"output": 1
|
||
},
|
||
{
|
||
"input": "diagnostic",
|
||
"output": 0
|
||
}
|
||
],
|
||
"outputType": "scalar",
|
||
"type": "map"
|
||
}
|
||
],
|
||
"type": "property"
|
||
}
|
||
},
|
||
"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": [
|
||
{
|
||
"events": {
|
||
"component": {
|
||
"onRowDoubleClick": {
|
||
"config": {
|
||
"script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)"
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "AlarmsTable"
|
||
},
|
||
"position": {
|
||
"basis": "1920px",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"props.data": {
|
||
"binding": {
|
||
"config": {
|
||
"parameters": {
|
||
"endTime": "{.../Filters/Time/DateTimeInput_0.props.value}",
|
||
"location": "{.../Filters/Priority/Dropdown_0.props.value}",
|
||
"priority": "{.../Filters.custom.FilterStatus}",
|
||
"startTime": "{.../Filters/Time/DateTimeInput.props.value}"
|
||
},
|
||
"polling": {
|
||
"enabled": true,
|
||
"rate": "10"
|
||
},
|
||
"queryPath": "GetAlarmsWithCount"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"code": "\tfrom system.dataset import toPyDataSet\n\t\n\tds \u003d toPyDataSet(value)\n\tdata \u003d []\n\tcols \u003d list(ds.columnNames)\n\t\n\tfor row in ds:\n\t className \u003d row[\"Style\"] # style class from SQL result\n\t row_dict \u003d {}\n\t for col in cols:\n\t row_dict[col] \u003d {\n\t \"value\": row[col],\n\t \"style\": {\"classes\": className}\n\t }\n\t data.append(row_dict)\n\t\n\treturn data",
|
||
"type": "script"
|
||
}
|
||
],
|
||
"type": "query"
|
||
}
|
||
},
|
||
"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": "MM/DD/YYYY HH:mm:ss",
|
||
"editable": false,
|
||
"field": "FirstTimestamp",
|
||
"filter": {
|
||
"boolean": {
|
||
"condition": ""
|
||
},
|
||
"date": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"enabled": false,
|
||
"number": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"string": {
|
||
"condition": "",
|
||
"value": ""
|
||
},
|
||
"visible": "never"
|
||
},
|
||
"footer": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": ""
|
||
},
|
||
"header": {
|
||
"align": "center",
|
||
"justify": "center",
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"title": "First 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": 50
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "value",
|
||
"dateFormat": "MM/DD/YYYY HH:mm:ss",
|
||
"editable": false,
|
||
"field": "LastTimestamp",
|
||
"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": "Last 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": 50
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM-DD-YYYY HH:mm:ss",
|
||
"editable": false,
|
||
"field": "Count",
|
||
"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": "Count"
|
||
},
|
||
"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": "descending",
|
||
"sortable": true,
|
||
"strictWidth": false,
|
||
"style": {
|
||
"classes": ""
|
||
},
|
||
"toggleSwitch": {
|
||
"color": {
|
||
"selected": "",
|
||
"unselected": ""
|
||
}
|
||
},
|
||
"viewParams": {},
|
||
"viewPath": "",
|
||
"visible": true,
|
||
"width": 30
|
||
},
|
||
{
|
||
"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": ""
|
||
},
|
||
"title": "Duration"
|
||
},
|
||
"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": 40
|
||
},
|
||
{
|
||
"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": "equals",
|
||
"value": "medium"
|
||
},
|
||
"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": 40
|
||
},
|
||
{
|
||
"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": "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": 40
|
||
},
|
||
{
|
||
"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": 120
|
||
},
|
||
{
|
||
"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": "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": 150
|
||
}
|
||
],
|
||
"emptyMessage": {
|
||
"noData": {
|
||
"text": "No Alarms"
|
||
},
|
||
"noFilterResults": {
|
||
"text": "No Alarms"
|
||
}
|
||
},
|
||
"filter": {
|
||
"enabled": true,
|
||
"results": {
|
||
"enabled": true
|
||
}
|
||
},
|
||
"pager": {
|
||
"activeOption": 100
|
||
},
|
||
"sortOrder": [
|
||
"Count"
|
||
],
|
||
"style": {
|
||
"margin": 20
|
||
}
|
||
},
|
||
"type": "ia.display.table"
|
||
},
|
||
{
|
||
"children": [
|
||
{
|
||
"meta": {
|
||
"name": "Loading Animation"
|
||
},
|
||
"props": {
|
||
"fit": {
|
||
"mode": "contain"
|
||
},
|
||
"source": "/system/images/image-server/alarm-spinner.svg",
|
||
"style": {
|
||
"filter": "drop-shadow(0 4px 12px rgba(52, 152, 219, 0.2))",
|
||
"height": "min(120px, 15vw)",
|
||
"maxHeight": "120px",
|
||
"maxWidth": "120px",
|
||
"minHeight": "60px",
|
||
"minWidth": "60px",
|
||
"width": "min(120px, 15vw)"
|
||
}
|
||
},
|
||
"type": "ia.display.image"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Loading Text"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"color": "#c0392b",
|
||
"fontSize": "20px",
|
||
"fontWeight": 600,
|
||
"letterSpacing": "0.5px",
|
||
"marginTop": "16px",
|
||
"textAlign": "center",
|
||
"whiteSpace": "nowrap"
|
||
},
|
||
"text": "Loading Alarms..."
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Loading Subtext"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"color": "#7f8c8d",
|
||
"fontSize": "13px",
|
||
"fontWeight": "400",
|
||
"lineHeight": 1.4,
|
||
"marginTop": "6px",
|
||
"maxWidth": "300px",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "Loading alarm data... If empty, no alarms were found"
|
||
},
|
||
"type": "ia.display.label"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "Loading"
|
||
},
|
||
"position": {
|
||
"basis": "200px",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"position.display": {
|
||
"binding": {
|
||
"config": {
|
||
"expression": "if(len({../AlarmsTable.props.data}) \u003d 0,true,false)"
|
||
},
|
||
"type": "expr"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"alignItems": "center",
|
||
"direction": "column",
|
||
"justify": "center",
|
||
"style": {
|
||
"backdropFilter": "blur(4px)",
|
||
"bottom": 0,
|
||
"classes": "Background-Styles/Grey-Background",
|
||
"height": "100%",
|
||
"key": "value",
|
||
"position": "absolute",
|
||
"top": 0,
|
||
"width": "100%",
|
||
"zIndex": 10
|
||
}
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "FlexContainer_0"
|
||
},
|
||
"position": {
|
||
"basis": "980px",
|
||
"grow": 1
|
||
},
|
||
"props": {
|
||
"direction": "column",
|
||
"style": {
|
||
"position": "relative"
|
||
}
|
||
},
|
||
"type": "ia.container.flex"
|
||
},
|
||
{
|
||
"children": [
|
||
{
|
||
"events": {
|
||
"component": {
|
||
"onActionPerformed": {
|
||
"config": {
|
||
"script": "\tfrom datetime import datetime\n\t\n\tdef format_timestamp(ts):\n\t\tif not ts:\n\t\t\treturn \"\"\n\t\tts \u003d str(ts).strip()\n\t\ttry:\n\t\t\t# ISO format: \"2025-11-17 14:30:18.0\"\n\t\t\tif \".\" in ts:\n\t\t\t\tts \u003d ts.split(\".\")[0]\n\t\t\tif \"-\" in ts and len(ts.split(\"-\")[0]) \u003d\u003d 4:\n\t\t\t\tdt \u003d datetime.strptime(ts, \"%Y-%m-%d %H:%M:%S\")\n\t\t\t\treturn dt.strftime(\"%m/%d/%Y %H:%M:%S\")\n\t\t\t# JS Date string: \"Mon Nov 17 2025 14:21:26 GMT+0400...\"\n\t\t\tif \"GMT\" in ts:\n\t\t\t\tdt \u003d datetime.strptime(ts.split(\" GMT\")[0], \"%a %b %d %Y %H:%M:%S\")\n\t\t\t\treturn dt.strftime(\"%m/%d/%Y %H:%M:%S\")\n\t\texcept:\n\t\t\tpass\n\t\treturn str(ts)\n\t\n\ttry:\n\t # Get table component\n\t table \u003d self.parent.parent.getChild(\"FlexContainer_0\").getChild(\"AlarmsTable\")\n\t \n\t # Check if filtering is enabled and has results\n\t # Use filtered data if available, otherwise use all data\n\t if table.props.filter.enabled and table.props.filter.results.data and len(table.props.filter.results.data) \u003e 0:\n\t data \u003d table.props.filter.results.data\n\t else:\n\t data \u003d table.props.data\n\t\n\t column_order \u003d [\n\t \"FirstTimestamp\",\n\t \"LastTimestamp\", \n\t \"Count\",\n\t \"Duration\",\n\t \"Priority\",\n\t \"Location\",\n\t \"Description\",\n\t \"Tag\"\n\t ]\n\t\n\t csv_content \u003d \",\".join(column_order) + \"\\n\"\n\t \n\t def unwrap(v):\n\t if hasattr(v, \u0027value\u0027):\n\t return str(v.value)\n\t return str(v)\n\t\n\t if data and len(data) \u003e 0:\n\t for item in data:\n\t row_data \u003d []\n\t for col in column_order:\n\t if col in item:\n\t cell \u003d item[col]\n\t if isinstance(cell, dict) and \"value\" in cell:\n\t raw_value \u003d cell[\"value\"]\n\t else:\n\t raw_value \u003d cell\n\t else:\n\t raw_value \u003d \"\"\n\t\n\t # Format timestamp columns\n\t if col in [\"FirstTimestamp\", \"LastTimestamp\"]:\n\t processed_value \u003d format_timestamp(unwrap(raw_value))\n\t else:\n\t processed_value \u003d unwrap(raw_value).replace(\",\", \";\")\n\t \n\t row_data.append(processed_value)\n\t\n\t csv_content +\u003d \",\".join(row_data) + \"\\n\"\n\t else:\n\t csv_content +\u003d \"No alarms in current view\\n\"\n\t\n\texcept Exception as e:\n\t system.perspective.print(\"Export Error: \" + str(e))\n\t csv_content \u003d \"Export failed\\n\"\n\t\n\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\tsystem.perspective.download(\"hitList_alarms.csv\", csv_bytes)"
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "Export"
|
||
},
|
||
"position": {
|
||
"basis": "120px",
|
||
"shrink": 0
|
||
},
|
||
"props": {
|
||
"image": {
|
||
"icon": {
|
||
"path": "material/import_export"
|
||
}
|
||
},
|
||
"primary": false,
|
||
"style": {
|
||
"margin": 15,
|
||
"marginLeft": 20
|
||
},
|
||
"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": "FlexContainer"
|
||
},
|
||
"position": {
|
||
"basis": 100
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "Hit_List"
|
||
},
|
||
"position": {
|
||
"tabIndex": 1
|
||
},
|
||
"props": {
|
||
"direction": "column"
|
||
},
|
||
"type": "ia.container.flex"
|
||
},
|
||
{
|
||
"children": [
|
||
{
|
||
"children": [
|
||
{
|
||
"custom": {
|
||
"SetFilter": false
|
||
},
|
||
"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\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,
|
||
1765545872379
|
||
],
|
||
"$ts": 1765545872379
|
||
},
|
||
"startDate": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1765545872379
|
||
],
|
||
"$ts": 1765544072379
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "Dropdown"
|
||
},
|
||
"position": {
|
||
"basis": "200px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\t# e.g. Dropdown onChange / propertyChange\n\tnow \u003d system.date.now()\n\ttoday0 \u003d system.date.setTime(now, 0, 0, 0) # today 00:00:00\n\tyday0 \u003d system.date.addDays(today0, -1) # yesterday 00:00:00\n\t\n\tval \u003d str(currentValue.value or \u0027\u0027).strip()\n\t\n\t# Custom range: let user pick dates, don\u0027t touch start/end.\n\tif val \u003d\u003d \"custom\":\n\t self.custom.customTime \u003d True\n\t return\n\t\n\tself.custom.customTime \u003d False\n\t\n\tdef t(day, h, m, s):\n\t \"\"\"time of day on a given day anchor\"\"\"\n\t return system.date.setTime(day, h, m, s)\n\t\n\tif val \u003d\u003d \"currentDay\":\n\t start, end \u003d today0, now\n\t\n\telif val \u003d\u003d \"morning\": # 02:30–07:30 today\n\t start, end \u003d t(today0, 2, 30, 0), t(today0, 7, 30, 0)\n\t\n\telif val \u003d\u003d \"daylight\": # 07:30–13:00 today\n\t start, end \u003d t(today0, 7, 30, 0), t(today0, 13, 0, 0)\n\t\n\telif val \u003d\u003d \"twilight\": # 13:00–now (if before 13:00, use 13:00 yesterday–now)\n\t if now \u003e\u003d t(today0, 13, 0, 0):\n\t start, end \u003d t(today0, 13, 0, 0), now\n\t else:\n\t start, end \u003d t(yday0, 13, 0, 0), now\n\t\n\telif val \u003d\u003d \"night\": # 18:30–23:30 yesterday (your original intent)\n\t start, end \u003d t(yday0, 18, 30, 0), t(yday0, 23, 30, 0)\n\t\n\telif val \u003d\u003d \"wrapDown\": # 23:30 yesterday – 02:30 today\n\t start, end \u003d t(yday0, 23, 30, 0), t(today0, 2, 30, 0)\n\t\n\telif val \u003d\u003d \"currentShot\": # alias of twilight per your use\n\t if now \u003e\u003d t(today0, 13, 0, 0):\n\t start, end \u003d t(today0, 13, 0, 0), now\n\t else:\n\t start, end \u003d t(yday0, 13, 0, 0), now\n\t\n\telse:\n\t # Treat any other value as \"last N minutes\"\n\t try:\n\t mins \u003d int(val)\n\t except:\n\t mins \u003d 60\n\t end \u003d now\n\t start \u003d system.date.addMinutes(end, -mins)\n\t\n\t# Final assign\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\n\tpass",
|
||
"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": 365
|
||
},
|
||
"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"
|
||
},
|
||
"props.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "../Dropdown.custom.startDate"
|
||
},
|
||
"type": "property"
|
||
},
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\tmessaging.message_handler.set_time_from_filters(self)\n\t\t\n\tif system.date.secondsBetween(self.props.value,self.getSibling(\"DateTimeInput_0\").props.value) \u003e 604800:\n\t\tself.getSibling(\"DateTimeInput_0\").props.value \u003d system.date.addSeconds(self.props.value,604800)"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"formattedValue": "Dec 12, 2025 4:54 AM",
|
||
"minDate": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1759755629641
|
||
],
|
||
"$ts": 1728219629641
|
||
},
|
||
"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\n\tpass",
|
||
"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": "if(dateDiff({../DateTimeInput.props.value},now(),\"day\") \u003c 7, now(),dateArithmetic({../DateTimeInput.props.value}, 7, \"days\"))"
|
||
},
|
||
"type": "expr"
|
||
}
|
||
},
|
||
"props.minDate": {
|
||
"binding": {
|
||
"config": {
|
||
"expression": "{../DateTimeInput.props.value}"
|
||
},
|
||
"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": "Dec 12, 2025 5:24 AM",
|
||
"style": {
|
||
"margin": 15
|
||
},
|
||
"value": {
|
||
"$": [
|
||
"ts",
|
||
201,
|
||
1765545872379
|
||
],
|
||
"$ts": 1765545872379
|
||
}
|
||
},
|
||
"scripts": {
|
||
"customMethods": [],
|
||
"extensionFunctions": null,
|
||
"messageHandlers": [
|
||
{
|
||
"messageType": "reset-historical-filters",
|
||
"pageScope": true,
|
||
"script": "#\tsystem.perspective.print(payload)\n#\treset \u003d payload[\"data\"]\n#\tself.props.value \u003d None\n\tpass",
|
||
"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": "130px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "Minumum 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": "All",
|
||
"value": ""
|
||
},
|
||
{
|
||
"label": "Diagnostic",
|
||
"value": "diagnostic"
|
||
},
|
||
{
|
||
"label": "Low",
|
||
"value": "low"
|
||
},
|
||
{
|
||
"label": "Medium",
|
||
"value": "medium"
|
||
},
|
||
{
|
||
"label": "High",
|
||
"value": "high"
|
||
}
|
||
],
|
||
"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\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
}
|
||
]
|
||
},
|
||
"type": "ia.input.dropdown"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Label_0"
|
||
},
|
||
"position": {
|
||
"basis": "100px"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"fontFamily": "Arial",
|
||
"fontWeight": "bold",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "MCM"
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Dropdown_0"
|
||
},
|
||
"position": {
|
||
"basis": "200px"
|
||
},
|
||
"propConfig": {
|
||
"props.value": {
|
||
"persistent": false
|
||
}
|
||
},
|
||
"props": {
|
||
"options": [
|
||
{
|
||
"label": "All",
|
||
"value": ""
|
||
},
|
||
{
|
||
"label": "MCM01",
|
||
"value": "MCM01"
|
||
},
|
||
{
|
||
"label": "MCM02",
|
||
"value": "MCM02"
|
||
},
|
||
{
|
||
"label": "MCM03",
|
||
"value": "MCM03"
|
||
},
|
||
{
|
||
"label": "MCM04",
|
||
"value": "MCM04"
|
||
},
|
||
{
|
||
"label": "MCM05",
|
||
"value": "MCM05"
|
||
},
|
||
{
|
||
"label": "MCM06",
|
||
"value": "MCM06"
|
||
},
|
||
{
|
||
"label": "MCM07",
|
||
"value": "MCM07"
|
||
},
|
||
{
|
||
"label": "SMC",
|
||
"value": "SMC"
|
||
},
|
||
{
|
||
"label": "CMC",
|
||
"value": "CMC"
|
||
}
|
||
],
|
||
"placeholder": {
|
||
"text": "Filter MCMs..."
|
||
},
|
||
"style": {
|
||
"margin": 15
|
||
}
|
||
},
|
||
"scripts": {
|
||
"customMethods": [],
|
||
"extensionFunctions": null,
|
||
"messageHandlers": [
|
||
{
|
||
"messageType": "hjsgdfn",
|
||
"pageScope": false,
|
||
"script": "\tpass",
|
||
"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": {
|
||
"custom.FilterStatus": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "./Priority/Dropdown.props.value"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"fallback": 0,
|
||
"inputType": "scalar",
|
||
"mappings": [
|
||
{
|
||
"input": "high",
|
||
"output": 3
|
||
},
|
||
{
|
||
"input": "medium",
|
||
"output": 2
|
||
},
|
||
{
|
||
"input": "low",
|
||
"output": 1
|
||
},
|
||
{
|
||
"input": "diagnostic",
|
||
"output": 0
|
||
}
|
||
],
|
||
"outputType": "scalar",
|
||
"type": "map"
|
||
}
|
||
],
|
||
"type": "property"
|
||
}
|
||
},
|
||
"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": {
|
||
"amount": 0,
|
||
"device_filters": null,
|
||
"duration_filter": null,
|
||
"hasNext": true,
|
||
"hit_limit": false,
|
||
"loading": false,
|
||
"max_duration": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1748426336635
|
||
],
|
||
"$ts": 1747562336635
|
||
},
|
||
"page_size": 100,
|
||
"record_count": 0,
|
||
"source_id_filters": null,
|
||
"type_filters": null
|
||
},
|
||
"events": {
|
||
"component": {
|
||
"onRowDoubleClick": {
|
||
"config": {
|
||
"script": "\t\n\tmyData \u003d self.props.selection.data\n\n\talarms.alarm_click.handleClick(myData)"
|
||
},
|
||
"scope": "G",
|
||
"type": "script"
|
||
}
|
||
}
|
||
},
|
||
"meta": {
|
||
"name": "Table"
|
||
},
|
||
"position": {
|
||
"basis": "1920px",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"custom.priority_filters": {
|
||
"binding": {
|
||
"config": {
|
||
"path": ".../Filters/Priority/Dropdown.props.value"
|
||
},
|
||
"transforms": [
|
||
{
|
||
"expression": "coalesce({value},\u0027\u0027)",
|
||
"type": "expression"
|
||
}
|
||
],
|
||
"type": "property"
|
||
}
|
||
},
|
||
"custom.time_from_filter": {
|
||
"binding": {
|
||
"config": {
|
||
"path": ".../Filters/Time/DateTimeInput.props.value"
|
||
},
|
||
"type": "property"
|
||
}
|
||
},
|
||
"custom.time_to_filter": {
|
||
"binding": {
|
||
"config": {
|
||
"path": ".../Filters/Time/DateTimeInput_0.props.value"
|
||
},
|
||
"type": "property"
|
||
}
|
||
},
|
||
"props.columns[1].filter.date.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "this.custom.time_from_filter"
|
||
},
|
||
"enabled": false,
|
||
"transforms": [
|
||
{
|
||
"expression": "coalesce({value}, dateArithmetic(now(), -30, \"minute\"))",
|
||
"type": "expression"
|
||
}
|
||
],
|
||
"type": "property"
|
||
}
|
||
},
|
||
"props.columns[2].filter.date.value": {
|
||
"binding": {
|
||
"config": {
|
||
"path": "this.custom.time_to_filter"
|
||
},
|
||
"enabled": false,
|
||
"transforms": [
|
||
{
|
||
"expression": "coalesce({value},NOW())",
|
||
"type": "expression"
|
||
}
|
||
],
|
||
"type": "property"
|
||
}
|
||
},
|
||
"props.data": {
|
||
"binding": {
|
||
"config": {
|
||
"parameters": {
|
||
"endtime": "{this.custom.time_to_filter}",
|
||
"location": "{.../Filters/Priority/Dropdown_0.props.value}",
|
||
"priority": "{.../Filters.custom.FilterStatus}",
|
||
"starttime": "{this.custom.time_from_filter}"
|
||
},
|
||
"polling": {
|
||
"enabled": true,
|
||
"rate": "10"
|
||
},
|
||
"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": 30
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY HH:mm:ss",
|
||
"editable": false,
|
||
"field": "StartTimestamp",
|
||
"filter": {
|
||
"boolean": {
|
||
"condition": ""
|
||
},
|
||
"date": {
|
||
"condition": "later than date time",
|
||
"value": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1761236207089
|
||
],
|
||
"$ts": 1761234407082
|
||
}
|
||
},
|
||
"enabled": false,
|
||
"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": 60
|
||
},
|
||
{
|
||
"align": "center",
|
||
"boolean": "checkbox",
|
||
"dateFormat": "MM/DD/YYYY HH:mm:ss",
|
||
"editable": false,
|
||
"field": "EndTimestamp",
|
||
"filter": {
|
||
"boolean": {
|
||
"condition": ""
|
||
},
|
||
"date": {
|
||
"condition": "earlier than date time",
|
||
"value": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1761236207088
|
||
],
|
||
"$ts": 1761236207082
|
||
}
|
||
},
|
||
"enabled": false,
|
||
"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": "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": 60
|
||
},
|
||
{
|
||
"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": 40
|
||
},
|
||
{
|
||
"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": "contains",
|
||
"value": "medium"
|
||
},
|
||
"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": 30
|
||
},
|
||
{
|
||
"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": "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": 40
|
||
},
|
||
{
|
||
"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": 130
|
||
},
|
||
{
|
||
"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": "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": 150
|
||
}
|
||
],
|
||
"emptyMessage": {
|
||
"noData": {
|
||
"text": "No Alarms"
|
||
},
|
||
"noFilterResults": {
|
||
"text": "No Alarms"
|
||
}
|
||
},
|
||
"enabled": true,
|
||
"filter": {
|
||
"enabled": true,
|
||
"results": {
|
||
"enabled": true
|
||
}
|
||
},
|
||
"pager": {
|
||
"activeOption": 100
|
||
},
|
||
"style": {
|
||
"margin": 20
|
||
},
|
||
"total": "value"
|
||
},
|
||
"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": "\tval \u003d payload[\"data\"] if isinstance(payload, dict) and \"data\" in payload else payload\n\tif val \u003d\u003d \"reset\":\n\t self.props.data \u003d []\n\t self.custom.device_filters \u003d None\n\t self.custom.priority_filters \u003d None\n\t self.custom.source_id_filters \u003d None\n\t self.custom.time_from_filter \u003d None\n\t self.custom.time_to_filter \u003d None\n\t self.custom.type_filters \u003d None\n\t self.custom.duration_filter \u003d None\n\t self.props.enabled \u003d True",
|
||
"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
|
||
},
|
||
{
|
||
"messageType": "refreshHistoricalTable",
|
||
"pageScope": true,
|
||
"script": "\tself.refreshBinding(\"props.data\")",
|
||
"sessionScope": false,
|
||
"viewScope": true
|
||
}
|
||
]
|
||
},
|
||
"type": "ia.display.table"
|
||
},
|
||
{
|
||
"children": [
|
||
{
|
||
"meta": {
|
||
"name": "Loading Animation"
|
||
},
|
||
"props": {
|
||
"fit": {
|
||
"mode": "contain"
|
||
},
|
||
"source": "/system/images/image-server/alarm-spinner.svg",
|
||
"style": {
|
||
"filter": "drop-shadow(0 4px 12px rgba(52, 152, 219, 0.2))",
|
||
"height": "min(120px, 15vw)",
|
||
"maxHeight": "120px",
|
||
"maxWidth": "120px",
|
||
"minHeight": "60px",
|
||
"minWidth": "60px",
|
||
"width": "min(120px, 15vw)"
|
||
}
|
||
},
|
||
"type": "ia.display.image"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Loading Text"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"color": "#c0392b",
|
||
"fontSize": "20px",
|
||
"fontWeight": 600,
|
||
"letterSpacing": "0.5px",
|
||
"marginTop": "16px",
|
||
"textAlign": "center",
|
||
"whiteSpace": "nowrap"
|
||
},
|
||
"text": "Loading Alarms..."
|
||
},
|
||
"type": "ia.display.label"
|
||
},
|
||
{
|
||
"meta": {
|
||
"name": "Loading Subtext"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"color": "#7f8c8d",
|
||
"fontSize": "13px",
|
||
"fontWeight": "400",
|
||
"lineHeight": 1.4,
|
||
"marginTop": "6px",
|
||
"maxWidth": "300px",
|
||
"textAlign": "center"
|
||
},
|
||
"text": "Loading alarm data... If empty, no alarms were found"
|
||
},
|
||
"type": "ia.display.label"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "Loading"
|
||
},
|
||
"position": {
|
||
"basis": "200px",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"position.display": {
|
||
"binding": {
|
||
"config": {
|
||
"expression": "if(len({../Table.props.data}) \u003d 0,true,false)"
|
||
},
|
||
"type": "expr"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"alignItems": "center",
|
||
"direction": "column",
|
||
"justify": "center",
|
||
"style": {
|
||
"backdropFilter": "blur(4px)",
|
||
"bottom": 0,
|
||
"classes": "Background-Styles/Grey-Background",
|
||
"height": "100%",
|
||
"key": "value",
|
||
"position": "absolute",
|
||
"top": 0,
|
||
"width": "100%",
|
||
"zIndex": 10
|
||
}
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "Table"
|
||
},
|
||
"position": {
|
||
"basis": "980px",
|
||
"grow": 1
|
||
},
|
||
"props": {
|
||
"direction": "column",
|
||
"style": {
|
||
"position": "relative"
|
||
}
|
||
},
|
||
"scripts": {
|
||
"customMethods": [],
|
||
"extensionFunctions": null,
|
||
"messageHandlers": [
|
||
{
|
||
"messageType": "update-historical-data",
|
||
"pageScope": true,
|
||
"script": "#\tdata \u003d payload[\"data\"]\n#\tself.getChild(\"Table\").props.data \u003d data\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
}
|
||
]
|
||
},
|
||
"type": "ia.container.flex"
|
||
},
|
||
{
|
||
"children": [
|
||
{
|
||
"custom": {
|
||
"download_in_progress": true,
|
||
"enable_timeout": false,
|
||
"priority_filters": "medium",
|
||
"time_from_filter": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1759316536954
|
||
],
|
||
"$ts": 1756755000000
|
||
},
|
||
"time_to_filter": {
|
||
"$": [
|
||
"ts",
|
||
192,
|
||
1759316533389
|
||
],
|
||
"$ts": 1759271400000
|
||
},
|
||
"type_filters": null
|
||
},
|
||
"events": {
|
||
"component": {
|
||
"onActionPerformed": {
|
||
"config": {
|
||
"script": "\ttry:\n\t\t# Find Historical_tab\n\t\tcurrent \u003d self\n\t\thistorical_tab \u003d None\n\t\twhile current:\n\t\t\ttry:\n\t\t\t\tif hasattr(current, \u0027meta\u0027) and current.meta:\n\t\t\t\t\tname \u003d str(current.meta.name) if hasattr(current.meta, \u0027name\u0027) else \"\"\n\t\t\t\t\tif \u0027Historical\u0027 in name or \u0027historical\u0027 in name.lower():\n\t\t\t\t\t\thistorical_tab \u003d current\n\t\t\t\t\t\tbreak\n\t\t\texcept:\n\t\t\t\tpass\n\t\t\tcurrent \u003d current.parent if hasattr(current, \u0027parent\u0027) else None\n\t\t\n\t\tif not historical_tab:\n\t\t\traise Exception(\"Could not find Historical_tab\")\n\t\t\n\t\t# Find Table\n\t\ttable \u003d None\n\t\tfor path in [[\"root\", \"Table\", \"Table\"], [\"Table\", \"Table\"], [\"root\", \"Table\"], [\"Table\"]]:\n\t\t\ttry:\n\t\t\t\tcomp \u003d historical_tab\n\t\t\t\tfor name in path:\n\t\t\t\t\tcomp \u003d comp.getChild(name)\n\t\t\t\tif comp and hasattr(comp, \u0027props\u0027) and hasattr(comp.props, \u0027data\u0027):\n\t\t\t\t\ttable \u003d comp\n\t\t\t\t\tbreak\n\t\t\texcept:\n\t\t\t\tcontinue\n\t\t\n\t\tif not table:\n\t\t\traise Exception(\"Could not find table\")\n\t\t\n\t\t# Get data\n\t\tdata \u003d None\n\t\ttry:\n\t\t\tif table.props.filter.enabled and table.props.filter.results.data and len(table.props.filter.results.data) \u003e 0:\n\t\t\t\tdata \u003d table.props.filter.results.data\n\t\texcept:\n\t\t\tpass\n\t\t\n\t\tif not data:\n\t\t\tdata_raw \u003d table.props.data\n\t\t\tcol_names \u003d list(data_raw.getColumnNames()) if hasattr(data_raw, \u0027getColumnNames\u0027) else []\n\t\t\trow_count \u003d data_raw.getRowCount() if hasattr(data_raw, \u0027getRowCount\u0027) else 0\n\t\t\tdata \u003d []\n\t\t\tfor i in range(row_count):\n\t\t\t\trow_dict \u003d {}\n\t\t\t\tfor col_name in col_names:\n\t\t\t\t\ttry:\n\t\t\t\t\t\trow_dict[col_name] \u003d data_raw.getValueAt(i, col_name)\n\t\t\t\t\texcept:\n\t\t\t\t\t\trow_dict[col_name] \u003d None\n\t\t\t\tdata.append(row_dict)\n\t\t\n\t\tif not data:\n\t\t\traise Exception(\"No data available\")\n\t\t\n\t\tcolumn_order \u003d [\"ID\", \"StartTimestamp\", \"EndTimestamp\", \"Duration\", \"Description\", \"Priority\", \"Location\", \"Tag\"]\n\t\tcsv_content \u003d \",\".join(column_order) + \"\\n\"\n\t\t\n\t\tdef unwrap(v):\n\t\t\tif hasattr(v, \u0027value\u0027):\n\t\t\t\treturn str(v.value)\n\t\t\treturn str(v) if v is not None else \"\"\n\t\t\n\t\tdef format_timestamp(val):\n\t\t\tif not val:\n\t\t\t\treturn \"\"\n\t\t\ttry:\n\t\t\t\tval_str \u003d str(val).strip()\n\t\t\t\t# Check if it\u0027s a Unix timestamp (numeric string or int)\n\t\t\t\tif val_str.isdigit():\n\t\t\t\t\tts \u003d int(val_str)\n\t\t\t\t\t# If it\u0027s milliseconds, convert to seconds\n\t\t\t\t\tif ts \u003e 1000000000000:\n\t\t\t\t\t\tts \u003d ts / 1000\n\t\t\t\t\tfrom datetime import datetime\n\t\t\t\t\tdt \u003d datetime.fromtimestamp(ts)\n\t\t\t\t\treturn dt.strftime(\"%m/%d/%Y %H:%M:%S\")\n\t\t\texcept:\n\t\t\t\tpass\n\t\t\t# If already formatted or not a timestamp, return as-is\n\t\t\treturn str(val) if val else \"\"\n\t\t\n\t\tif data and len(data) \u003e 0:\n\t\t\tfor item in data:\n\t\t\t\trow_data \u003d []\n\t\t\t\tfor col in column_order:\n\t\t\t\t\tif col in item:\n\t\t\t\t\t\tcell \u003d item[col]\n\t\t\t\t\t\traw_value \u003d cell[\"value\"] if isinstance(cell, dict) and \"value\" in cell else cell\n\t\t\t\t\telse:\n\t\t\t\t\t\traw_value \u003d \"\"\n\t\t\t\t\t\n\t\t\t\t\tif col in [\"StartTimestamp\", \"EndTimestamp\"]:\n\t\t\t\t\t\tvalue \u003d format_timestamp(raw_value)\n\t\t\t\t\telse:\n\t\t\t\t\t\tvalue \u003d unwrap(raw_value).replace(\",\", \";\").replace(\"\\r\", \" \").replace(\"\\n\", \" \")\n\t\t\t\t\trow_data.append(value)\n\t\t\t\tcsv_content +\u003d \",\".join(row_data) + \"\\n\"\n\t\telse:\n\t\t\tcsv_content +\u003d \"No alarms in current view\\n\"\n\t\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"Export Error: \" + str(e))\n\t\tcsv_content \u003d \"Export failed\\n\"\n\t\n\tcsv_bytes \u003d csv_content.encode(\"utf-8\")\n\tsystem.perspective.download(\"historical_alarms.csv\", csv_bytes)"
|
||
},
|
||
"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\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-device-filters",
|
||
"pageScope": true,
|
||
"script": "#\tfilters \u003d payload[\"data\"]\n#\tself.custom.device_filters \u003d filters\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-message-filters",
|
||
"pageScope": true,
|
||
"script": "#\tfilters \u003d payload[\"data\"]\n#\tself.custom.message_filters \u003d filters\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-priority-filters",
|
||
"pageScope": true,
|
||
"script": "#\tfilters \u003d payload[\"data\"]\n#\tself.custom.priority_filters \u003d filters\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-from-filters",
|
||
"pageScope": true,
|
||
"script": "#\ttime \u003d payload[\"data\"]\n#\tself.custom.time_from_filter \u003d time\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-to-filters",
|
||
"pageScope": true,
|
||
"script": "#\ttime \u003d payload[\"data\"]\n#\tself.custom.time_to_filter \u003d time\n\tpass",
|
||
"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\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-type-filters",
|
||
"pageScope": true,
|
||
"script": "#\tfilters \u003d payload[\"data\"]\n#\tself.custom.type_filters \u003d filters\n\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
},
|
||
{
|
||
"messageType": "set-duration-filters",
|
||
"pageScope": true,
|
||
"script": "#\tduration \u003d payload[\"data\"]\n#\tself.custom.duration_filter \u003d duration\n#\tpass",
|
||
"sessionScope": false,
|
||
"viewScope": false
|
||
}
|
||
]
|
||
},
|
||
"type": "ia.input.button"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "FlexContainer"
|
||
},
|
||
"position": {
|
||
"basis": 100
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "Historical_tab"
|
||
},
|
||
"position": {
|
||
"tabIndex": 2
|
||
},
|
||
"props": {
|
||
"direction": "column"
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "TabContainer"
|
||
},
|
||
"position": {
|
||
"basis": "300px",
|
||
"grow": 1
|
||
},
|
||
"propConfig": {
|
||
"props.currentTabIndex": {
|
||
"onChange": {
|
||
"enabled": null,
|
||
"script": "\tlogger \u003d system.util.getLogger(\"DropdownTimeChange\")\n\n\ttry:\n\t\tif currentValue is None or currentValue.value is None:\n\t\t\tlogger.info(\"No currentValue, exiting.\")\n\t\t\treturn\n\n\t\tval_num \u003d int(currentValue.value)\n\t\tlogger.info(\"Tab index changed to: %d\" % val_num)\n\n\t\t# Get dropdown for each tab\n\t\tif val_num \u003d\u003d 1:\n\t\t\tdd \u003d self.getChild(\"Hit_List\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\")\n\t\t\tlogger.info(\"Selected Hit_List Dropdown.\")\n\t\telif val_num \u003d\u003d 2:\n\t\t\tdd \u003d self.getChild(\"Historical_tab\").getChild(\"root\").getChild(\"Filters\").getChild(\"Time\").getChild(\"Dropdown\")\n\t\t\tlogger.info(\"Selected Historical_tab Dropdown.\")\n\t\telse:\n\t\t\tlogger.info(\"Unhandled tab value: %s\" % str(val_num))\n\t\t\treturn\n\n\t\tnow \u003d system.date.now()\n\t\ttoday0 \u003d system.date.setTime(now, 0, 0, 0)\n\t\tyday0 \u003d system.date.addDays(today0, -1)\n\n\t\tval \u003d str(dd.props.value or \u0027\u0027).strip()\n\t\tlogger.info(\"Dropdown value: %s\" % val)\n\n\t\tif val \u003d\u003d \"custom\":\n\t\t\tdd.custom.customTime \u003d True\n\t\t\tlogger.info(\"Custom mode selected — skipping time overwrite.\")\n\t\t\treturn\n\t\tdd.custom.customTime \u003d False\n\n\t\tdef t(day, h, m, s):\n\t\t\treturn system.date.setTime(day, h, m, s)\n\n\t\tif val \u003d\u003d \"currentDay\":\n\t\t\tstart, end \u003d today0, now\n\t\telif val \u003d\u003d \"morning\":\n\t\t\tstart, end \u003d t(today0, 2, 30, 0), t(today0, 7, 30, 0)\n\t\telif val \u003d\u003d \"daylight\":\n\t\t\tstart, end \u003d t(today0, 7, 30, 0), t(today0, 13, 0, 0)\n\t\telif val \u003d\u003d \"twilight\":\n\t\t\tif now \u003e\u003d t(today0, 13, 0, 0):\n\t\t\t\tstart, end \u003d t(today0, 13, 0, 0), now\n\t\t\telse:\n\t\t\t\tstart, end \u003d t(yday0, 13, 0, 0), now\n\t\telif val \u003d\u003d \"night\":\n\t\t\tstart, end \u003d t(yday0, 18, 30, 0), t(yday0, 23, 30, 0)\n\t\telif val \u003d\u003d \"wrapDown\":\n\t\t\tstart, end \u003d t(yday0, 23, 30, 0), t(today0, 2, 30, 0)\n\t\telif val \u003d\u003d \"currentShot\":\n\t\t\tif now \u003e\u003d t(today0, 13, 0, 0):\n\t\t\t\tstart, end \u003d t(today0, 13, 0, 0), now\n\t\t\telse:\n\t\t\t\tstart, end \u003d t(yday0, 13, 0, 0), now\n\t\telse:\n\t\t\ttry:\n\t\t\t\tmins \u003d int(val)\n\t\t\texcept:\n\t\t\t\tmins \u003d 60\n\t\t\t\tlogger.warn(\"Invalid numeric value \u0027%s\u0027, defaulting to 60 min.\" % val)\n\t\t\tend \u003d now\n\t\t\tstart \u003d system.date.addMinutes(end, -mins)\n\n\t\t# Apply to dropdown\n\t\tdd.custom.startDate \u003d start\n\t\tdd.custom.endDate \u003d end\n\n\t\tlogger.info(\"Time range applied successfully: start\u003d%s | end\u003d%s\" %\n\t\t (system.date.format(start, \"yyyy-MM-dd HH:mm:ss\"),\n\t\t system.date.format(end, \"yyyy-MM-dd HH:mm:ss\")))\n\n\texcept Exception as e:\n\t\tlogger.error(\"Error in valueChanged: %s\" % str(e))"
|
||
}
|
||
}
|
||
},
|
||
"props": {
|
||
"contentStyle": {
|
||
"classes": "Background-Styles/Grey-Background"
|
||
},
|
||
"currentTabIndex": 2,
|
||
"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",
|
||
"Alarm Hit List",
|
||
"Historical"
|
||
]
|
||
},
|
||
"type": "ia.container.tab"
|
||
}
|
||
],
|
||
"meta": {
|
||
"name": "root"
|
||
},
|
||
"props": {
|
||
"style": {
|
||
"classes": "Background-Styles/Main-Background"
|
||
}
|
||
},
|
||
"type": "ia.container.flex"
|
||
}
|
||
} |