diff --git a/dist/css/custom.css b/dist/css/custom.css index 8901c950..b6824b90 100644 --- a/dist/css/custom.css +++ b/dist/css/custom.css @@ -49,6 +49,35 @@ min-height:500px; } +.service-status-running, +.service-status-stopped { + background-color: #fff; + color: #333; + text-transform: uppercase; + line-height: inherit; +} +.service-status-running:before, +.service-status-stopped:before { + display: inline-block; + height: 16px; + width: 16px; + content: "\2022"; + font-size: 3.5em; + color: green; + line-height: 16px; + vertical-align: bottom; + margin-right: 2px; +} +.service-status-stopped:before { + color: red; + animation: flash 1s linear infinite; +} +@keyframes flash { + 50% { + opacity: 0; + } +} + .logoutput { width:100%; height:300px; diff --git a/includes/dhcp.php b/includes/dhcp.php index 57c02d8b..f95475dd 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -96,14 +96,10 @@ function DisplayDHCPConfig() } else { $status->addMessage('dnsmasq already stopped', 'info'); } - } else { - if ($dnsmasq_state) { - $status->addMessage('Dnsmasq is running', 'success'); - } else { - $status->addMessage('Dnsmasq is not running', 'warning'); - } } + $serviceStatus = $dnsmasq_state ? "running" : "stopped"; + exec('cat '. RASPI_DNSMASQ_CONFIG, $return); $conf = ParseConfig($return); $arrRange = explode(",", $conf['dhcp-range']); @@ -140,7 +136,10 @@ function DisplayDHCPConfig()
-
+
+ + dnsmasq +

showMessages(); ?>

diff --git a/includes/hostapd.php b/includes/hostapd.php index 93f1fc6c..65ed5eb3 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -44,11 +44,7 @@ function DisplayHostAPDConfig() exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig); exec('pidof hostapd | wc -l', $hostapdstatus); - if ($hostapdstatus[0] == 0) { - $status->addMessage('HostAPD is not running', 'warning'); - } else { - $status->addMessage('HostAPD is running', 'success'); - } + $serviceStatus = $hostapdstatus[0] == 0 ? "stopped" : "running"; foreach ($hostapdconfig as $hostapdconfigline) { if (strlen($hostapdconfigline) === 0) { @@ -65,7 +61,10 @@ function DisplayHostAPDConfig()
-
+
+ + hostapd +

showMessages(); ?>