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:
RD WebDesign
2022-07-18 18:29:21 -03:00
parent e79a1d1535
commit 79187b1258
5 changed files with 485 additions and 494 deletions

View File

@@ -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));
}
}
?>