Files
Virtnet.bond/extensions/Servers/Proxmox/Admin/Resources/ServerResource/Pages/EditServer.php
2025-11-30 11:57:22 +01:00

37 lines
1.1 KiB
PHP

<?php
namespace Paymenter\Extensions\Servers\Proxmox\Admin\Resources\ServerResource\Pages;
use Filament\Actions;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Paymenter\Extensions\Servers\Proxmox\Admin\Resources\ServerResource;
use Paymenter\Extensions\Servers\Proxmox\Proxmox;
class EditServer extends EditRecord
{
protected static string $resource = ServerResource::class;
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
Actions\Action::make('reinstall')
->label('Reinstall')
->action(function () {
$proxmox = new Proxmox;
$proxmox->reinstall($this->record);
Notification::make()
->title('Reinstalling server')
->success()
->body('The server is being reinstalled.')
->send();
})
->color('danger')
->requiresConfirmation()
->icon('ri-refresh-line'),
];
}
}