feat(proxy-dashboard): implement ProxyDashboardCacheService to manage Traefik dashboard cache; clear cache on configuration changes and proxy actions

This commit is contained in:
Andras Bacsai
2025-06-06 19:18:32 +02:00
parent 7cc91e7a04
commit 1cdc01194b
8 changed files with 100 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Livewire\Server;
use App\Actions\Proxy\CheckConfiguration;
use App\Actions\Proxy\SaveConfiguration;
use App\Models\Server;
use App\Services\ProxyDashboardCacheService;
use Livewire\Component;
class Proxy extends Component
@@ -41,6 +42,10 @@ class Proxy extends Component
{
$this->server->proxy = null;
$this->server->save();
// Clear Traefik dashboard cache when proxy type changes
ProxyDashboardCacheService::clearCache($this->server);
$this->dispatch('reloadWindow');
}
@@ -49,6 +54,10 @@ class Proxy extends Component
try {
$this->server->changeProxy($proxy_type, async: false);
$this->selectedProxy = $this->server->proxy->type;
// Clear Traefik dashboard cache when proxy type is selected
ProxyDashboardCacheService::clearCache($this->server);
$this->dispatch('reloadWindow');
} catch (\Throwable $e) {
return handleError($e, $this);