LaundrySorcery

Log | Files | Refs

commit a3601ec5c315b9511978fbd175cc183357fa003b
parent 6fb6a23eb2a2a405c32e5b66c05eb94d3155f185
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Thu,  7 Jun 2018 21:00:14 +0000

Add a control panel to index.cgi and do a little stylesheet

Diffstat:
www/control.cgi | 12++++++++++++
www/index.cgi | 8+++++++-
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/www/control.cgi b/www/control.cgi @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "Content-Type: text/plain" +echo + +act="${QUERY_STRING%=*}" + +case $act in + "restart") systemctl restart LaundrySorcery;; + "reboot") reboot;; + "shutdown") poweroff;; +esac diff --git a/www/index.cgi b/www/index.cgi @@ -11,10 +11,16 @@ Content-Type: text/html <title>LaundrySorcery</title> <meta charset="UTF-8"/> <style type="text/CSS"> - + #statusLine{ + text-align:center; + } + #delta_t{ + font-weight:bold; + } </style> </head> <body> + <div id="CtrlPanel"><form action="control.cgi" method="GET"><input type="submit" name="restart" value="Restart"/><input type="submit" name="reboot" value="Reboot"/> <input type="submit" name="shutdown" value="Shutdown" /></form></div> <H1>Laundry Status</H1> <div id="statusLine">The laundry machine is <span id="delta_t"></span></div> <script type="text/JavaScript">