Add foundation for web portal

This commit is contained in:
Skylar Grant 2022-12-19 13:07:36 -05:00
parent 2a19a8499d
commit 7f1a6d51b2
2 changed files with 43 additions and 0 deletions

20
websvr.js Normal file
View File

@ -0,0 +1,20 @@
/* Pellet Stove Control Panel
* Web Configuration Server
* v0.0.0 by Skylar Grant
*/
const http = require('http');
const host = 'localhost';
const port = 8080;
const config = require('./config.json');
const requestListener = (req, res) => {
res.writeHead(200);
res.end('PSControlPanel Web Server')
};
const server = http.createServer(requestListener);
server.listen(port, host, () => {
if (config.debugMode) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: Started web config portal.`);
})

23
www/index.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Pellet Stove Web Portal</title>
</head>
<body>
<div id="title">Pellet Stove Web Portal</div>
<div id="status">Auger: Off | Igniter: Off | Combustion Blower: Off</div>
<div id="safeties">Vacuum: Open | Proof of Fire: Open</div>
<div id="controls-container">
<form>
<!-- Start | Shutdown | Reload Settings -->
<button id="ignite">Start</button><button id="shutdown">Shutdown</button><button id="reload">Reload Settings</button><br>
<!-- Set feed rates -->
<label for="augerOn">Auger On Interval: </label><input type="number" id="augerOn" name="augerOn" min="500" max="1000">ms<br>
<label for="augerOff">Auger Off Interval: </label><input type="number" id="augerOff" name="augerOff" min="1000" max="2000">ms<br>
<label for="pauseInt">App Pause Interval: </label><input type="number" id="pauseInt" name="pauseInt" min="1000" max="600000">ms<br>
</form>
</div>
</body>
</html>