From dc1a9759ef775690f2e320792607902459243dc0 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Thu, 3 Apr 2025 13:48:33 -0700 Subject: [PATCH] fix: update Boot.php to enhance theme handling and improve status display elements --- emhttp/plugins/dynamix/include/Boot.php | 52 ++++++++++++++++++------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/emhttp/plugins/dynamix/include/Boot.php b/emhttp/plugins/dynamix/include/Boot.php index d3dfdb900..278f9928d 100644 --- a/emhttp/plugins/dynamix/include/Boot.php +++ b/emhttp/plugins/dynamix/include/Boot.php @@ -20,9 +20,20 @@ $_SERVER['REQUEST_URI'] = ''; require_once "$docroot/webGui/include/Translations.php"; $var = parse_ini_file("/var/local/emhttp/var.ini"); + +/** + * Just like DefaultPageLayout.php + */ +$theme = strtok($display['theme'],'-'); +$themes1 = in_array($theme,['black','white']); +$themes2 = in_array($theme,['gray','azure']); +$themeHtmlClass = "Theme--$theme"; +if ($themes2) { + $themeHtmlClass .= " Theme--sidebar"; +} ?> -lang=""> +lang="" class=""> @@ -35,11 +46,22 @@ $var = parse_ini_file("/var/local/emhttp/var.ini"); "> "> -"> +"> @@ -65,7 +87,7 @@ boot.on('message', function(msg) { default : var status = ""+_('Array '+ini['fsState'])+""; } status += ini['fsProgress'] ? "
"+_(ini['fsProgress'])+"" : "
 "; - $('.sub1').html(status); + $('.js-arrayStatus').html(status); }); function parseINI(msg) { @@ -102,19 +124,19 @@ function timer() { return Math.round((now.getTime()-start.getTime())/1000); } function reboot_now() { - $('.notice').html(" - "); + $('.js-bootTitle').html(" - "); boot.start(); reboot_online(); } function shutdown_now() { - $('.notice').html(" - "); + $('.js-bootTitle').html(" - "); boot.start(); shutdown_online(); } function reboot_online() { $.ajax({url:'/webGui/include/ProcessStatus.php',type:'POST',data:{name:'emhttpd',update:true},timeout:500}) .done(function(){ - $('.sub2').html("... "+timer()); + $('.js-powerStatus').html("... "+timer()); setTimeout(reboot_online,500); }) .fail(function(){start=new Date(); setTimeout(reboot_offline,500);}); @@ -123,14 +145,14 @@ function reboot_offline() { $.ajax({url:'/webGui/include/ProcessStatus.php',type:'POST',data:{name:'emhttpd',update:true},timeout:500}) .done(function(){location = '/Main';}) .fail(function(){ - $('.sub2').html("... "+timer()); + $('.js-powerStatus').html("... "+timer()); setTimeout(reboot_offline,500); }); } function shutdown_online() { $.ajax({url:'/webGui/include/ProcessStatus.php',type:'POST',data:{name:'emhttpd',update:true},timeout:500}) .done(function(){ - $('.sub2').html("... "+timer()); + $('.js-powerStatus').html("... "+timer()); setTimeout(shutdown_online,500); }) .fail(function(){start=new Date(); setTimeout(shutdown_offline,500);}); @@ -138,10 +160,10 @@ function shutdown_online() { function shutdown_offline() { var time = timer(); if (time < 30) { - $('.sub2').html("... "+time); + $('.js-powerStatus').html("... "+time); setTimeout(shutdown_offline,500); } else { - $('.sub2').html("..."); + $('.js-powerStatus').html("..."); setTimeout(power_on,500); } } @@ -177,8 +199,8 @@ case 'shutdown': exec('/sbin/poweroff -n'); break; } -echo '
'; -echo '
'; +echo '
'; +echo '
'; switch (_var($var,'fsState')) { case 'Stopped': echo "",_('Array Stopped'),"$progress"; break; @@ -190,7 +212,7 @@ default: echo "",_('Array Started'),"$progress"; break; } echo '
'; -echo '
'; +echo '
'; echo ''; }else{ ?>