Невозможно получить данные HTTP для следующего элемента в потоке Node-Red - PullRequest
0 голосов
/ 23 сентября 2019

Я был бы очень признателен за некоторую помощь с некоторыми функциями HTTP, такими как переключатели, выпадающие списки и флажки.

У меня есть поток, он отображает экран и получает ввод от пользователя, который требует вводабыть представленным на втором экране в потоке для пользователя, чтобы подтвердить, что это правильно.

В настоящее время второй экран содержит большую часть кода с первого экрана, чтобы упростить его обновление до правильного кода.

Я играл с этим все последниенеделю и не смог вернуть данные на второй экран.

Я включил упрощенную версию своего кода, которую можно загрузить в Node-Red.

Большое спасибоза вашу помощь.

[{"id":"e8ec9e7e.74b12","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"7ad0187d.0e87f8","type":"http in","z":"e8ec9e7e.74b12","name":"Get v1","url":"/v1","method":"get","upload":false,"swaggerDoc":"","x":293.0173645019531,"y":119.01041412353516,"wires":[["c8e01cb.dc164e","81e7a704.c13c68"]]},{"id":"932a3f41.c4574","type":"http response","z":"e8ec9e7e.74b12","name":"","statusCode":"","headers":{},"x":313.0173645019531,"y":199.01041412353516,"wires":[]},{"id":"c8e01cb.dc164e","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test1 a","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":533.0173645019531,"y":119.01041412353516,"wires":[]},{"id":"f483522.c940bb","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test1 b","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":533.0173645019531,"y":159.01041412353516,"wires":[]},{"id":"81e7a704.c13c68","type":"template","z":"e8ec9e7e.74b12","name":"Input form HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<HTML>\n  \n    <head>\n    <meta charset=\"UTF-8\">\n        <center>Vehicle details</center>\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n            <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n         <title>Document</title>\n    <fieldset>\n\n    <form action=\"/v1\" method=\"post\"></form>\n\n    <form id=\"v1\"><formid></formid>\n    \n    </form>\n\n    <p>Belonging to Departments:</p>\n            \n            <div>\n                  <input type=\"radio\" id=\"Tennant\" name=\"Dept A Name\" value=\"Dept A Value\" checked>\n                  <label for=\"Dept A Label\">Dept A</label>\n        \n                  <input type=\"radio\" id=\"Dept A\" name=\"Dept B Name\" value=\"Dept B Value\">\n                  <label for=\"Dept B Label\">Dept B</label>\n        \n                  <input type=\"radio\" id=\"Dept A\" name=\"Dept C Name\" value=\"Dept C Value\">\n                  <label for=\"Dept C label\">Dept C</label>\n        \n            </div>\n \n<p>Choose day of working week: </p>\n\n    <select id=\"DayOfWeek\">\n   \n      <option>Monday</option>\n      <option>Tuseday</option>\n      <option>Wednesday</option>\n      <option>Thursday</option>\n      <option>Friday</option>\n    \n    </select>\n    \n    <br>\n\n    <p>Send following type of message when seen</p>\n        <input type=\"checkbox\" name=\"CheckChoice\" id=\"\" value=\"Email\">Email\n        <input type=\"checkbox\" name=\"CheckChoice\" id=\"\" value=\"SMS\">SMS\n\n\t<br>  <br>\n\t  \n    <p>Update record</p>\n    <form action=\"/v2\" method=\"post\">\n   <button onclick=\"updatedata()\">Update Record:</button>     \n       </form>   \n \n  </fieldset>\n","x":283.0173645019531,"y":159.01041412353516,"wires":[["932a3f41.c4574","f483522.c940bb"]]},{"id":"4be22287.c3ff4c","type":"http in","z":"e8ec9e7e.74b12","name":"Post v2","url":"/v2","method":"post","upload":false,"swaggerDoc":"","x":293.0173645019531,"y":259.01041412353516,"wires":[["fc86b7c5.c21228","aa75e2b2.fcf17"]]},{"id":"55bbd60e.de9868","type":"http response","z":"e8ec9e7e.74b12","name":"","statusCode":"","headers":{},"x":313.0173645019531,"y":339.01041412353516,"wires":[]},{"id":"fc86b7c5.c21228","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test2 a","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":533.0173645019531,"y":259.01041412353516,"wires":[]},{"id":"fa09f4e.2bb3a08","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test2 b","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":533.0173645019531,"y":299.01041412353516,"wires":[]},{"id":"aa75e2b2.fcf17","type":"template","z":"e8ec9e7e.74b12","name":"Input form HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<HTML>\n  \n    <head>\n    <meta charset=\"UTF-8\">\n        <center>You updated vehicle details to the following</center>\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n            <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n         <title>Document</title>\n    <fieldset>\n\n    <form action=\"/v2\" method=\"post\"></form>\n\n    <form id=\"v2\"><formid></formid>\n    \n    </form>\n\n    <p>Belonging to Departments:</p>\n            \n            <div>\n                \n              <input type=\"radio\" id=\"Tennant\" name=\"Dept A Name\" value=\"Dept A Value\" checked>\n              <label for=\"Dept A Label\">Dept A</label>\n    \n              <input type=\"radio\" id=\"Dept A\" name=\"Dept B Name\" value=\"Dept B Value\">\n              <label for=\"Dept B Label\">Dept B</label>\n    \n              <input type=\"radio\" id=\"Dept A\" name=\"Dept C Name\" value=\"Dept C Value\">\n              <label for=\"Dept C label\">Dept C</label>\n        \n            </div>\n \n    <p>Choose day of working week: </p>\n\n    <select id=\"DayOfWeek\">\n   \n      <option>Monday</option>\n      <option>Tuseday</option>\n      <option>Wednesday</option>\n      <option>Thursday</option>\n      <option>Friday</option>\n    \n    </select>\n    \n    <br>\n\n    <p>Send following type of message when seen</p>\n        <input type=\"checkbox\" name=\"CheckChoice\" id=\"\" value=\"Email\">Email\n        <input type=\"checkbox\" name=\"CheckChoice\" id=\"\" value=\"SMS\">SMS\n\n\t<br>  <br>\n\n    <p>Confirm details</p>\n\n    <form action=\"/v3\" method=\"post\">\n   <button onclick=\"updatedata()\">Confirm details:</button>     \n       </form>   \n       \n    <p>Fix errors</p>\n       <form action=\"/v1\" method=\"post\">\n   <button onclick=\"updatedata()\">Dont save:</button>  \n    </form>     \n     \n\n </fieldset>","x":283.0173645019531,"y":299.01041412353516,"wires":[["55bbd60e.de9868","fa09f4e.2bb3a08"]]},{"id":"4c949785.ca0998","type":"http in","z":"e8ec9e7e.74b12","name":"Post v3","url":"/v3","method":"post","upload":false,"swaggerDoc":"","x":288.0173645019531,"y":429.0104064941406,"wires":[["52214be7.d66de4","70527a96.ba8044"]]},{"id":"ed21cb1b.3bba68","type":"http response","z":"e8ec9e7e.74b12","name":"","statusCode":"","headers":{},"x":308.0173645019531,"y":509.0104064941406,"wires":[]},{"id":"52214be7.d66de4","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test3 a","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":528.0173645019531,"y":429.0104064941406,"wires":[]},{"id":"696645ad.63cf3c","type":"debug","z":"e8ec9e7e.74b12","name":"Flow test3 b","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":528.0173645019531,"y":469.0104064941406,"wires":[]},{"id":"70527a96.ba8044","type":"template","z":"e8ec9e7e.74b12","name":"Input form HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n<p>More processing here</p>\n\n\n","x":278.0173645019531,"y":469.0104064941406,"wires":[["ed21cb1b.3bba68","696645ad.63cf3c"]]},{"id":"abda4e87.8626d","type":"http in","z":"e8ec9e7e.74b12","name":"Post v1","url":"/v1","method":"post","upload":false,"swaggerDoc":"","x":297.0173645019531,"y":62.010414123535156,"wires":[["81e7a704.c13c68"]]}]
...