From 3e404b0202066c74448fb7a07367806f3731c8b1 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 21 Oct 2023 15:43:49 +0100 Subject: [PATCH] Reduce service restart speed + UI tweaks --- app/js/custom.js | 7 ++++--- includes/hostapd.php | 6 +++--- templates/hostapd.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/js/custom.js b/app/js/custom.js index e7ec3b456..1d679dfdd 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -274,15 +274,16 @@ function loadChannel() { } $('#hostapdModal').on('shown.bs.modal', function (e) { - var seconds = 9; + var seconds = 3; + var pct = 0; var countDown = setInterval(function(){ if(seconds <= 0){ clearInterval(countDown); } - var pct = Math.floor(100-(seconds*100/9)); document.getElementsByClassName('progress-bar').item(0).setAttribute('style','width:'+Number(pct)+'%'); seconds --; - }, 1000); + pct = Math.floor(100-(seconds*100/4)); + }, 500); }); $('#configureClientModal').on('shown.bs.modal', function (e) { diff --git a/includes/hostapd.php b/includes/hostapd.php index af4882783..a052e4c2d 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -49,11 +49,11 @@ function DisplayHostAPDConfig() if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) { $status->addMessage('Attempting to start hotspot', 'info'); if ($arrHostapdConf['BridgedEnable'] == 1) { - exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface br0 --seconds 3', $return); + exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface br0 --seconds 2', $return); } elseif ($arrHostapdConf['WifiAPEnable'] == 1) { - exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface uap0 --seconds 3', $return); + exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface uap0 --seconds 2', $return); } else { - exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --seconds 3', $return); + exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --seconds 2', $return); } foreach ($return as $line) { $status->addMessage($line, 'info'); diff --git a/templates/hostapd.php b/templates/hostapd.php index b6f2fce75..87a0c7611 100755 --- a/templates/hostapd.php +++ b/templates/hostapd.php @@ -12,7 +12,7 @@