From d171b6982d8ecb29b0ccbecc26098d3c4aea588a Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 16 Jan 2021 19:22:21 -0600 Subject: [PATCH] Add hide button for upgrade logs --- .../var/www/mynode/templates/reboot.html | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/rootfs/standard/var/www/mynode/templates/reboot.html b/rootfs/standard/var/www/mynode/templates/reboot.html index b7f879d2..5b97f0d4 100644 --- a/rootfs/standard/var/www/mynode/templates/reboot.html +++ b/rootfs/standard/var/www/mynode/templates/reboot.html @@ -33,7 +33,12 @@ setInterval(checkStatus, 2500); {% if show_upgrade_log is defined and show_upgrade_log %} + showing_log=0; function update_upgrade_log () { + if (showing_log == 0) { + return; + } + console.log("Updating upgrade log..."); $.get("/settings/get-upgrade-log-raw", function(data) { //console.log(data) @@ -45,13 +50,20 @@ }); } $("#show_upgrade_log").on("click", function() { - $("#show_upgrade_log").hide(0); - $("#loading_spinner").hide(0); + if (!showing_log) { + $("#show_upgrade_log").html("Hide Upgrade Log"); + $("#loading_spinner").hide(0); + $("#upgrade_log").show(); + update_upgrade_log(); + showing_log=1; + } else { + $("#show_upgrade_log").html("Show Upgrade Log"); + $("#loading_spinner").show(); + $("#upgrade_log").hide(0); + showing_log=0; + } - update_upgrade_log() setInterval(update_upgrade_log, 4000); - - $("#upgrade_log").show(); }); {% endif %} }); @@ -71,13 +83,15 @@
-

{% if show_upgrade_log is defined and show_upgrade_log %} - + +

+ + {% endif %}