mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 18:15:49 +00:00
feat(ui): move Sentinel to dedicated tab with sidebar navigation and logs page
This commit is contained in:
12 files changed
+242
-131
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user