mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 10:50:23 +01:00
Simplify header.php
- move some functions to `func.php` - move sidebar to its own file `sidebar.php` - fix indentation - LCARS CSS: hide menu headers when logged off - LCARS CSS: invert hover and active menu colors Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -595,4 +595,28 @@ function convertUnicodeToIDNA($IDNA) {
|
||||
|
||||
return $IDNA;
|
||||
}
|
||||
|
||||
// Return PID of FTL (used in settings.php)
|
||||
function pidofFTL() {
|
||||
return shell_exec("pidof pihole-FTL");
|
||||
}
|
||||
|
||||
// Get FTL process information (used in settings.php)
|
||||
function get_FTL_data($FTLpid, $arg) {
|
||||
return trim(exec("ps -p " . $FTLpid . " -o " . $arg));
|
||||
}
|
||||
|
||||
// Convert seconds into readable time (used in settings.php)
|
||||
function convertseconds($argument) {
|
||||
$seconds = round($argument);
|
||||
if ($seconds < 60) {
|
||||
return sprintf('%ds', $seconds);
|
||||
} elseif ($seconds < 3600) {
|
||||
return sprintf('%dm %ds', ($seconds / 60), ($seconds % 60));
|
||||
} elseif ($seconds < 86400) {
|
||||
return sprintf('%dh %dm %ds', ($seconds / 3600 % 24), ($seconds / 60 % 60), ($seconds % 60));
|
||||
} else {
|
||||
return sprintf('%dd %dh %dm %ds', ($seconds / 86400), ($seconds / 3600 % 24), ($seconds / 60 % 60), ($seconds % 60));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user