-
Notifications
You must be signed in to change notification settings - Fork 1
/
touchless_clockin_flow.json
1 lines (1 loc) · 15.6 KB
/
touchless_clockin_flow.json
1
[{"id":"5a6e7668.1e7d68","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ef1892db.f59ec","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0160ad","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#1717ff","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","reset":false},"themeState":{"base-color":{"default":"#0094CE","value":"#0160ad","edited":true},"page-titlebar-backgroundColor":{"value":"#0160ad","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#018af9","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0160ad","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Touchless Clock In System - UB","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"aed51038.faa28","type":"ui_tab","z":"","name":"Touchless Clockin System - University at Buffalo","icon":"'camera_front'","order":1,"disabled":false,"hidden":false},{"id":"cfad0780.ea68b8","type":"ui_group","z":"","name":"Person Details","tab":"aed51038.faa28","order":1,"disp":true,"width":6,"collapse":false},{"id":"56dfd340.79b9bc","type":"ui_group","z":"","name":"UBID Record","tab":"aed51038.faa28","order":4,"disp":true,"width":"6","collapse":false},{"id":"9fe9cf8f.ff24f","type":"ui_group","z":"","name":"All Clock-in/Clock-out Time Stamped","tab":"aed51038.faa28","order":2,"disp":true,"width":12,"collapse":false},{"id":"c5fd6195.f0f13","type":"ui_spacer","name":"spacer","group":"cfad0780.ea68b8","order":11,"width":1,"height":1},{"id":"acc494f9.bb16f8","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":5,"width":1,"height":1},{"id":"e973ff00.ab09b","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":7,"width":1,"height":1},{"id":"b30b63ed.c54a8","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":8,"width":1,"height":1},{"id":"23a676f4.99e79a","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":9,"width":1,"height":1},{"id":"b2572e46.428ed","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":10,"width":1,"height":1},{"id":"bc89935.674a07","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":11,"width":1,"height":1},{"id":"4d31adea.0f5af4","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":12,"width":1,"height":1},{"id":"9de0c1b6.95cb4","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":13,"width":1,"height":1},{"id":"f9d80852.184078","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":14,"width":1,"height":1},{"id":"e4681100.bd6d7","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":15,"width":1,"height":1},{"id":"e22f5fff.5c613","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":16,"width":1,"height":1},{"id":"d8aa3dbe.02367","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":17,"width":1,"height":1},{"id":"beb6cd08.a8ada","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":18,"width":1,"height":1},{"id":"c122bd4e.bbdaf","type":"ui_spacer","name":"spacer","group":"56dfd340.79b9bc","order":19,"width":1,"height":1},{"id":"2a79dfcc.228ca","type":"ui_group","z":"","name":"Registered UBIDs with Face Encoding","tab":"aed51038.faa28","order":3,"disp":true,"width":"6","collapse":false},{"id":"c2523cd6.63ed7","type":"ui_spacer","name":"spacer","group":"2a79dfcc.228ca","order":1,"width":1,"height":1},{"id":"f05ab26a.1bc06","type":"http request","z":"5a6e7668.1e7d68","name":"Get UBID & Names","method":"GET","ret":"obj","paytoqs":false,"url":"https://cvip-a44cd.firebaseio.com/ubidDb.json","tls":"","persist":false,"proxy":"","authType":"","x":330,"y":120,"wires":[["5a39db44.78f254"]]},{"id":"821b9d86.06ec4","type":"inject","z":"5a6e7668.1e7d68","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[["f05ab26a.1bc06"]]},{"id":"5a39db44.78f254","type":"function","z":"5a6e7668.1e7d68","name":"get Array of Objects (Ubid)","func":"var data = msg.payload\n\nvar arr = [],\n keys = Object.keys(data);\n\nfor(var i=0,n=keys.length;i<n;i++){\n arr[i] = data[keys[i]];\n}\n\n\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":120,"wires":[["5bb94201.07f98c","646c7f44.0d1aa"]]},{"id":"edf9ebd5.770688","type":"http request","z":"5a6e7668.1e7d68","name":"Get Timeclock","method":"GET","ret":"obj","paytoqs":false,"url":"https://cvip-a44cd.firebaseio.com/timeclock.json","tls":"","persist":false,"proxy":"","authType":"","x":320,"y":180,"wires":[["521a0e7.a09e0f"]]},{"id":"a72afcc2.7ced4","type":"ui_text","z":"5a6e7668.1e7d68","group":"cfad0780.ea68b8","order":2,"width":0,"height":0,"name":"","label":"Name","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":400,"wires":[]},{"id":"521a0e7.a09e0f","type":"function","z":"5a6e7668.1e7d68","name":"get Array of Objects ( Time Clock)","func":"var data = msg.payload\n\nvar arr = [],\n keys = Object.keys(data);\n\nfor(var i=0,n=keys.length;i<n;i++){\n arr[i] = data[keys[i]];\n}\n\n\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":180,"wires":[["38c7bbaf.734b44","99454955.1d06d8"]]},{"id":"eadaaa7b.075838","type":"inject","z":"5a6e7668.1e7d68","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":180,"wires":[["edf9ebd5.770688"]]},{"id":"4c9b6b40.52d164","type":"function","z":"5a6e7668.1e7d68","name":"Split Timeclock","func":"var Ubid = msg.payload;\nvar arraydata = global.get(\"timeclock\");\nvar length = arraydata.length;\n\nfor(var i=0;i<length;i++){\n if(arraydata[i][\"ubid\"]==Ubid){\n var data = arraydata[i];\n break;\n }\n else{\n var data = {\"userName\":\"UBID Not Found\",\n \"ubid\":\"UBID Not Found\"\n };\n }\n}\n\n\nvar name = data[\"userName\"];\nvar ubid = data[\"ubid\"];\nvar dayAndtime = data[\"dayAndTime\"];\n\nmsg1={payload : name};\nmsg2 = {payload : ubid};\nmsg3 ={payload : dayAndtime};\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":340,"y":460,"wires":[["a72afcc2.7ced4"],["777b8d53.5ed5c4","b67a50cf.6834d"],["ff0e9623.765738"]]},{"id":"777b8d53.5ed5c4","type":"ui_text","z":"5a6e7668.1e7d68","group":"cfad0780.ea68b8","order":1,"width":0,"height":0,"name":"","label":"UBID","format":"{{msg.payload}}","layout":"row-spread","x":630,"y":440,"wires":[]},{"id":"8019a810.b30e78","type":"ui_text_input","z":"5a6e7668.1e7d68","name":"","label":"Search UB ID","tooltip":"Enter UB ID","group":"cfad0780.ea68b8","order":4,"width":0,"height":0,"passthru":false,"mode":"number","delay":"0","topic":"","x":120,"y":460,"wires":[["4c9b6b40.52d164","992c2fe8.ecb26"]]},{"id":"38c7bbaf.734b44","type":"function","z":"5a6e7668.1e7d68","name":"timeclock Global","func":"global.set(\"timeclock\",msg.payload);\n","outputs":1,"noerr":0,"x":920,"y":180,"wires":[[]]},{"id":"5bb94201.07f98c","type":"function","z":"5a6e7668.1e7d68","name":"ubid_ list Global","func":"global.set(\"ubid_list\",msg.payload);\n","outputs":1,"noerr":0,"x":920,"y":120,"wires":[[]]},{"id":"ba73c5f9.313cb8","type":"ui_button","z":"5a6e7668.1e7d68","name":"","group":"56dfd340.79b9bc","order":3,"width":0,"height":0,"passthru":false,"label":"Add New UBID and Name","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":130,"y":820,"wires":[["5cebde34.68964"]]},{"id":"988b902c.497da","type":"ui_text_input","z":"5a6e7668.1e7d68","name":"","label":"Enter Person UBID","tooltip":"Enter Person UBID","group":"56dfd340.79b9bc","order":1,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"","x":150,"y":740,"wires":[["34e68b08.583754"]]},{"id":"b2017ab2.9aae68","type":"ui_text_input","z":"5a6e7668.1e7d68","name":"","label":"Enter Person Name","tooltip":"Enter Person Name","group":"56dfd340.79b9bc","order":2,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":150,"y":780,"wires":[["1bd2ea9a.525a95"]]},{"id":"a02c1eed.a4157","type":"http request","z":"5a6e7668.1e7d68","name":"Post UBID","method":"POST","ret":"obj","paytoqs":false,"url":"https://cvip-a44cd.firebaseio.com/ubidDb.json","tls":"","persist":false,"proxy":"","authType":"","x":570,"y":820,"wires":[[]]},{"id":"34e68b08.583754","type":"function","z":"5a6e7668.1e7d68","name":"new_ubid Global","func":"global.set(\"new_ubid\",msg.payload);\n","outputs":1,"noerr":0,"x":370,"y":740,"wires":[[]]},{"id":"1bd2ea9a.525a95","type":"function","z":"5a6e7668.1e7d68","name":"new_name Global","func":"global.set(\"new_name\",msg.payload);\n","outputs":1,"noerr":0,"x":370,"y":780,"wires":[[]]},{"id":"5cebde34.68964","type":"function","z":"5a6e7668.1e7d68","name":"Post new UBID ","func":"\nif(msg.payload==true){\n var json = {\n \"ubid\":global.get(\"new_ubid\"),\n \"name\":global.get(\"new_name\")\n };\n msg.payload = json\n return msg;\n}\n","outputs":1,"noerr":0,"x":360,"y":820,"wires":[["a02c1eed.a4157"]]},{"id":"c56d3b4a.b4c5d8","type":"comment","z":"5a6e7668.1e7d68","name":"UBID ADD System","info":"","x":190,"y":680,"wires":[]},{"id":"ff0e9623.765738","type":"ui_table","z":"5a6e7668.1e7d68","group":"cfad0780.ea68b8","name":"Day Time","order":5,"width":0,"height":0,"columns":[],"outputs":0,"cts":false,"x":560,"y":560,"wires":[]},{"id":"646c7f44.0d1aa","type":"ui_table","z":"5a6e7668.1e7d68","group":"56dfd340.79b9bc","name":"Available UBIDs","order":6,"width":4,"height":7,"columns":[],"outputs":0,"cts":false,"x":880,"y":60,"wires":[]},{"id":"7d3df7bb.0888a8","type":"ui_text","z":"5a6e7668.1e7d68","group":"56dfd340.79b9bc","order":4,"width":0,"height":0,"name":"","label":"Available UB ID Entries","format":"{{msg.payload}}","layout":"col-center","x":870,"y":20,"wires":[]},{"id":"182a6a80.f0b865","type":"ui_template","z":"5a6e7668.1e7d68","group":"cfad0780.ea68b8","name":"Clock Toolbar","order":3,"width":0,"height":0,"format":"<script id=\"titleScript\" type=\"text/javascript\">\n\n$(function() {\n if($('.md-toolbar-tools').length != 0){\n loadClock();\n }else setTimeout(loadClock, 500)\n});\n\nfunction loadClock(){\n $('#clock').remove();\n var toolbar = $('.md-toolbar-tools');\n \n var div = $('<div/>');\n var p = $('<p/ id=\"clock\">');\n \n div.append(p);\n div[0].style.margin = '5px 5px 5px auto';\n toolbar.append(div);\n\n function displayTitle(lh) {\n p.text(lh); \n }\n \n function upTime() {\n var d = new Date();\n p.text(d.toLocaleString());\n }\n\n if(document.clockInterval){ \n clearInterval(document.clockInterval);\n document.clockInterval = null;\n }\n \n document.clockInterval = setInterval(upTime,1000);\n}\n\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"global","x":140,"y":60,"wires":[[]]},{"id":"b67a50cf.6834d","type":"function","z":"5a6e7668.1e7d68","name":"Get Main Face","func":"\nubid=msg.payload\n\ntext = \"\\\\data\\\\faces\\\\main_faces\\\\\"+ ubid +\".jpg\";\nmsg.payload = text\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":520,"wires":[["9abac6bc.10a368"]]},{"id":"9abac6bc.10a368","type":"ui_template","z":"5a6e7668.1e7d68","group":"cfad0780.ea68b8","name":"Main Face","order":6,"width":5,"height":5,"format":"<h1>Person Face</h1>\n<div><img src={{msg.payload}}></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":750,"y":520,"wires":[[]]},{"id":"4e3a385f.ca9548","type":"fs-file-lister","z":"5a6e7668.1e7d68","name":"List of Time Clocked Images","start":"data\\faces\\time_faces","pattern":"*.jpg*","folders":"*","hidden":true,"lstype":"files","path":false,"single":true,"depth":0,"stat":false,"showWarnings":true,"x":380,"y":260,"wires":[["a320da96.f36648","98f40dd3.90e4f"]]},{"id":"5d184fbb.c8a83","type":"inject","z":"5a6e7668.1e7d68","name":"","topic":"","payload":"","payloadType":"date","repeat":"0.5","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":260,"wires":[["4e3a385f.ca9548"]]},{"id":"a320da96.f36648","type":"function","z":"5a6e7668.1e7d68","name":"List out All Time Clocked Images","func":"array_files = msg.payload;\ntext = \"\"\nfor(i = 0; i < array_files.length; i++)\n{\n a = \"<img src=\\\"\\\\data\\\\faces\\\\time_faces\\\\\"+array_files[i]+\"\\\" height:\\\"200\\ width:\\\"640\\\">\";\n text=text+a+\"\\n\";\n \n}\ntext = \"<div>\" +text+ \"</div>\"\nvar htmlContent = '<html>'+text+'</html>';\n\nmsg.payload = htmlContent;\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":220,"wires":[[]]},{"id":"967221d7.4e7b4","type":"ui_template","z":"5a6e7668.1e7d68","group":"9fe9cf8f.ff24f","name":"Display Images","order":1,"width":"0","height":"0","format":"\n<iframe src=\"\\data\\images.html\" height=\"800\" width=\"700\">\n</iframe>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":920,"y":660,"wires":[[]]},{"id":"be7780ea.fe7ad","type":"file","z":"5a6e7668.1e7d68","name":"Show Images","filename":"data\\images.html","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":880,"y":580,"wires":[[]]},{"id":"992c2fe8.ecb26","type":"function","z":"5a6e7668.1e7d68","name":"List out Time Clocked Images UBID Spec","func":"array_files = global.get(\"clock_imgs_list\");\nubid = msg.payload;\ntext = \"\"\nfor(i = 0; i < array_files.length; i++)\n{\n var str = array_files[i];\n var strFirstfour = str.substring(0,4);\n if(strFirstfour==ubid){\n a = \"<img src=\\\"\\\\data\\\\faces\\\\time_faces\\\\\"+array_files[i]+\"\\\" height:\\\"200\\ width:\\\"640\\\">\";\n text=text+a+\"\\n\";}\n \n}\ntext = \"<div>\" +text+ \"</div>\"\nvar htmlContent = '<html>'+text+'</html>';\n\nmsg1={payload : htmlContent};\nmsg2 = {payload : ubid};\n\nreturn [msg1,msg2];\n","outputs":2,"noerr":0,"x":560,"y":620,"wires":[["be7780ea.fe7ad"],["967221d7.4e7b4"]]},{"id":"98f40dd3.90e4f","type":"function","z":"5a6e7668.1e7d68","name":"Clock Images Name Array","func":"global.set(\"clock_imgs_list\",msg.payload);\n","outputs":1,"noerr":0,"x":670,"y":260,"wires":[[]]},{"id":"99454955.1d06d8","type":"ui_table","z":"5a6e7668.1e7d68","group":"2a79dfcc.228ca","name":"","order":2,"width":0,"height":0,"columns":[],"outputs":1,"cts":true,"x":930,"y":260,"wires":[["16f978c2.445a47"]]},{"id":"16f978c2.445a47","type":"function","z":"5a6e7668.1e7d68","name":"Split Timeclock from Table","func":"var data = msg.payload;\n\nvar name = data[\"userName\"];\nvar ubid = data[\"ubid\"];\nvar dayAndtime = data[\"dayAndTime\"];\n\nmsg1={payload : name};\nmsg2 = {payload : ubid};\nmsg3 ={payload : dayAndtime};\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":170,"y":380,"wires":[["a72afcc2.7ced4"],["777b8d53.5ed5c4","b67a50cf.6834d","992c2fe8.ecb26"],["ff0e9623.765738"]]}]