asdsad
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-27 01:38:54 +02:00
parent bff852291e
commit 44945a31da
6 changed files with 83 additions and 13 deletions

View File

@@ -209,10 +209,18 @@ $detectApi = function (array $instance) use ($v6Auth, $v6RequestAny, $v5Request)
$authRes = $v6Auth($instance);
if (($authRes['ok'] ?? false) && !empty($authRes['sid'])) {
$sid = (string)$authRes['sid'];
$probe = $v6RequestAny($instance, ['dns/blocking', 'stats/summary', 'summary'], 'GET', [], $sid);
return ['version' => 6, 'sid' => $sid, 'probe' => $probe, 'auth' => $authRes];
}
$httpCode = (int)($authRes['http_code'] ?? 0);
if (in_array($httpCode, [401, 403], true)) {
return ['version' => 6, 'sid' => '', 'probe' => $authRes, 'auth' => $authRes];
}
}
$probe = $v6RequestAny($instance, ['stats/summary', 'summary'], 'GET', [], $sid);
$probe = $v6RequestAny($instance, ['dns/blocking', 'stats/summary', 'summary'], 'GET', [], $sid);
if ($probe['ok'] || in_array((int)($probe['http_code'] ?? 0), [401, 403], true)) {
return ['version' => 6, 'sid' => $sid, 'probe' => $probe, 'auth' => $authRes];
}
@@ -222,7 +230,7 @@ $detectApi = function (array $instance) use ($v6Auth, $v6RequestAny, $v5Request)
return ['version' => 5, 'sid' => '', 'probe' => $legacy];
}
return ['version' => 0, 'sid' => '', 'probe' => $probe, 'legacy' => $legacy];
return ['version' => 0, 'sid' => '', 'probe' => $probe, 'legacy' => $legacy, 'auth' => $authRes];
};
$debugResult = static function (string $label, string $instanceId, array $instance, array $result) use ($debugPush): void {

View File

@@ -3,14 +3,19 @@ $assets = app()->assets();
$assets->addStyle('/module/pihole/asset?file=pihole.css');
$assets->addScript('/module/pihole/asset?file=pihole.js', 'footer', true);
$settings = modules()->settings('pihole');
$instances = module_fn('pihole', 'instances');
$hasConfig = !empty($instances);
$refreshSeconds = (int)($settings['dashboard_refresh_sec'] ?? 1);
if ($refreshSeconds < 0) {
$refreshSeconds = 1;
}
?>
<?= module_shell_header('pihole', [
'title' => 'Pi-hole Dashboard',
'description' => 'Status, Blockings, Usage und Steuerung fuer beide Instanzen.',
]) ?>
<div class="module-flow pihole-page" data-pihole-page="dashboard">
<div class="module-flow pihole-page" data-pihole-page="dashboard" data-refresh-seconds="<?= e((string)$refreshSeconds) ?>">
<section class="module-box">
<div class="pihole-section-header">

View File

@@ -3,14 +3,19 @@ $assets = app()->assets();
$assets->addStyle('/module/pihole/asset?file=pihole.css');
$assets->addScript('/module/pihole/asset?file=pihole.js', 'footer', true);
$settings = modules()->settings('pihole');
$instances = module_fn('pihole', 'instances');
$hasConfig = !empty($instances);
$refreshSeconds = (int)($settings['lists_refresh_sec'] ?? 5);
if ($refreshSeconds < 0) {
$refreshSeconds = 5;
}
?>
<?= module_shell_header('pihole', [
'title' => 'Listen & Domains',
'description' => 'Top-Domains, Listen-Updates und neue Eintraege auf der Primaer-Instanz.',
]) ?>
<div class="module-flow pihole-page" data-pihole-page="lists">
<div class="module-flow pihole-page" data-pihole-page="lists" data-refresh-seconds="<?= e((string)$refreshSeconds) ?>">
<?php if (!$hasConfig): ?>
<div class="module-box">
<strong>Keine Instanzen konfiguriert</strong>

View File

@@ -3,14 +3,19 @@ $assets = app()->assets();
$assets->addStyle('/module/pihole/asset?file=pihole.css');
$assets->addScript('/module/pihole/asset?file=pihole.js', 'footer', true);
$settings = modules()->settings('pihole');
$instances = module_fn('pihole', 'instances');
$hasConfig = !empty($instances);
$refreshSeconds = (int)($settings['queries_refresh_sec'] ?? 5);
if ($refreshSeconds < 0) {
$refreshSeconds = 5;
}
?>
<?= module_shell_header('pihole', [
'title' => 'Zugriffe & Blockings',
'description' => 'Aktuelle Blockings, Top Clients und Status pro Instanz.',
]) ?>
<div class="module-flow pihole-page" data-pihole-page="queries">
<div class="module-flow pihole-page" data-pihole-page="queries" data-refresh-seconds="<?= e((string)$refreshSeconds) ?>">
<?php if (!$hasConfig): ?>
<div class="module-box">
<strong>Keine Instanzen konfiguriert</strong>