blob: c9fab16adffff9ee00087f13fd40240bae648449 [file] [log] [blame]
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HSWAW Lasercutter</title>
</head>
<body>
<h1>Warsaw Hackerspace Sokół Lasercutter 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> ({{ .CurrentName }}, {{ .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 '{{ .CurrentName }}' ({{ .CurrentAddress }}). <b>Expires automatically in {{ .CurrentDeadline }}</b>.
</p>
<form action="/force" method="POST">
I want to use the laser now, and I'm sure {{ .CurrentName }} is not using it. <input type="submit" value="I want to forcefully release the lock" />, and am aware that doing this will bring wrath onto me if someone <em>is</em> using the laser.
</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>
<p><small><a href="https://cs.hackerspace.pl/hscloud/-/tree/hswaw/laserproxy">source code</a></small></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>