Added external webpage

other
Filip Borum Poulsen 1 year ago
parent f30877ac6d
commit 5219f3faba

@ -1,6 +1,6 @@
Host bpfilip.dk Host bpfilip.dk
HostName bpfilip.dk HostName bpfilip.dk
IdentityFile /root/.ssh/id_rsa IdentityFile /home/pi/.ssh/id_rsa
User root User root
Port 2223 Port 2223
LocalForward 22 127.0.0.1:2222 LocalForward 22 127.0.0.1:2222

@ -3,9 +3,10 @@ Description=Keeps an SSH tunnel to 'bpfilip.dk' open
After=network-online.target After=network-online.target
[Service] [Service]
User=root
ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" bpfilip.dk ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" bpfilip.dk
ExecStop=/usr/bin/killall -s KILL autossh ExecStop=/usr/bin/killall -s KILL autossh
User=1000
Group=1000
Restart=always Restart=always
RestartSec=3 RestartSec=3

@ -41,20 +41,20 @@
<button onclick="fetch(`/stopprojector`, { method: 'POST' });">Stop projectors</button> <button onclick="fetch(`/stopprojector`, { method: 'POST' });">Stop projectors</button>
<h2>Relay 1</h2> <h2>Relay 1</h2>
<div id="relay1"></div> <div id="relay1"></div>
<button onclick="fetch(`http://10.242.84.110:8080/on/19`);">On relay 1</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/on/19`);">On relay 1</button>
<button onclick="fetch(`http://10.242.84.110:8080/off/19`);">Off relay 1</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/off/19`);">Off relay 1</button>
<h2>Relay 2</h2> <h2>Relay 2</h2>
<div id="relay2"></div> <div id="relay2"></div>
<button onclick="fetch(`http://10.242.84.110:8080/on/13`);">On relay 2</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/on/13`);">On relay 2</button>
<button onclick="fetch(`http://10.242.84.110:8080/off/13`);">Off relay 2</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/off/13`);">Off relay 2</button>
<h2>Relay 3</h2> <h2>Relay 3</h2>
<div id="relay3"></div> <div id="relay3"></div>
<button onclick="fetch(`http://10.242.84.110:8080/on/6`);">On relay 3</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/on/6`);">On relay 3</button>
<button onclick="fetch(`http://10.242.84.110:8080/off/6`);">Off relay 3</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/off/6`);">Off relay 3</button>
<h2>Relay 4</h2> <h2>Relay 4</h2>
<div id="relay4"></div> <div id="relay4"></div>
<button onclick="fetch(`http://10.242.84.110:8080/on/5`);">On relay 4</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/on/5`);">On relay 4</button>
<button onclick="fetch(`http://10.242.84.110:8080/off/5`);">Off relay 4</button> <button onclick="fetch(`https://steady.bpfilip.dk/relay/off/5`);">Off relay 4</button>
<script src="/main.js"></script> <script src="/main.js"></script>
</body> </body>
</html> </html>

@ -40,10 +40,10 @@ async function main() {
const relay3Div = document.getElementById('relay3'); const relay3Div = document.getElementById('relay3');
const relay4Div = document.getElementById('relay4'); const relay4Div = document.getElementById('relay4');
relay1Div.innerText = await (await fetch("http://10.242.84.110:8080/status/19")).text(); relay1Div.innerText = await (await fetch("https://steady.bpfilip.dk/relay/status/19")).text();
relay2Div.innerText = await (await fetch("http://10.242.84.110:8080/status/13")).text(); relay2Div.innerText = await (await fetch("https://steady.bpfilip.dk/relay/status/13")).text();
relay3Div.innerText = await (await fetch("http://10.242.84.110:8080/status/6")).text(); relay3Div.innerText = await (await fetch("https://steady.bpfilip.dk/relay/status/6")).text();
relay4Div.innerText = await (await fetch("http://10.242.84.110:8080/status/5")).text(); relay4Div.innerText = await (await fetch("https://steady.bpfilip.dk/relay/status/5")).text();
} }
main(); main();

Loading…
Cancel
Save