Add visual feedback to save button, add user agent

This commit is contained in:
Djuri 2023-08-23 21:19:34 +02:00
parent 96a48576c5
commit 1e6ed38ce5
4 changed files with 13 additions and 1 deletions

View file

@ -62,6 +62,7 @@
</div>
<footer>
<button type="submit" class="btn btn-primary">Show Text</button>
<button type="button" class="btn btn-secondary" id="restartBtn">Restart</button>
</footer>
</form>
<hr>
@ -186,7 +187,7 @@
<h3>Screens</h3>
<div id="outputScreens"></div>
<button type="submit" class="btn btn-secondary">Reset</button>
<button type="submit" class="btn btn-primary">Save</button>
<button type="submit" class="btn btn-primary" id="saveSettingsBtn">Save</button>
</form>
</div>

View file

@ -80,11 +80,17 @@ settingsForm.onsubmit = (event) => {
method: "post"
}).then(() => {
console.log('Submitted');
document.getElementById('saveSettingsBtn')?.classList.add('btn-success');
});
return false;
}
document.getElementById('restartBtn').onclick = (event) => {
fetch('/api/restart');
return false;
}
var ledsForm = document.querySelector('#ledsForm');
ledsForm.onsubmit = (event) => {