RedMatic icon indicating copy to clipboard operation
RedMatic copied to clipboard

Probleme mit http response node

Open Matten-Matten opened this issue 4 years ago • 0 comments

Hallo @hobbyquaker ,

seit der version 6.0.2 hab ich probleme mit http response node. ich kann die erstellte webseite nicht mehr erneut laden.

ich verwende den http response node bspw als kleines webinterface um variablen zu beschreiben oder ähnlich.

und kann diese seite nicht erneut antriggern, damit sie sich aktualiert. ich hoffe ich hab mich verständlich ausgedrückt was mein problem ist hier mal ein auzug aus meinen flows.

in dem aktuellen beispiel suche ich musik über dem alexa2 node wenn die musik oder der title gefunden wurde, wird die seite erneut getriggert , das funktioniert aber jetzt nicht mehr.

Node-RED _ http

[ { "id": "b63bb472.53b6e8", "type": "http in", "z": "44dec79e.a3edf8", "name": "", "url": "/kueche", "method": "get", "upload": false, "swaggerDoc": "", "x": 230, "y": 920, "wires": [ [ "9337ff95.4c1e5" ] ] }, { "id": "ef63cc5f.b126f", "type": "http in", "z": "44dec79e.a3edf8", "name": "", "url": "/kueche", "method": "post", "upload": false, "swaggerDoc": "", "x": 230, "y": 1000, "wires": [ [ "39052c8a.80c3c4" ] ] }, { "id": "9337ff95.4c1e5", "type": "function", "z": "44dec79e.a3edf8", "name": "msg.url = \"addons/red/kueche\";", "func": "msg.url = \"addons/red/kueche\";\nreturn msg;", "outputs": 1, "noerr": 0, "x": 550, "y": 920, "wires": [ [ "dffb5aaf.b85c48" ] ] }, { "id": "f6932d15.97ae7", "type": "debug", "z": "44dec79e.a3edf8", "name": "mysitepost", "active": true, "tosidebar": true, "console": false, "complete": "payload", "x": 890, "y": 1040, "wires": [] }, { "id": "246ba0fe.23fec", "type": "template", "z": "44dec79e.a3edf8", "name": "CSS", "field": "payload.style", "fieldType": "msg", "format": "html", "syntax": "mustache", "template": "input[type=text], select {\n width: 100%;\n padding: 12px 20px;\n margin: 8px 0;\n display: inline-block;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\ninput[type=submit] {\n width: 100%;\n background-color: #285E8A;\n color: white;\n padding: 14px 20px;\n margin: 8px 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n}\n\ninput[type=submit]:hover {\n background-color: #1990C7;\n}\n\ndiv {\n border: 1px solid #ccc;\n border-radius: 10px;\n background-color: #f2f2f2;\n padding: 20px;\n}\n\nlabel {\n color: #285E8A;\n}", "x": 970, "y": 920, "wires": [ [ "27f7e741.5856d8" ] ] }, { "id": "dffb5aaf.b85c48", "type": "template", "z": "44dec79e.a3edf8", "name": "JavaScript", "field": "payload.script", "fieldType": "msg", "format": "javascript", "syntax": "plain", "template": "$(document).ready(function(e) {\n \n $(\"form[ajax=true]\").submit(function(e) {\n \n e.preventDefault();\n \n var form_data = $(this).serialize();\n var form_url = $(this).attr(\"action\");\n var form_method = $(this).attr(\"method\").toUpperCase();\n \n $(\"#loadingimg\").show();\n \n $.ajax({\n url: form_url, \n type: form_method, \n data: form_data, \n cache: false,\n success: function(returnhtml){ \n $(\"#result\").html(returnhtml); \n $(\"#loadingimg\").hide(); \n } \n }); \n \n });\n \n});", "x": 830, "y": 920, "wires": [ [ "246ba0fe.23fec" ] ] }, { "id": "584cd948.6070f8", "type": "http response", "z": "44dec79e.a3edf8", "name": "", "statusCode": "", "headers": {}, "x": 1210, "y": 920, "wires": [] }, { "id": "27f7e741.5856d8", "type": "template", "z": "44dec79e.a3edf8", "name": "HTML", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "<html>\n <head>\n <title>Alexa Suche</title>\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\">\n <meta charset=\"utf-8\">\n <script src=\"http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js\"></script>\n <style>{{{payload.style}}}</style>\n </head>\n \n\n\n<div>\n\n <form method=\"post\" action=\"/{{url}}\" ajax=\"true\">\n <label for=\"Suche\">Suche</label>\n <input type=\"text\" id=\"Suche\" name=\"Suche\">\n\n\n <label for=\"Provider\">Provider</label>\n <select id=\"Provider\" name=\"Provider\">\n <option value=\"TUNEIN\">TuneIn</option>\n <option value=\"AMAZON_MUSIC\">Amazon Music</option>\n <option value=\"Playlist\">Playlist</option>\n <option value=\"CLOUDPLAYER\">My Library</option>\n </select>\n \n <input type=\"submit\" value=\"Suche\">\n </form>\n</div>\n\n</body>\n</html>\n<script>{{{payload.script}}}</script>", "x": 1090, "y": 920, "wires": [ [ "584cd948.6070f8" ] ] }, { "id": "604a3c16.467294", "type": "comment", "z": "44dec79e.a3edf8", "name": "Inject msg object properties", "info": "", "x": 540, "y": 880, "wires": [] }, { "id": "37d68c36.ac5704", "type": "comment", "z": "44dec79e.a3edf8", "name": "Website", "info": "", "x": 100, "y": 880, "wires": [] }, { "id": "4a0f7a3b.ddb434", "type": "comment", "z": "44dec79e.a3edf8", "name": "Form Submission", "info": "", "x": 200, "y": 960, "wires": [] }, { "id": "39052c8a.80c3c4", "type": "switch", "z": "44dec79e.a3edf8", "name": "nicht leer", "property": "payload.Suche", "propertyType": "msg", "rules": [ { "t": "nempty" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 680, "y": 1000, "wires": [ [ "f6932d15.97ae7", "ca9e4173.5dbe5" ] ] }, { "id": "ca9e4173.5dbe5", "type": "link out", "z": "44dec79e.a3edf8", "name": "Suche Küche", "links": [ "195c45bc.db772a", "a826d060.991a4" ], "x": 1175, "y": 1000, "wires": [] }, { "id": "7086a887.f96058", "type": "comment", "z": "44dec79e.a3edf8", "name": "Alexa Suche Küche", "info": "", "x": 130, "y": 840, "wires": [] }, { "id": "140b467e.b35f0a", "type": "link in", "z": "44dec79e.a3edf8", "name": "", "links": [ "b894ae7d.784bc", "7696dc72.bc3c64" ], "x": 300, "y": 880, "wires": [ [ "9337ff95.4c1e5" ] ] } ]

Gruß Matten Matten

Matten-Matten avatar Sep 10 '20 19:09 Matten-Matten