summaryrefslogtreecommitdiff
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..c9fa2f4
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+
+<html>
+
+ <head>
+
+ <title>webiot</title>
+
+ <meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" href="/static/simple.css/simple.css" type="text/css">
+
+ </head>
+
+ <body>
+
+ <header>
+ <h1>webiot</h1>
+ <p>A simple IoT web server</p>
+ </header>
+
+ <main>{{range .Hs100}}
+ <section>
+ <p><strong>{{.Name}}</strong></p>
+ <button onclick="api('{{.Ip}}', 'on')">on</button>
+ <button class="card-last-item" onclick="api('{{.Ip}}', 'off')">off</button>
+ </section>{{end}}
+
+ <footer>
+ <center>
+ <p><a href="https://xengineering.eu/git/webiot">webiot</a>
+ is licensed under <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL&nbsp;v3</a> and developed
+ with <a href="https://simplecss.org/">simple.css</a>.</p>
+ </center>
+ </footer>
+
+ <script>
+ function api(host, state) {
+ const xhttp = new XMLHttpRequest();
+ xhttp.open(
+ "POST",
+ "/api?host=" + host + "&state=" + state,
+ true
+ );
+ xhttp.send();
+ }
+ </script>
+
+ </main>
+
+ </body>
+
+</html>