Is it posible to block a part of the UI until a button is pressed?


#1

this is the flow I´m working on:

[{"id":"9fc21c3e.61909","type":"tab","label":"Light DMC w/SQL dropdown 2.0","disabled":false,"info":""},{"id":"6f3c7d4a.c60a04","type":"function","z":"9fc21c3e.61909","name":"Counter","func":"// Asign the value of the global variable count to the local variable count. \n// It's a way of checking if reset has been made.\nvar count = global.get('count') || 0;\nif(msg.payload === "1") {\n count ++;\n global.set('count', count);\n// Update the value of the global variable count.\n}\n \n //msg.partscount = context.global.count;\n //msg.payload = context.global.count; \n//Asign the value of local count to partscount. \n//msg = { payload : count.toString()};\n\nmsg = { payload : count};\nreturn msg;\n\n// Programmed by Faurecia in Javascript.","outputs":1,"noerr":0,"x":880,"y":240,"wires":[["9678ea0.2a26618","7acd952d.cbaffc","201b53dd.b34fac","9f0eb148.613cb"]]},{"id":"4855d5b1.057b9c","type":"inject","z":"9fc21c3e.61909","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":510,"y":260,"wires":[["6f3c7d4a.c60a04","f39c8d46.ba3d8","498b389a.26d428"]]},{"id":"b8cb9d3f.8b812","type":"function","z":"9fc21c3e.61909","name":"Counter Reset","func":"var count = 0;\nif (msg.payload === "1"){\n msg.partscount = 0;\n}\ncont =0;\nmsg.partscount = 0;\n// Reset the value of partscount to 0, when payload is "0".\nglobal.set('count', 0);\n// Reset the value of the global variable count to 0.\nreturn msg;\n","outputs":1,"noerr":0,"x":900,"y":280,"wires":[["6f3c7d4a.c60a04"]]},{"id":"fe35f61d.5957e8","type":"inject","z":"9fc21c3e.61909","name":"","topic":"","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":510,"y":200,"wires":[["b8cb9d3f.8b812"]]},{"id":"9678ea0.2a26618","type":"ui_chart","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":19,"width":"26","height":"1","label":"Currenly Counter","chartType":"bar","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":true,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":1210,"y":280,"wires":[,]},{"id":"aacf38bb.8fa7e8","type":"average-bars","z":"9fc21c3e.61909","name":"average-bars","title":"","period":"day","yMin":"0","yMax":"100","showBarsValue":false,"showScaleValue":true,"showLastValue":true,"showAverageValue":false,"showMinimumValue":false,"showMaximumValue":false,"maxBar":"200","topColor":"#0080ff","bottomColor":"#0080ff","unit":"","fontColor":"#ff0000","barStyle":"Equalizer","decimal":"0","x":1090,"y":360,"wires":[["2b830b11.2c5684"]]},{"id":"2b830b11.2c5684","type":"ui_template","z":"9fc21c3e.61909","group":"f84b9d51.64916","name":"","order":33,"width":"26","height":"10","format":"<div ng-bind-html="msg.payload">","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1240,"y":360,"wires":[]},{"id":"e94284d0.34ad18","type":"inject","z":"9fc21c3e.61909","name":"","topic":"0","payload":"","payloadType":"date","repeat":"","crontab":"0 0-23 * * *","once":false,"onceDelay":0.1,"x":480,"y":380,"wires":[["498b389a.26d428","c41abcfc.568db"]]},{"id":"119603a7.9e446c","type":"ui_numeric","z":"9fc21c3e.61909","name":"","label":"Daily Counter","group":"f84b9d51.64916","order":31,"width":"26","height":"1","passthru":true,"topic":"","format":"{{value}}","min":0,"max":"1000","step":"1","x":1120,"y":80,"wires":[]},{"id":"2e59a7ad.ec5fb8","type":"debug","z":"9fc21c3e.61909","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1542,"y":980,"wires":},{"id":"8dc70764.83b1f8","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":22,"width":"5","height":"3","passthru":false,"label":"Line stoppage","color":"white","bgcolor":"red","icon":"build","payload":"Line stoppage","payloadType":"str","topic":"","x":1150,"y":820,"wires":[["2e59a7ad.ec5fb8","8fdb4ff1.aa37b"]]},{"id":"fc2378bf.7eefb8","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":21,"width":"5","height":"3","passthru":false,"label":"No Production planned","color":"white","bgcolor":"black","icon":"av_timer","payload":"No Production planned","payloadType":"str","topic":"","x":1170,"y":860,"wires":[["2e59a7ad.ec5fb8","8fdb4ff1.aa37b"]]},{"id":"35df9889.41df98","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":26,"width":"5","height":"3","passthru":false,"label":"Organizational problems","color":"white","bgcolor":"purple","icon":"new_releases","payload":"Organizational problems","payloadType":"str","topic":"","x":1180,"y":900,"wires":[["2e59a7ad.ec5fb8","8fdb4ff1.aa37b"]]},{"id":"a665d0df.8c426","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":24,"width":"5","height":"3","passthru":false,"label":"Tool change","tooltip":"","color":"white","bgcolor":"aqua","icon":"compare_arrows","payload":"Tool change","payloadType":"str","topic":"","x":1140,"y":940,"wires":[["2e59a7ad.ec5fb8","8fdb4ff1.aa37b"]]},{"id":"f6af98ca.348338","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":29,"width":"5","height":"3","passthru":false,"label":"Non Quality","tooltip":"","color":"white","bgcolor":"orange","icon":"check_box","payload":"Non Quality","payloadType":"str","topic":"","x":1150,"y":980,"wires":[["2e59a7ad.ec5fb8","8fdb4ff1.aa37b"]]},{"id":"f39c8d46.ba3d8","type":"function","z":"9fc21c3e.61909","name":"dCounter","func":"// Asign the value of the global variable count to the local variable count. \n// It's a way of checking if reset has been made.\nvar dcount = global.get('dcount') || 0;\nif(msg.payload === "1") {\n dcount ++;\n global.set('dcount', dcount);\n// Update the value of the global variable count.\n}\n \n //msg.partscount = context.global.count;\n //msg.payload = context.global.count; \n//Asign the value of local count to partscount. \nmsg = { payload : dcount.toString()};\nreturn msg;\n\n// Programmed by Faurecia in Javascript.","outputs":1,"noerr":0,"x":860,"y":120,"wires":[["119603a7.9e446c","e8f73844.570a68"]]},{"id":"498b389a.26d428","type":"function","z":"9fc21c3e.61909","name":"dCounter","func":"// Asign the value of the global variable count to the local variable count. \n// It's a way of checking if reset has been made.\nvar hcount = global.get('hcount') || 0;\nif(msg.payload === "1") {\n hcount ++;\n global.set('hcount', hcount);\n// Update the value of the global variable count.\n}\n \n //msg.partscount = context.global.count;\n //msg.payload = context.global.count; \n//Asign the value of local count to partscount. \nmsg = { payload : hcount.toString()};\nreturn msg;\n\n// Programmed by Faurecia in Javascript.","outputs":1,"noerr":0,"x":860,"y":340,"wires":[["aacf38bb.8fa7e8"]]},{"id":"c41abcfc.568db","type":"function","z":"9fc21c3e.61909","name":"Counter hReset","func":"var hcount = 0;\nif (msg.payload === "1"){\n msg.partshcount = 0;\n}\nhcont =0;\nmsg.partshcount = 0;\n// Reset the value of partscount to 0, when payload is "0".\nglobal.set('hcount', 0);\n// Reset the value of the global variable count to 0.\nreturn msg;\n","outputs":1,"noerr":0,"x":860,"y":400,"wires":[["498b389a.26d428"]]},{"id":"58d1c9ab.274498","type":"inject","z":"9fc21c3e.61909","name":"","topic":"0","payload":"","payloadType":"date","repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"x":460,"y":120,"wires":[["f39c8d46.ba3d8","b4bf1451.339fc8"]]},{"id":"b4bf1451.339fc8","type":"function","z":"9fc21c3e.61909","name":"Counter hReset","func":"var dcount = 0;\nif (msg.payload === "1"){\n msg.partsdcount = 0;\n}\nhcont =0;\nmsg.partsdcount = 0;\n// Reset the value of partscount to 0, when payload is "0".\nglobal.set('dcount', 0);\n// Reset the value of the global variable count to 0.\nreturn msg;\n","outputs":1,"noerr":0,"x":880,"y":160,"wires":[["f39c8d46.ba3d8"]]},{"id":"7acd952d.cbaffc","type":"function","z":"9fc21c3e.61909","name":"GV counter part","func":"global.set("Part",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1220,"y":240,"wires":[]},{"id":"201b53dd.b34fac","type":"function","z":"9fc21c3e.61909","name":"insert GV into DB","func":"var operator = String(global.get("Operator"))||"";\nvar tool = String(global.get("Tool"))||"";\nvar reference = String(global.get("Reference"))||"";\nvar part = Number(global.get("Part"))||"";\nvar ntrs = String(global.get("Ntrs"))||"OK";\nvar date = new Date();\nvar fecha = date.getFullYear();\nvar fecha = fecha + "/" + date.getMonth();\nvar fecha = fecha + "/" + date.getDay();\nvar fecha = fecha + " " + date.getHours();\nvar fecha = fecha + ":" + date.getMinutes();\nvar fecha = fecha + ":" + date.getSeconds();\nmsg.topic = "insert into production (fecha, operator,tool,reference, part,ntrs)";\nmsg.topic = msg.topic + " values (";\nmsg.topic = msg.topic + "'"+ fecha + "',";\nmsg.topic = msg.topic + "'" + operator+ "',";\nmsg.topic = msg.topic + "'"+tool+"',";\nmsg.topic = msg.topic + "'"+reference+"',";\nmsg.topic = msg.topic + "'"+part+"',";\nmsg.topic = msg.topic + "'OK')";\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":580,"wires":[["575d2e1b.c02de","fbdbd189.95236"]]},{"id":"575d2e1b.c02de","type":"sqldbs","z":"9fc21c3e.61909","mydb":"47ba0ae2.64dd14","querytype":"Insert","name":"","x":985,"y":604,"wires":[["332ae7d1.76ec58"]]},{"id":"8fdb4ff1.aa37b","type":"function","z":"9fc21c3e.61909","name":"ntrs definition","func":"global.set("Ntrs",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1578,"y":877,"wires":[["bdb70aca.a45778"]]},{"id":"bdb70aca.a45778","type":"function","z":"9fc21c3e.61909","name":"insert ntrs option into DB","func":"var operator = String(global.get("Operator"))||"";\nvar tool = String(global.get("Tool"))||"";\nvar reference = String(global.get("Reference"))||"";\nvar part = Number(global.get("Part"))||"";\nvar ntrs = String(global.get("Ntrs"))||"";\nmsg.topic = "insert into production (operator,tool,reference, part,ntrs)";\nmsg.topic = msg.topic + " values (";\nmsg.topic = msg.topic + "'" + operator+ "',";\nmsg.topic = msg.topic + "'"+tool+"',";\nmsg.topic = msg.topic + "'"+reference+"',";\nmsg.topic = msg.topic + "'"+part+"',";\nmsg.topic = msg.topic + "'"+ntrs+"')";\nreturn msg;","outputs":1,"noerr":0,"x":1270,"y":716,"wires":[["575d2e1b.c02de","fbdbd189.95236"]]},{"id":"ace4fb3d.646938","type":"ui_dropdown","z":"9fc21c3e.61909","name":"","label":"Reference","place":"Select option","group":"f84b9d51.64916","order":10,"width":"12","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":410,"y":860,"wires":[["340f0f47.5ec05","183045b5.a5e9aa","ed22aa03.e9b788"]]},{"id":"815b9b20.8f6908","type":"ui_dropdown","z":"9fc21c3e.61909","name":"","label":"Operator","place":"Select option","group":"f84b9d51.64916","order":2,"width":"12","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":400,"y":780,"wires":[["340f0f47.5ec05","ed27a39e.7ce3b","6e8b22b4.79637c"]]},{"id":"161db878.2f7f68","type":"ui_dropdown","z":"9fc21c3e.61909","name":"","label":"Tool","place":"Select option","group":"f84b9d51.64916","order":6,"width":"12","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":390,"y":820,"wires":[["340f0f47.5ec05","2f488bed.914ea4","824293ea.715cc"]]},{"id":"340f0f47.5ec05","type":"debug","z":"9fc21c3e.61909","name":"output dropdown O,T,R","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":810,"y":900,"wires":},{"id":"ed27a39e.7ce3b","type":"function","z":"9fc21c3e.61909","name":"set GV operator","func":"global.set("Operator",String(msg.payload));\n\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":780,"wires":[]},{"id":"2f488bed.914ea4","type":"function","z":"9fc21c3e.61909","name":"set GV tool","func":"global.set("Tool",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":820,"wires":[]},{"id":"183045b5.a5e9aa","type":"function","z":"9fc21c3e.61909","name":"set GV reference","func":"global.set("Reference",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":860,"wires":[]},{"id":"6e8b22b4.79637c","type":"ui_text","z":"9fc21c3e.61909","group":"f84b9d51.64916","order":4,"width":"12","height":"1","name":"Operator","label":"Operator","format":"{{msg.payload}}","layout":"row-spread","x":580,"y":780,"wires":},{"id":"824293ea.715cc","type":"ui_text","z":"9fc21c3e.61909","group":"f84b9d51.64916","order":8,"width":"12","height":"1","name":"Tool","label":"Tool","format":"{{msg.payload}}","layout":"row-spread","x":570,"y":820,"wires":},{"id":"ed22aa03.e9b788","type":"ui_text","z":"9fc21c3e.61909","group":"f84b9d51.64916","order":12,"width":"12","height":"1","name":"Reference","label":"Reference","format":"{{msg.payload}}","layout":"row-spread","x":590,"y":860,"wires":},{"id":"883861cf.28a6f","type":"modbus-read","z":"9fc21c3e.61909","name":"Counter","topic":"","showStatusActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"172","quantity":"1","rate":"1","rateUnit":"ms","delayOnStart":false,"startDelayTime":"","server":"891d3a6e.50c728","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":130,"y":300,"wires":[["4a5ad3cd.b34bec"],]},{"id":"d35bef6c.aed02","type":"switch","z":"9fc21c3e.61909","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":320,"wires":[["6f3c7d4a.c60a04"],]},{"id":"8246ea7.8776918","type":"function","z":"9fc21c3e.61909","name":"string of counter","func":"msg.payload = String(msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"x":340,"y":320,"wires":[["d35bef6c.aed02"]]},{"id":"332ae7d1.76ec58","type":"debug","z":"9fc21c3e.61909","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1134,"y":603,"wires":},{"id":"9f0eb148.613cb","type":"ui_numeric","z":"9fc21c3e.61909","name":"","label":"Currently Counter","group":"f84b9d51.64916","order":17,"width":"26","height":"1","passthru":true,"topic":"","format":"{{value}}","min":0,"max":"1000","step":"1","x":1210,"y":320,"wires":[]},{"id":"4a5ad3cd.b34bec","type":"change","z":"9fc21c3e.61909","name":"","rules":[{"t":"move","p":"payload.0","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":180,"wires":[["8246ea7.8776918"]]},{"id":"105c2b8a.ffeb34","type":"debug","z":"9fc21c3e.61909","name":"operators","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":1030,"y":1100,"wires":},{"id":"1b933084.10384f","type":"change","z":"9fc21c3e.61909","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":".payload.operator","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":1260,"wires":[["ade1322b.ab8de","815b9b20.8f6908"]]},{"id":"47b14499.b5039c","type":"function","z":"9fc21c3e.61909","name":"payload to options","func":"msg.options = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":1260,"wires":[["1b933084.10384f","105c2b8a.ffeb34"]]},{"id":"a3e94bff.f23a78","type":"function","z":"9fc21c3e.61909","name":"payload to options","func":"msg.options = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":1380,"wires":[["fa0b6e18.9f27f","85c70c85.07e1d"]]},{"id":"55aec764.97c538","type":"change","z":"9fc21c3e.61909","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":".payload.tool","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":1320,"wires":[["161db878.2f7f68","3d8ad525.20cc8a"]]},{"id":"fa0b6e18.9f27f","type":"change","z":"9fc21c3e.61909","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"$.payload.reference","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":1380,"wires":[["ace4fb3d.646938"]]},{"id":"3d8ad525.20cc8a","type":"debug","z":"9fc21c3e.61909","name":"tools","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":1000,"y":1140,"wires":},{"id":"85c70c85.07e1d","type":"debug","z":"9fc21c3e.61909","name":"references","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":1010,"y":1180,"wires":},{"id":"ade1322b.ab8de","type":"debug","z":"9fc21c3e.61909","name":"change node output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1440,"y":1240,"wires":},{"id":"4b898ac8.13b714","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f84b9d51.64916","order":14,"width":"26","height":"1","passthru":false,"label":"button","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":190,"y":820,"wires":[["815b9b20.8f6908","161db878.2f7f68","ace4fb3d.646938","931d7e89.af683","fcf8d487.07ee58"]]},{"id":"11075fef.ce20e","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"f7087673.673a98","order":15,"width":"4","height":"4","passthru":false,"label":"load data","tooltip":"","color":"white","bgcolor":"lightgreen","icon":"replay","payload":"","payloadType":"date","topic":"","x":120,"y":1180,"wires":[["fcd0bd4c.bfb98","a86b2a8c.b242c8","eed8ea81.26f768"]]},{"id":"fcd0bd4c.bfb98","type":"MSSQL","z":"9fc21c3e.61909","mssqlCN":"6f292423.0984ec","name":"","query":"SELECT DISTINCT operator\nFROM operators;","outField":"payload","x":770,"y":1260,"wires":[["47b14499.b5039c"]]},{"id":"50cb8f7a.e76a8","type":"function","z":"9fc21c3e.61909","name":"payload to options","func":"msg.options = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":1320,"wires":[["55aec764.97c538"]]},{"id":"6397f22.f726d0c","type":"MSSQL","z":"9fc21c3e.61909","mssqlCN":"6f292423.0984ec","name":"","query":"SELECT DISTINCT tool FROM operators;","outField":"payload","x":770,"y":1320,"wires":[["50cb8f7a.e76a8"]]},{"id":"a86b2a8c.b242c8","type":"delay","z":"9fc21c3e.61909","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":630,"y":1300,"wires":[["6397f22.f726d0c"]]},{"id":"eed8ea81.26f768","type":"delay","z":"9fc21c3e.61909","name":"","pauseType":"delay","timeout":"700","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":630,"y":1400,"wires":[["d1cb5b2f.1fa528"]]},{"id":"d1cb5b2f.1fa528","type":"MSSQL","z":"9fc21c3e.61909","mssqlCN":"6f292423.0984ec","name":"","query":"SELECT DISTINCT reference FROM operators;","outField":"payload","x":770,"y":1380,"wires":[["a3e94bff.f23a78"]]},{"id":"fbdbd189.95236","type":"function","z":"9fc21c3e.61909","name":"GVs y piezas a influxDB","func":"msg.payload = [\n {\n measurement: "production",\n fields: {\n pieza:Number(global.get("Part"))\n },\n tags:{\n operator:String(global.get("Operator")),\n tool: String(global.get("Tool")),\n referencia:String(global.get("Reference")),\n ntrs: String(global.get("Ntrs")) || "",\n \n }\n \n }\n]\nreturn msg;","outputs":1,"noerr":0,"x":1247,"y":530,"wires":[["2c67860d.c1cbaa"]]},{"id":"2c67860d.c1cbaa","type":"influxdb batch","z":"9fc21c3e.61909","influxdb":"f9e7dac3.93a158","precision":"","retentionPolicy":"","name":"","x":1521,"y":529,"wires":},{"id":"931d7e89.af683","type":"debug","z":"9fc21c3e.61909","name":"button output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":322,"y":503,"wires":},{"id":"fcf8d487.07ee58","type":"function","z":"9fc21c3e.61909","name":"button to counter","func":"if (msg.payload.number != 0) {\n msg.payload = "1";\n}\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":540,"wires":[["6f3c7d4a.c60a04","931d7e89.af683","f39c8d46.ba3d8","498b389a.26d428"]]},{"id":"119bc6fd.eb1aa9","type":"ui_button","z":"9fc21c3e.61909","name":"","group":"3569b348.18a43c","order":22,"width":"4","height":"4","passthru":false,"label":"OK","tooltip":"","color":"white","bgcolor":"blue","icon":"check","payload":"ok","payloadType":"str","topic":"","x":1121,"y":779,"wires":[["8fdb4ff1.aa37b"]]},{"id":"e8f73844.570a68","type":"function","z":"9fc21c3e.61909","name":"GV dCounter","func":"global.set('dCouner',msg.payload)\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":120,"wires":[]},{"id":"f84b9d51.64916","type":"ui_group","z":"","name":"Light DMC","tab":"ff4f0867.82c048","order":2,"disp":true,"width":"26","collapse":true},{"id":"47ba0ae2.64dd14","type":"sqldbsdatabase","z":"","host":"192.168.1.15","port":"1433","db":"nodered","dialect":"mssql"},{"id":"891d3a6e.50c728","type":"modbus-client","z":"","name":"Monnit","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"192.168.1.40","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"},{"id":"f7087673.673a98","type":"ui_group","z":"","name":"Cargar Datos","tab":"ff4f0867.82c048","order":1,"disp":true,"width":"4","collapse":false},{"id":"6f292423.0984ec","type":"MSSQL-CN","z":"","name":"Test","server":"127.0.0.1","encyption":false,"database":"nodered"},{"id":"f9e7dac3.93a158","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"production","name":"","usetls":false,"tls":""},{"id":"3569b348.18a43c","type":"ui_group","z":"","name":"OK","tab":"ff4f0867.82c048","order":3,"disp":true,"width":"4","collapse":false},{"id":"ff4f0867.82c048","type":"ui_tab","z":"","name":"home","icon":"dashboard"}]

what i want is to block the bottom part of the UI until the green, load sql button is pressed.

after the green button is pressed, i want the blue button called "BUTTON" to be disabled unless the button "OK" is pressed.

Is there any way to do this?


#2

by using the ui_control node you can show/hide a group on the page. If that whole bottom section is a group then it can be shown or hidden. See the ui_control node info sidebar or the readme for details - https://flows.nodered.org/node/node-red-dashboard


#3

thanks a lot for your answer.

Is there a way to make it gray, so that the big "BUTTON" button is still there but not accessible until the blue "OK" button is pressed?


#4

I shall refer you to the info bar on the right - for the button.
image


#5

sweet! that works amazing, but now i can´t get it to be enabled when the ok button is pressed.
I used this custom function:
var ntrf = String(global.get("Ntrs"))
if (ntrs == "ok") {
msg.enabled = true;
} else if (ntrs != "ok") {
msg.enabled = false;
}
return msg

but the button won´t get enabled when the "ok" button is pressed.

How can i go about it?


#6

Insert some node.warn() statements to see what is happening. For example after the global.get put
node.warn("ntrf is " + ntrf)
and after the ok test put
node.warn("Enabling")
The messages will be shown in the debug window so you can check it is doing the right thing.


#7

Is there possibly a typo in there?


#8

you rock fam. Thanks a lot


#9

It is worth remembering the usefulness of node.warn in these situations. Then you would have been able to work it out yourself.


#10

i didn´t know about node.warn until you mentioned it