laserproxy: init
Change-Id: I1900be6eea2d702548279176d796c58c34952dc8
diff --git a/hswaw/laserproxy/tpl/index.html b/hswaw/laserproxy/tpl/index.html
new file mode 100644
index 0000000..2bd93e7
--- /dev/null
+++ b/hswaw/laserproxy/tpl/index.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>laserproxy</title>
+ </head>
+ <body>
+ <h1>warsaw hackerspace SOKÓŁ proxy</h1>
+ {{ if eq .CurrentAddress "" }}
+ <p>
+ Currently <b>not</b> in use by anyone. Wanna lase something?
+ </p>
+ <form action="/take" method="POST">
+ I am <input id="persist" type="text" name="who" placeholder="{{ .SampleName }}" /> and want to <input type="submit" value="use the laser" /> over the network.
+ </form>
+ {{ else if .You }}
+ <p>
+ Currently in use by <b>you</b> ({{ .CurrentNote }}, {{ .CurrentAddress }}). <b>Expires in {{ .CurrentDeadline }}.</b> This deadline will automatically extend as long as the laser is actively used.
+ </p>
+ <p>
+ To cut something, use LightBurn, and point it as <b>10.8.1.2</b> (as a 'Ruida' Ethernet/LAN controller).
+ </p>
+ <form action="/release" method="POST">
+ <input type="submit" value="I'm done with the laser." />
+ </form>
+ {{ else }}
+ <p>
+ Currently in use by '{{ .CurrentNote }}' ({{ .CurrentAddress }}). <b>Expires in {{ .CurrentDeadline }}</b>.
+ </p>
+ <form action="/force" method="POST">
+ I need to use the laser now and I can't ask the current user ({{ .CurrentNote }}) to release the lock. <input type="submit" value="I want to forcefully release the lock" />, and am aware of the possible consequences of that.
+ </form>
+ {{ end }}
+ <p>
+ <b>Confused by this?</b> See our <a href="https://wiki.hackerspace.pl/infra:tools:lasercutter">wiki entry about how to use the laser</a>.
+ </p>
+
+ <script>
+let element = document.querySelector("#persist");
+if (element !== null) {
+ let existing = localStorage.getItem("hacker");
+ if (existing !== "" && existing !== null) {
+ element.value = existing;
+ }
+ element.addEventListener('change', (event) => {
+ let value = event.target.value;
+ localStorage.setItem("hacker", value);
+ });
+}
+ </script>
+ </body>
+</html>