feat(ui): move Sentinel to dedicated tab with sidebar navigation and logs page

This commit is contained in:
ShadowArcanist committed 2026-04-14 18:50:01 +05:30
1 parent df5a9e9ba3
commit 6b1b1b14f2
12 files changed
+242 -131

No files matched your search

+24
View File
@@ -2,11 +2,15 @@
namespace App\Livewire\Server;
use App\Actions\Server\StartSentinel;
use App\Models\Server;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
class Charts extends Component
{
use AuthorizesRequests;
public Server $server;
public $chartId = 'server';
@@ -28,6 +32,26 @@ class Charts extends Component
}
}
public function toggleMetrics()
{
try {
$this->authorize('update', $this->server);
$this->server->settings->is_metrics_enabled = ! $this->server->settings->is_metrics_enabled;
$this->server->settings->save();
$this->server->refresh();
if ($this->server->isMetricsEnabled()) {
StartSentinel::run($this->server, true);
$this->dispatch('success', 'Metrics enabled. Restarting Sentinel.');
} else {
$this->server->restartSentinel();
$this->dispatch('success', 'Metrics disabled. Restarting Sentinel.');
}
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function pollData()
{
if ($this->poll || $this->interval <= 10) {