BNA8/.resources/6d9d6f7af76351ae02957176df574038a4c4569c6ae018dcfddd1db8e5ebec6d

495 lines
14 KiB
Plaintext

{
"custom": {
"isMaint": false
},
"params": {
"titleExtra": "0 of 0"
},
"propConfig": {
"custom.isMaint": {
"binding": {
"config": {
"path": "session.props.auth.user.roles"
},
"transforms": [
{
"code": "\ttabs \u003d []\n\troles \u003d [\"Administrator\", \"Developer\", \"Supervisor\"]\n\treturn value !\u003d None and len(value) \u003e 0 and len([i for i in value if i in roles]) \u003e 0",
"type": "script"
}
],
"type": "property"
},
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 324,
"width": 1600
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 40,
"width": "100%"
},
"props": {
"style": {
"backgroundColor": "#1A4A5E",
"borderBottomColor": "#000000",
"borderBottomStyle": "solid",
"borderBottomWidth": "2px",
"color": "#fff",
"fontFamily": "Helvetica",
"fontSize": 20,
"fontWeight": "bold",
"textAlign": "center"
},
"text": "Jam Cameras"
},
"type": "ia.display.label"
},
{
"events": {
"component": {
"onEditCellCommit": {
"config": {
"script": "\t# Update jam cameras:\n\tdata \u003d system.dataset.updateRow(self.props.data, event.row, {\n\t\tevent.column: event.value\n\t})\n\tsystem.tag.writeBlocking([\"[default]Gateway/JamCameras\"], [data])"
},
"scope": "G",
"type": "script"
}
},
"dom": {
"onKeyDown": {
"config": {
"script": "\tif event.key \u003d\u003d \"Escape\": # Escape key\n\t\tself.props.selection.selectedColumn \u003d None\n\t\tself.props.selection.selectedRow \u003d None"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "JamCameras"
},
"position": {
"height": "calc(100% - 40px)",
"width": "100%",
"y": 40
},
"propConfig": {
"props.columns[0].editable": {
"binding": {
"config": {
"path": "view.custom.isMaint"
},
"type": "property"
}
},
"props.columns[1].editable": {
"binding": {
"config": {
"path": "view.custom.isMaint"
},
"type": "property"
}
},
"props.data": {
"binding": {
"config": {
"bidirectional": true,
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[default]Gateway/JamCameras"
},
"type": "tag"
}
}
},
"props": {
"cells": {
"style": {
"borderBottomColor": "#D5D5D5",
"borderBottomStyle": "solid",
"borderBottomWidth": "2px",
"borderRightColor": "#D5D5D5",
"borderRightStyle": "solid",
"borderRightWidth": "2px",
"color": "#000",
"fontFamily": "Helvetica",
"fontSize": "14px"
}
},
"columns": [
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"field": "Name",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": "table/column-header"
},
"title": ""
},
"justify": "auto",
"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": "value",
"dateFormat": "MM/DD/YYYY",
"field": "Address",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": "table/column-header"
},
"title": ""
},
"justify": "auto",
"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": 300
}
],
"filter": {
"enabled": true
},
"pager": {
"bottom": false
},
"rows": {
"highlight": {
"enabled": false
},
"striped": {
"enabled": false
},
"style": {
"classes": "table/highlight"
}
},
"style": {
"fontFamily": "Helvetica",
"fontSize": "14px",
"fontWeight": "bold"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "export-data",
"pageScope": true,
"script": "\tutils.downloadCSV(self, \"JamCameras\")",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.display.table"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tcameras \u003d self.getSibling(\"JamCameras\")\n\tnewRow \u003d [\"New Jam Camera\", \"http://localhost\"]\n\tdata \u003d system.dataset.addRow(cameras.props.data, newRow)\n\tsystem.tag.writeBlocking([\"[default]Gateway/JamCameras\"], [data])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button_New"
},
"position": {
"height": 34,
"width": 140,
"x": "calc(100% - 435px)",
"y": 48
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": " {view.custom.isMaint}\r\n\u0026\u0026 len({../JamCameras.props.data}) \u003c 32"
},
"type": "expr"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.isMaint"
},
"transforms": [
{
"fallback": "Buttons/Grey",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Buttons/Green"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {},
"text": "Add New"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tcameras \u003d self.getSibling(\"JamCameras\")\n\trow \u003d cameras.props.selection.selectedRow\n\tdata \u003d system.dataset.deleteRow(cameras.props.data, row)\n\tsystem.tag.writeBlocking([\"[default]Gateway/JamCameras\"], [data])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button_Delete"
},
"position": {
"height": 34,
"width": 140,
"x": "calc(100% - 290px)",
"y": 48
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": " {view.custom.isMaint}\r\n\u0026\u0026 {../JamCameras.props.selection.selectedRow} !\u003d null"
},
"type": "expr"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.isMaint"
},
"transforms": [
{
"fallback": "Buttons/Grey",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Buttons/Red"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {},
"text": "Delete Selected"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tcameras \u003d self.getSibling(\"JamCameras\")\n\turl \u003d cameras.props.data.getValueAt(cameras.props.selection.selectedRow, \"Address\")\n\tsystem.perspective.navigate(url\u003durl, newTab\u003dTrue)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button_Open"
},
"position": {
"height": 34,
"width": 140,
"x": "calc(100% - 145px)",
"y": 48
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "{../JamCameras.props.selection.selectedRow} !\u003d null"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "Open Selected"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.sendMessage(\"export-data\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button_Export"
},
"position": {
"height": 30,
"width": 100,
"x": "calc(100% - 105px)",
"y": 5
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "Export"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.coord"
}
}