From be0ec33ecd2b6971fd4846a4d95cd85e643b78ec Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Jan 2026 07:00:58 +0200 Subject: [PATCH] Fix updates list and align admin navigation --- README.md | 3 +- VERSION | 2 +- app/Filament/Admin/Pages/AutomationApi.php | 2 +- app/Filament/Admin/Pages/DatabaseTuning.php | 2 +- app/Filament/Admin/Pages/EmailQueue.php | 2 +- app/Filament/Admin/Pages/ServerUpdates.php | 33 ++++++++++++++++--- app/Filament/Admin/Pages/Waf.php | 2 +- .../GeoBlockRules/GeoBlockRuleResource.php | 2 +- .../WebhookEndpointResource.php | 2 +- bin/jabali-agent | 2 +- 10 files changed, 38 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e1b1fe1..4cd815b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A modern web hosting control panel for WordPress and general PHP hosting. Built with Laravel 12, Filament v5, Livewire 4, and Tailwind CSS v4. -Version: 0.9-rc31 (release candidate) +Version: 0.9-rc32 (release candidate) This is a release candidate. Expect rapid iteration and breaking changes until 1.0. @@ -156,6 +156,7 @@ php artisan test --compact ## Initial Release +- 0.9-rc32: Server Updates list loads reliably; admin sidebar order aligned; apt update parsing expanded. - 0.9-rc31: File manager navigation uses Livewire actions; parent row excluded from bulk select. - 0.9-rc30: Avoid IncludeOptional in ModSecurity CRS includes. - 0.9-rc29: Ensure ModSecurity unicode mapping is installed automatically. diff --git a/VERSION b/VERSION index c78ca2a..3e0a9af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=0.9-rc31 +VERSION=0.9-rc32 diff --git a/app/Filament/Admin/Pages/AutomationApi.php b/app/Filament/Admin/Pages/AutomationApi.php index 55e50a5..16b12f5 100644 --- a/app/Filament/Admin/Pages/AutomationApi.php +++ b/app/Filament/Admin/Pages/AutomationApi.php @@ -27,7 +27,7 @@ class AutomationApi extends Page implements HasActions, HasTable protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedKey; - protected static ?int $navigationSort = 17; + protected static ?int $navigationSort = 16; protected static ?string $slug = 'automation-api'; diff --git a/app/Filament/Admin/Pages/DatabaseTuning.php b/app/Filament/Admin/Pages/DatabaseTuning.php index abac809..5e69577 100644 --- a/app/Filament/Admin/Pages/DatabaseTuning.php +++ b/app/Filament/Admin/Pages/DatabaseTuning.php @@ -26,7 +26,7 @@ class DatabaseTuning extends Page implements HasActions, HasTable protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCircleStack; - protected static ?int $navigationSort = 19; + protected static ?int $navigationSort = 18; protected static ?string $slug = 'database-tuning'; diff --git a/app/Filament/Admin/Pages/EmailQueue.php b/app/Filament/Admin/Pages/EmailQueue.php index 39cca5e..31dd39e 100644 --- a/app/Filament/Admin/Pages/EmailQueue.php +++ b/app/Filament/Admin/Pages/EmailQueue.php @@ -25,7 +25,7 @@ class EmailQueue extends Page implements HasActions, HasTable protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedQueueList; - protected static ?int $navigationSort = 15; + protected static ?int $navigationSort = 14; protected static ?string $slug = 'email-queue'; diff --git a/app/Filament/Admin/Pages/ServerUpdates.php b/app/Filament/Admin/Pages/ServerUpdates.php index d5d86c5..8a3ee80 100644 --- a/app/Filament/Admin/Pages/ServerUpdates.php +++ b/app/Filament/Admin/Pages/ServerUpdates.php @@ -25,7 +25,7 @@ class ServerUpdates extends Page implements HasActions, HasTable protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedArrowPathRoundedSquare; - protected static ?int $navigationSort = 16; + protected static ?int $navigationSort = 15; protected static ?string $slug = 'server-updates'; @@ -35,6 +35,8 @@ class ServerUpdates extends Page implements HasActions, HasTable protected ?AgentClient $agent = null; + protected bool $updatesLoaded = false; + public function getTitle(): string|Htmlable { return __('Server Updates'); @@ -47,7 +49,7 @@ class ServerUpdates extends Page implements HasActions, HasTable public function mount(): void { - $this->loadUpdates(); + $this->loadUpdates(false); } protected function getAgent(): AgentClient @@ -55,13 +57,15 @@ class ServerUpdates extends Page implements HasActions, HasTable return $this->agent ??= new AgentClient; } - public function loadUpdates(): void + public function loadUpdates(bool $refreshTable = true): void { try { $result = $this->getAgent()->updatesList(); $this->packages = $result['packages'] ?? []; + $this->updatesLoaded = true; } catch (\Exception $e) { $this->packages = []; + $this->updatesLoaded = true; Notification::make() ->title(__('Failed to load updates')) ->body($e->getMessage()) @@ -69,7 +73,9 @@ class ServerUpdates extends Page implements HasActions, HasTable ->send(); } - $this->resetTable(); + if ($refreshTable) { + $this->resetTable(); + } } public function runUpdates(): void @@ -94,7 +100,24 @@ class ServerUpdates extends Page implements HasActions, HasTable public function table(Table $table): Table { return $table - ->records(fn () => $this->packages) + ->records(function () { + if (! $this->updatesLoaded) { + $this->loadUpdates(false); + } + + return collect($this->packages) + ->mapWithKeys(function (array $package, int $index): array { + $keyParts = [ + $package['name'] ?? (string) $index, + $package['current_version'] ?? '', + $package['new_version'] ?? '', + ]; + $key = implode('|', array_filter($keyParts, fn (string $part): bool => $part !== '')); + + return [$key !== '' ? $key : (string) $index => $package]; + }) + ->all(); + }) ->columns([ TextColumn::make('name') ->label(__('Package')) diff --git a/app/Filament/Admin/Pages/Waf.php b/app/Filament/Admin/Pages/Waf.php index 8eb8126..bf9e496 100644 --- a/app/Filament/Admin/Pages/Waf.php +++ b/app/Filament/Admin/Pages/Waf.php @@ -24,7 +24,7 @@ class Waf extends Page implements HasForms protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedShieldCheck; - protected static ?int $navigationSort = 20; + protected static ?int $navigationSort = 19; protected static ?string $slug = 'waf'; diff --git a/app/Filament/Admin/Resources/GeoBlockRules/GeoBlockRuleResource.php b/app/Filament/Admin/Resources/GeoBlockRules/GeoBlockRuleResource.php index d4cbe87..10d4672 100644 --- a/app/Filament/Admin/Resources/GeoBlockRules/GeoBlockRuleResource.php +++ b/app/Filament/Admin/Resources/GeoBlockRules/GeoBlockRuleResource.php @@ -22,7 +22,7 @@ class GeoBlockRuleResource extends Resource protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedGlobeAlt; - protected static ?int $navigationSort = 22; + protected static ?int $navigationSort = 20; public static function getNavigationLabel(): string { diff --git a/app/Filament/Admin/Resources/WebhookEndpoints/WebhookEndpointResource.php b/app/Filament/Admin/Resources/WebhookEndpoints/WebhookEndpointResource.php index ef62513..70a6ecc 100644 --- a/app/Filament/Admin/Resources/WebhookEndpoints/WebhookEndpointResource.php +++ b/app/Filament/Admin/Resources/WebhookEndpoints/WebhookEndpointResource.php @@ -22,7 +22,7 @@ class WebhookEndpointResource extends Resource protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBellAlert; - protected static ?int $navigationSort = 18; + protected static ?int $navigationSort = 17; public static function getNavigationLabel(): string { diff --git a/bin/jabali-agent b/bin/jabali-agent index 5f62e8c..541696a 100755 --- a/bin/jabali-agent +++ b/bin/jabali-agent @@ -24692,7 +24692,7 @@ function updatesList(array $params): array continue; } - if (preg_match('/^([^\/]+)\/[^\s]+\s+([^\s]+)\s+[^\s]+\s+[^\s]+\s+\[upgradable from: ([^\]]+)\]/', $line, $matches)) { + if (preg_match('/^([^\/]+)\/\S+\s+(\S+)\s+\S+(?:\s+\S+)?\s+\[upgradable from: ([^\]]+)\]/', $line, $matches)) { $packages[] = [ 'name' => $matches[1], 'new_version' => $matches[2],