Switch tenant slug back to short uuid (#1732)

This commit is contained in:
Boy132 2025-09-28 19:11:41 +02:00 committed by GitHub
parent 9f35f1c3ee
commit 5373f1e30a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -83,8 +83,8 @@ class Settings extends ServerFormPage
'lg' => 4, 'lg' => 4,
]) ])
->disabled(), ->disabled(),
TextInput::make('id') TextInput::make('uuid_short')
->label(trans('server/setting.server_info.id')) ->label(trans('server/setting.server_info.uuid_short'))
->disabled() ->disabled()
->columnSpan(1), ->columnSpan(1),
TextInput::make('node.name') TextInput::make('node.name')

View File

@ -381,7 +381,7 @@ class Server extends Model implements Validatable
public function resolveRouteBinding($value, $field = null): ?self public function resolveRouteBinding($value, $field = null): ?self
{ {
return match ($field) { return match ($field) {
'uuid' => $this->where('uuid_short', $value)->orWhere('uuid', $value)->firstOrFail(), 'uuid', 'uuid_short' => $this->where('uuid_short', $value)->orWhere('uuid', $value)->firstOrFail(),
default => $this->where('id', $value)->firstOrFail(), default => $this->where('id', $value)->firstOrFail(),
}; };
} }

View File

@ -19,7 +19,7 @@ class ServerPanelProvider extends PanelProvider
->id('server') ->id('server')
->path('server') ->path('server')
->homeUrl(fn () => Filament::getPanel('app')->getUrl()) ->homeUrl(fn () => Filament::getPanel('app')->getUrl())
->tenant(Server::class) ->tenant(Server::class, 'uuid_short')
->userMenuItems([ ->userMenuItems([
Action::make('to_serverList') Action::make('to_serverList')
->label(trans('profile.server_list')) ->label(trans('profile.server_list'))

View File

@ -12,7 +12,7 @@ return [
'notification_description' => 'Updated Server Description', 'notification_description' => 'Updated Server Description',
'failed' => 'Failed', 'failed' => 'Failed',
'uuid' => 'Server UUID', 'uuid' => 'Server UUID',
'id' => 'Server ID', 'uuid_short' => 'Server ID',
'node_name' => 'Node Name', 'node_name' => 'Node Name',
'limits' => [ 'limits' => [
'title' => 'Limits', 'title' => 'Limits',