mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-15 21:18:21 +01:00
basic web config
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Sprocket</h1>
|
||||
</body>
|
||||
|
||||
<head>
|
||||
<script src="jquery-3.3.1.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Sprocket Config</h1>
|
||||
|
||||
<button class="js-restart">Restart</button>
|
||||
<br>
|
||||
<br>
|
||||
<form action="/config" method="post">
|
||||
<textarea name="config" class="js-config" rows="20" cols="50"></textarea>
|
||||
<br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
2
data/www/jquery-3.3.1.min.js
vendored
Normal file
2
data/www/jquery-3.3.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11
data/www/script.js
Normal file
11
data/www/script.js
Normal file
@@ -0,0 +1,11 @@
|
||||
$(() => {
|
||||
// load config
|
||||
$.get("/config.json", (data) => {
|
||||
$('.js-config').val(JSON.stringify(data, null, 4));
|
||||
});
|
||||
// add handlers
|
||||
$('.js-restart').click(()=>{
|
||||
$.post('/restart');
|
||||
alert('restarting...');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user