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,
])
->disabled(),
TextInput::make('id')
->label(trans('server/setting.server_info.id'))
TextInput::make('uuid_short')
->label(trans('server/setting.server_info.uuid_short'))
->disabled()
->columnSpan(1),
TextInput::make('node.name')

View File

@ -381,7 +381,7 @@ class Server extends Model implements Validatable
public function resolveRouteBinding($value, $field = null): ?self
{
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(),
};
}

View File

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

View File

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