Rename to normal

This commit is contained in:
Lance Pioch 2024-04-20 22:55:21 -04:00
parent 67edf4f472
commit 204734914d
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ namespace App\Enums;
enum ServerState: string enum ServerState: string
{ {
case None = 'none'; case Normal = 'normal';
case Installing = 'installing'; case Installing = 'installing';
case InstallFailed = 'install_failed'; case InstallFailed = 'install_failed';
case ReinstallFailed = 'reinstall_failed'; case ReinstallFailed = 'reinstall_failed';
@ -14,7 +14,7 @@ enum ServerState: string
public function icon(): string public function icon(): string
{ {
return match ($this) { return match ($this) {
self::None => 'tabler-heart', self::Normal => 'tabler-heart',
self::Installing => 'tabler-heart-bolt', self::Installing => 'tabler-heart-bolt',
self::InstallFailed => 'tabler-heart-x', self::InstallFailed => 'tabler-heart-x',
self::ReinstallFailed => 'tabler-heart-x', self::ReinstallFailed => 'tabler-heart-x',
@ -26,7 +26,7 @@ enum ServerState: string
public function color(): string public function color(): string
{ {
return match ($this) { return match ($this) {
self::None => 'primary', self::Normal => 'primary',
self::Installing => 'info', self::Installing => 'info',
self::InstallFailed => 'danger', self::InstallFailed => 'danger',
self::ReinstallFailed => 'danger', self::ReinstallFailed => 'danger',

View File

@ -72,7 +72,7 @@ class ServerResource extends Resource
->helperText('') ->helperText('')
->hiddenOn('create') ->hiddenOn('create')
->disableOptionWhen(fn ($state, $value) => $state !== $value) ->disableOptionWhen(fn ($state, $value) => $state !== $value)
->formatStateUsing(fn ($state) => $state ?? 'none') ->formatStateUsing(fn ($state) => $state ?? ServerState::Normal)
->options(collect(ServerState::cases())->mapWithKeys( ->options(collect(ServerState::cases())->mapWithKeys(
fn (ServerState $state) => [$state->value => str($state->value)->replace('_', ' ')->ucwords()] fn (ServerState $state) => [$state->value => str($state->value)->replace('_', ' ')->ucwords()]
)) ))