Dashboard z Luxriot

[ { "id": "luxriot_http_in", "type": "http in", "z": "1", "name": "Odbiór alarmu Luxriot", "url": "/luxriot_alarm", "method": "post", "upload": false, "swaggerDoc": "", "x": 160, "y": 100, "wires": [["luxriot_json_parser", "http_response"]] }, { "id": "http_response", "type": "http response", "z": "1", "name": "OK response", "statusCode": "200", "x": 400, "y": 100, "wires": [] }, { "id": "luxriot_json_parser", "type": "function", "z": "1", "name": "Zapisz zdarzenie", "func": "// Pobierz bieżącą listę zdarzeń\nlet events = flow.get('luxriot_events') || [];\n\nlet newEvent = {\n camera: msg.payload.camera || "Nieznana kamera",\n event: msg.payload.event || "Alarm",\n time: msg.payload.time || new Date().toISOString()\n};\n\n// Dodaj nowe zdarzenie na początek\nevents.unshift(newEvent);\n\n// Ogranicz do ostatnich 10\nevents = events.slice(0,10);\n\nflow.set('luxriot_events', events);\n\nreturn { payload: events };", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 170, "y": 180, "wires": [["luxriot_ui_table"]] }, { "id": "luxriot_ui_table", "type": "ui_template", "z": "1", "group": "luxriot_dashboard_group", "name": "Tabela alarmów", "order": 0, "width": 0, "height": 0, "format": "<table border="1" width="100%">\n \n Kamera\n Zdarzenie\n Czas\n \n \n <tr ng-repeat="row in msg.payload">\n {{row.camera}}\n {{row.event}}\n {{row.time | date:'HH:mm:ss'}}\n \n \n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "x": 440, "y": 180, "wires": [] }, { "id": "luxriot_dashboard_group", "type": "ui_group", "name": "Luxriot Intruz", "tab": "luxriot_dashboard_tab", "order": 1, "disp": true, "width": "12", "collapse": false }, { "id": "luxriot_dashboard_tab", "type": "ui_tab", "name": "Monitoring", "icon": "dashboard", "order": 1 } ]

[{"id":"luxriot_http_in","type":"http in","z":"1","name":"Odbiór alarmu Luxriot","url":"/luxriot_alarm","method":"post","upload":false,"swaggerDoc":"","x":160,"y":100,"wires":[["luxriot_json_parser","http_response"]]},{"id":"http_response","type":"http response","z":"1","name":"OK response","statusCode":"200","x":400,"y":100,"wires":[]},{"id":"luxriot_json_parser","type":"function","z":"1","name":"Zapisz zdarzenie","func":"// Pobierz bieżącą listę zdarzeń\nlet events = flow.get('luxriot_events') || [];\n\nlet newEvent = {\n    camera: msg.payload.camera || \"Nieznana kamera\",\n    event: msg.payload.event || \"Alarm\",\n    time: msg.payload.time || new Date().toISOString()\n};\n\n// Dodaj nowe zdarzenie na początek\nevents.unshift(newEvent);\n\n// Ogranicz do ostatnich 10\nevents = events.slice(0,10);\n\nflow.set('luxriot_events', events);\n\nreturn { payload: events };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":170,"y":180,"wires":[["luxriot_ui_table"]]},{"id":"luxriot_ui_table","type":"ui_template","z":"1","group":"luxriot_dashboard_group","name":"Tabela alarmów","order":0,"width":0,"height":0,"format":"<table border=\"1\" width=\"100%\">\n  <tr>\n    <th>Kamera</th>\n    <th>Zdarzenie</th>\n    <th>Czas</th>\n  </tr>\n  <tbody>\n    <tr ng-repeat=\"row in msg.payload\">\n      <td>{{row.camera}}</td>\n      <td>{{row.event}}</td>\n      <td>{{row.time | date:'HH:mm:ss'}}</td>\n    </tr>\n  </tbody>\n</table>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":440,"y":180,"wires":[]},{"id":"luxriot_dashboard_group","type":"ui_group","name":"Luxriot Intruz","tab":"luxriot_dashboard_tab","order":1,"disp":true,"width":"12","collapse":false},{"id":"luxriot_dashboard_tab","type":"ui_tab","name":"Monitoring","icon":"dashboard","order":1}]

Flow Info

Created 4 days ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • function (x1)
  • http in (x1)
  • http response (x1)
Other
  • ui_group (x1)
  • ui_tab (x1)
  • ui_template (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option