Skip to content

Commit

Permalink
Add Kill button to console (#791)
Browse files Browse the repository at this point in the history
* Add Kill button to console

* Add confirm, and warning
  • Loading branch information
notAreYouScared authored Dec 8, 2024
1 parent 23246eb commit feadaa2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/Filament/Server/Pages/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ protected function getHeaderActions(): array
->size(ActionSize::ExtraLarge)
->action(fn () => $this->dispatch('setServerState', state: 'stop'))
->disabled(fn () => $server->isInConflictState() || $server->retrieveStatus() == 'offline'),
Action::make('kill')
->color('danger')
->requiresConfirmation()
->modalHeading('Do you wish to kill this server?')
->modalDescription('This can result in data corruption and/or data loss!')
->modalSubmitActionLabel('Kill Server')
->size(ActionSize::ExtraLarge)
->action(fn () => $this->dispatch('setServerState', state: 'kill'))
->disabled(fn () => $server->isInConflictState() || $server->retrieveStatus() == 'offline'),
];
}
}

0 comments on commit feadaa2

Please sign in to comment.