[ { "id": "4661b4e5.ec84d4", "type": "tab", "label": "Issues Report", "disabled": false, "info": "Dashboard to track issues resolution progress" }, { "id": "93856827.db8308", "type": "inject", "z": "4661b4e5.ec84d4", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": true, "onceDelay": "", "x": 153.6041717529297, "y": 343.6041564941406, "wires": [ [ "ec717877.79e028" ] ] }, { "id": "ec717877.79e028", "type": "function", "z": "4661b4e5.ec84d4", "name": "MAIN INPUTS", "func": "// INPUTS\n\nteamspace = \"***\"; // make sure you have permissions to acces this teamspace\nmodelID = \"***\"; // make sure you have permissions to acces this model or federation\n\n\n// ignore the rest\n\ntry{\n flow.set(\"teamspace\", teamspace);\n}catch(error){\n node.error(\"Missing teamspace\", msg);\n return;\n}\ntry{\n flow.set(\"modelID\", modelID);\n}catch(error){\n node.error(\"Missing modelID\", msg);\n return;\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 186.32066345214844, "y": 185.67135620117188, "wires": [ [ "877f6c5c.d3ddb8" ] ] }, { "id": "2c99ed74.f7d80a", "type": "http request", "z": "4661b4e5.ec84d4", "name": "", "method": "POST", "ret": "obj", "url": "{{{topic}}}", "tls": "", "x": 486.10418701171875, "y": 166.10415649414062, "wires": [ [ "7db2bd49.43132c" ] ] }, { "id": "7db2bd49.43132c", "type": "function", "z": "4661b4e5.ec84d4", "name": "cookie", "func": "var cookies = msg.responseCookies;\n\ntry{\n cookies[\"connect.sid\"];\n}catch(error){\n node.error(\"Invalid username or password\", msg);\n return;\n}\n\nmsg.headers = {\n \"content-type\":\"application/json\",\n \"Cookie\": \"connect.sid=\" + cookies[\"connect.sid\"][\"value\"]\n};\n\nflow.set(\"cookie\",msg.headers[\"Cookie\"]);\n\nreturn msg;\n\n", "outputs": 1, "noerr": 0, "x": 488.65985107421875, "y": 217.8560791015625, "wires": [ [ "3b16460f.5ec4a2" ] ] }, { "id": "877f6c5c.d3ddb8", "type": "function", "z": "4661b4e5.ec84d4", "name": "header", "func": "try{\n test = global.get(\"username\")[0];\n}catch(error){\n node.error(\"Login error - login at http://localhost:1880/ui/#/0\", msg);\n return;\n}\ntry{\n test = global.get(\"password\")[0];\n}catch(error){\n node.error(\"Login error - login at http://localhost:1880/ui/#/0\", msg);\n return;\n}\n\n\nmsg.payload = {\n \"username\": global.get(\"username\"), \n \"password\": global.get(\"password\")\n};\n\nmsg.topic = \"https://api1.www.3drepo.io/api/login\";\n\nmsg.headers = {'content-type':'application/json'};\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 488.0644226074219, "y": 117.2420425415039, "wires": [ [ "2c99ed74.f7d80a" ] ] }, { "id": "357f531a.5201d4", "type": "comment", "z": "4661b4e5.ec84d4", "name": "login", "info": "", "x": 489.97576904296875, "y": 70.31598663330078, "wires": [] }, { "id": "fcdf01e7.697e68", "type": "comment", "z": "4661b4e5.ec84d4", "name": "how to", "info": "log in at http://localhost:1880/ui/#/0 or http://yourVPS:1880/ui/#/0\nset your teamspace and model ID of Lego_House_Federation in MAIN INPUTS\ndeploy\ngo to http://localhost:1880/ui/#/1 or http://youtVPS:1880/ui/#/1 to see the results", "x": 164.7083282470703, "y": 90.5624771118164, "wires": [] }, { "id": "3799de03.a9f09a", "type": "ui_text_input", "z": "4661b4e5.ec84d4", "name": "", "label": "Username", "group": "28e93976.ad5d3e", "order": 1, "width": 0, "height": 0, "passthru": false, "mode": "text", "delay": "20", "topic": "", "x": 174.8542022705078, "y": 531.1041946411133, "wires": [ [ "fba91689.f8d098" ] ] }, { "id": "367081d1.32d336", "type": "ui_text_input", "z": "4661b4e5.ec84d4", "name": "", "label": "Password", "group": "28e93976.ad5d3e", "order": 2, "width": 0, "height": 0, "passthru": false, "mode": "password", "delay": "20", "topic": "", "x": 173.8818817138672, "y": 617.4974670410156, "wires": [ [ "ed5acfbe.58ae38" ] ] }, { "id": "fba91689.f8d098", "type": "function", "z": "4661b4e5.ec84d4", "name": "username", "func": "global.set(\"username\",msg.payload);", "outputs": 1, "noerr": 0, "x": 178.6041717529297, "y": 575.1363143920898, "wires": [ [] ] }, { "id": "ed5acfbe.58ae38", "type": "function", "z": "4661b4e5.ec84d4", "name": "password", "func": "global.set(\"password\",msg.payload);\n\n", "outputs": 1, "noerr": 0, "x": 171.9418487548828, "y": 659.1554565429688, "wires": [ [] ] }, { "id": "afe4e868.c61f48", "type": "comment", "z": "4661b4e5.ec84d4", "name": "login details", "info": "input your login details in dashboard at\n\nhttp://localhost:1880/ui/#/0\n\nset as global variable hence use only once for multiple flows", "x": 170.52085876464844, "y": 480.73380279541016, "wires": [] }, { "id": "e11e3496.619748", "type": "comment", "z": "4661b4e5.ec84d4", "name": "get issues", "info": "", "x": 752.2083740234375, "y": 65.5624771118164, "wires": [] }, { "id": "3b16460f.5ec4a2", "type": "function", "z": "4661b4e5.ec84d4", "name": "issues API", "func": "cookie = flow.get(\"cookie\");\n\nmsg.headers = {\n \"content-type\":\"application/json\",\n \"Cookie\": cookie\n};\n\nmsg.payload = \"https://api1.www.3drepo.io/api/\" + flow.get(\"teamspace\") + \"/\" + flow.get(\"modelID\") + \"/\" + \"issues.json\"\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 739.854248046875, "y": 122.35414123535156, "wires": [ [ "9272f589.3ddd5" ] ] }, { "id": "9272f589.3ddd5", "type": "http request", "z": "4661b4e5.ec84d4", "name": "", "method": "GET", "ret": "obj", "url": "{{{payload}}}", "tls": "", "x": 749.8438415527344, "y": 171.83329105377197, "wires": [ [ "49bbf49f.70b34c" ] ] }, { "id": "5fe5c1a6.e81838", "type": "comment", "z": "4661b4e5.ec84d4", "name": "simple counter", "info": "takes filter output, one or multiple revisions\n\nreturns quantities by metadata property", "x": 1035.9815673828125, "y": 64.45372009277344, "wires": [] }, { "id": "4e46553.30febac", "type": "function", "z": "4661b4e5.ec84d4", "name": "format", "func": "var data = [];\nvar labels = [];\nvar series = [];\nvar m = {};\n\nfor(var i=0; i Date.now() || msg.payload[i].due_date === undefined){\n before.push(msg.payload[i])\n }else{\n after.push(msg.payload[i])\n }\n }\n}\n\nreturn [{payload:before}, {payload:after}];", "outputs": 2, "noerr": 0, "x": 1045.596923828125, "y": 666.2101440429688, "wires": [ [ "4bb3b1e4.4453" ], [ "a440d538.c74978", "2c3d6b79.d61d14" ] ], "outputLabels": [ "before", "after" ] }, { "id": "88efbd53.5f5c7", "type": "comment", "z": "4661b4e5.ec84d4", "name": "issues by due date", "info": "", "x": 1053.7684326171875, "y": 566.3333129882812, "wires": [] }, { "id": "cfc68519.2898a8", "type": "function", "z": "4661b4e5.ec84d4", "name": "count by properties", "func": "var assigned = flow.get(\"assigned\");\nvar priority = flow.get(\"priority\");\nvar priorityLabel = flow.get(\"priorityLabel\");\n\ncounter = {};\n\nfor(var i=0; i l){\n assignFormated.push(assigned[i].substring(0,l) + \"...\");\n }else{\n assignFormated.push(assigned[i])\n }\n}\n \nm.labels = assignFormated;\nm.series = flow.get(\"priority\");\nm.data = dataFormated;\nreturn {payload:[m]};", "outputs": 1, "noerr": 0, "x": 540.6861572265625, "y": 547.2645263671875, "wires": [ [ "8d9f07d.64ae378" ] ] }, { "id": "8d9f07d.64ae378", "type": "ui_chart", "z": "4661b4e5.ec84d4", "name": "", "group": "3243c41a.026d74", "order": 1, "width": "16", "height": "4", "label": "By Job & Priority", "chartType": "bar", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "", "ymax": "", "removeOlder": 1, "removeOlderPoints": "", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "colors": [ "#9b9b9b", "#008000", "#fdd842", "#ca0000", "#98df8a", "#ff8000", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": false, "x": 762.7645874023438, "y": 547.116455078125, "wires": [ [], [] ] }, { "id": "e63450b0.3bbdf", "type": "comment", "z": "4661b4e5.ec84d4", "name": "simple counter", "info": "takes filter output, one or multiple revisions\n\nreturns quantities by metadata property", "x": 1048.3426513671875, "y": 300.98155212402344, "wires": [] }, { "id": "1d279534.900293", "type": "function", "z": "4661b4e5.ec84d4", "name": "format", "func": "var data = [];\nvar labels = [];\nvar series = [];\nvar m = {};\n\nfor(var i=0; i\n td {\n height: 30px;\n }\n \n a:link {\n color: black;\n background-color: transparent;\n text-decoration: none;\n}\na:visited {\n color: black;\n background-color: transparent;\n text-decoration: none;\n}\na:hover {\n color: gray;\n background-color: transparent;\n text-decoration: underline;\n}\n\n\n\n \n \n \n \n \n \n \n\n \n
{{x.name}}{{x.priority}}{{x.status}}{{x.type}}{{x.assign}}{{x.date}}
", "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", "x": 1224.036865234375, "y": 618.7592163085938, "wires": [ [] ] }, { "id": "4bb3b1e4.4453", "type": "function", "z": "4661b4e5.ec84d4", "name": "format", "func": "var result = []\n\nfor(var i=0; i l){\n assignFormated.push(assigned[i].substring(0,l) + \"...\");\n }else{\n assignFormated.push(assigned[i])\n }\n}\n \nm.labels = assignFormated;\nm.series = flow.get(\"priority\");\nm.data = dataFormated;\nreturn {payload:[m]};", "outputs": 1, "noerr": 0, "x": 535.2694702148438, "y": 752.8201293945312, "wires": [ [ "3afb77c4.bb8458" ] ] }, { "id": "3afb77c4.bb8458", "type": "ui_chart", "z": "4661b4e5.ec84d4", "name": "", "group": "3243c41a.026d74", "order": 1, "width": "16", "height": "4", "label": "By Job & Status", "chartType": "bar", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "", "ymax": "", "removeOlder": 1, "removeOlderPoints": "", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "colors": [ "#9b9b9b", "#008000", "#fdd842", "#ca0000", "#98df8a", "#ff8000", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": false, "x": 757.347900390625, "y": 752.6720581054688, "wires": [ [], [] ] }, { "id": "8936e496.4cbf98", "type": "comment", "z": "4661b4e5.ec84d4", "name": "issues by assigned & status", "info": "", "x": 535.43505859375, "y": 644.9444580078125, "wires": [] }, { "id": "2ed281ab.d3123e", "type": "ui_template", "z": "4661b4e5.ec84d4", "group": "40be3bb0.ae9f6c", "name": "Overdue Issues", "order": 3, "width": "22", "height": "2", "format": "\n\n\n \n \n \n \n \n \n \n\n \n
{{x.name}}{{x.priority}}{{x.status}}{{x.type}}{{x.assign}}{{x.date}}
", "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", "x": 1237.6484375, "y": 716.537109375, "wires": [ [] ] }, { "id": "2c3d6b79.d61d14", "type": "function", "z": "4661b4e5.ec84d4", "name": "format", "func": "var result = []\n\nfor(var i=0; i