mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
migrating tests (Backups)
This commit is contained in:
@ -14,6 +14,8 @@ class Index extends Page
|
||||
|
||||
protected static ?string $title = 'Headless Console';
|
||||
|
||||
protected static ?string $navigationLabel = 'Console';
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->authorize('manage', $this->server);
|
||||
|
@ -31,7 +31,7 @@ public function mount(): void
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('Create backup')
|
||||
Action::make('create')
|
||||
->icon('heroicon-o-plus')
|
||||
->modalWidth(MaxWidth::Large)
|
||||
->authorize(fn () => auth()->user()?->can('create', [Backup::class, $this->server]))
|
||||
|
@ -31,7 +31,7 @@ class MetricDetails extends Widget implements HasForms, HasInfolists
|
||||
public function infolist(Infolist $infolist): Infolist
|
||||
{
|
||||
return $infolist
|
||||
->record($this->server->metrics()->latest()->first())
|
||||
->record($this->server->metrics()->latest()->first() ?? new Metric)
|
||||
->schema([
|
||||
Grid::make()
|
||||
->schema([
|
||||
|
@ -37,10 +37,10 @@ protected function getStats(): array
|
||||
Stat::make('CPU Load', $lastMetric?->load ?? 0)
|
||||
->color('success')
|
||||
->chart($metrics->pluck('load')->toArray()),
|
||||
Stat::make('Memory Usage', Number::fileSize($lastMetric->memory_used_in_bytes, 2))
|
||||
Stat::make('Memory Usage', Number::fileSize($lastMetric?->memory_used_in_bytes || 0, 2))
|
||||
->color('warning')
|
||||
->chart($metrics->pluck('memory_used')->toArray()),
|
||||
Stat::make('Disk Usage', Number::fileSize($lastMetric->disk_used_in_bytes, 2))
|
||||
Stat::make('Disk Usage', Number::fileSize($lastMetric?->disk_used_in_bytes || 0, 2))
|
||||
->color('primary')
|
||||
->chart($metrics->pluck('disk_used')->toArray()),
|
||||
];
|
||||
|
Reference in New Issue
Block a user