Fix: 503 fetch-Interceptor + Auto-Update-Polling + SSL-Banner prüft echte Certs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main v1.1.282
parent
8fd9fccc70
commit
904d60ed2b
|
|
@ -36,7 +36,15 @@ class Dashboard extends Component
|
|||
|
||||
$servicesActive = count(array_filter($services, fn($s) => $s['status'] === 'online'));
|
||||
|
||||
$sslConfigured = SettingModel::get('ssl_configured', '1') === '1';
|
||||
// Echte Zertifikatsdateien prüfen — nicht nur DB-Wert (kann veraltet sein)
|
||||
$uiDomain = (string) SettingModel::get('ui_domain', '');
|
||||
$sslConfigured = !$uiDomain
|
||||
|| file_exists("/etc/letsencrypt/renewal/{$uiDomain}.conf")
|
||||
|| is_dir("/etc/letsencrypt/live/{$uiDomain}");
|
||||
// DB-Wert nachziehen damit Banner nach einmaligem Check dauerhaft weg ist
|
||||
if ($sslConfigured && SettingModel::get('ssl_configured', '0') !== '1') {
|
||||
SettingModel::set('ssl_configured', '1');
|
||||
}
|
||||
|
||||
return view('livewire.ui.nx.dashboard', [
|
||||
'sslConfigured' => $sslConfigured,
|
||||
|
|
|
|||
|
|
@ -92,6 +92,14 @@ class UpdateCard extends Component
|
|||
$this->recomputeUi();
|
||||
}
|
||||
|
||||
public function refreshVersions(): void
|
||||
{
|
||||
if ($this->state === 'running') return;
|
||||
$this->reloadVersionsAndStatus();
|
||||
$this->recompute();
|
||||
$this->recomputeUi();
|
||||
}
|
||||
|
||||
public function pollUpdate(): void
|
||||
{
|
||||
$this->refreshLowLevelState();
|
||||
|
|
|
|||
|
|
@ -215,16 +215,19 @@
|
|||
@livewireScripts
|
||||
@livewire('wire-elements-modal')
|
||||
<script>
|
||||
document.addEventListener('livewire:init', () => {
|
||||
Livewire.hook('request', ({ fail }) => {
|
||||
fail(({ status, preventDefault }) => {
|
||||
if (status === 503) {
|
||||
preventDefault()
|
||||
setTimeout(() => window.location.reload(), 500)
|
||||
// 503 (Wartungsmodus) → sofortiger Page-Reload statt Livewire-Fehlerdialog
|
||||
;(function () {
|
||||
var _fetch = window.fetch
|
||||
window.fetch = function () {
|
||||
return _fetch.apply(this, arguments).then(function (resp) {
|
||||
if (resp.status === 503) {
|
||||
window.location.reload()
|
||||
return new Promise(function () {}) // Livewire-Chain abbrechen
|
||||
}
|
||||
return resp
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<div
|
||||
class="glass-card rounded-2xl p-4 border border-white/10 bg-white/5 max-h-fit"
|
||||
@if($state === 'running') wire:poll.3s="pollUpdate" @endif
|
||||
@if($state === 'running') wire:poll.3s="pollUpdate"
|
||||
@else wire:poll.2m="refreshVersions"
|
||||
@endif
|
||||
>
|
||||
<div class="flex items-start gap-2">
|
||||
{{-- Shield + Spinner --}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue