Mercurial > code > home > repos > homeauto
view service/mqtt_graph_bridge/index.html @ 695:80f6b3ee9c7f
tester page that can PUT some statements
Ignore-this: 238b55764b2f4f59a21a7e7907e7039a
author | drewp@bigasterisk.com |
---|---|
date | Fri, 31 Jan 2020 23:55:04 -0800 |
parents | b112da45e035 |
children |
line wrap: on
line source
<!doctype html> <html> <head> <title>mqtt_graph_bridge</title> <meta charset="utf-8"> <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script> <script src="/lib/require/require-2.3.3.js"></script> <script src="/rdf/common_paths_and_ns.js"></script> <link rel="stylesheet" href="/rdf/browse/style.css"> </head> <body class="rdfBrowsePage"> mqtt_graph_bridge <p>Send demo statements to bridge:</p> <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="0.0">Send (:kitchenLight :brightness 0.0)</button></div> <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="1.0">Send (:kitchenLight :brightness 1.0)</button></div> <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="0.0">Send (:livingLampShelf :brightness 0.0)</button></div> <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="1.0">Send (:livingLampShelf :brightness 1.0)</button></div> <script> Array.from(document.querySelectorAll("button")).forEach((el) => { el.addEventListener("click", (ev) => { fetch(el.dataset.post, { method: "PUT", body: el.dataset.body }); }); }); </script> </body> </html>