Fixed term buttons not changing on start/stop

This commit is contained in:
Andrew 2021-08-21 15:17:07 -04:00
parent c8759ac872
commit 35047e062a
3 changed files with 17 additions and 6 deletions

View File

@ -232,12 +232,6 @@ if (webSocket) {
});
}
if (webSocket) {
webSocket.on('send_start_reload', function (start_error) {
location.reload()
});
}
function warn(message) {
var closeEl = document.createElement('span');

View File

@ -286,6 +286,13 @@ $( document ).ready(function() {
mem_percent.textContent = hostStats.mem_percent + '%';
});
}
if (webSocket) {
webSocket.on('send_start_reload', function (start_error) {
location.reload()
});
}
if (webSocket) {
webSocket.on('update_button_status', function (updateButton) {
var id = 'controls';

View File

@ -77,6 +77,16 @@
<script>
function send_command (server_id, command){
if (command == 'start_server'){
startBtn.setAttribute('disabled', 'disabled');
restartBtn.removeAttribute('disabled');
stopBtn.removeAttribute('disabled');
}
if (command == 'stop_server'){
startBtn.removeAttribute('disabled');
restartBtn.setAttribute('disabled', 'disabled');
stopBtn.setAttribute('disabled', 'disabled');
}
<!-- this getCookie function is in base.html-->
var token = getCookie("_xsrf");