mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 15:34:44 +02:00
Resource changes
This commit is contained in:
parent
85b250d016
commit
ea146f4715
@ -47,7 +47,8 @@ class ListMounts extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
Actions\CreateAction::make()
|
||||
->label('Create Mount'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,8 @@ class ListNodes extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
Actions\CreateAction::make()
|
||||
->label('Create Node'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,8 @@ class ListServers extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
Actions\CreateAction::make()
|
||||
->label('Create Server'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ class CreateUser extends CreateRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected static bool $canCreateAnother = false;
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
@ -22,15 +24,6 @@ class CreateUser extends CreateRecord
|
||||
Forms\Components\TextInput::make('username')->required()->maxLength(191),
|
||||
Forms\Components\TextInput::make('email')->email()->required()->maxLength(191),
|
||||
|
||||
Forms\Components\TextInput::make('name_first')
|
||||
->maxLength(191)
|
||||
->hidden(fn (string $operation): bool => $operation === 'create')
|
||||
->label('First Name'),
|
||||
Forms\Components\TextInput::make('name_last')
|
||||
->maxLength(191)
|
||||
->hidden(fn (string $operation): bool => $operation === 'create')
|
||||
->label('Last Name'),
|
||||
|
||||
Forms\Components\TextInput::make('password')
|
||||
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
|
||||
->dehydrated(fn (?string $state): bool => filled($state))
|
||||
|
@ -22,15 +22,6 @@ class EditUser extends EditRecord
|
||||
Forms\Components\TextInput::make('username')->required()->maxLength(191),
|
||||
Forms\Components\TextInput::make('email')->email()->required()->maxLength(191),
|
||||
|
||||
Forms\Components\TextInput::make('name_first')
|
||||
->maxLength(191)
|
||||
->hidden(fn (string $operation): bool => $operation === 'create')
|
||||
->label('First Name'),
|
||||
Forms\Components\TextInput::make('name_last')
|
||||
->maxLength(191)
|
||||
->hidden(fn (string $operation): bool => $operation === 'create')
|
||||
->label('Last Name'),
|
||||
|
||||
Forms\Components\TextInput::make('password')
|
||||
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
|
||||
->dehydrated(fn (?string $state): bool => filled($state))
|
||||
@ -62,12 +53,14 @@ class EditUser extends EditRecord
|
||||
->default(false),
|
||||
|
||||
Forms\Components\Hidden::make('skipValidation')->default(true),
|
||||
|
||||
Forms\Components\Select::make('language')
|
||||
->required()
|
||||
->hidden()
|
||||
->default('en')
|
||||
->options(fn (User $user) => $user->getAvailableLanguages()),
|
||||
])->columns(2),
|
||||
|
||||
])->columns(),
|
||||
]);
|
||||
}
|
||||
protected function getHeaderActions(): array
|
||||
|
@ -52,10 +52,10 @@ class ListUsers extends ListRecords
|
||||
->label('Servers'),
|
||||
Tables\Columns\TextColumn::make('subusers_count')
|
||||
->visibleFrom('sm')
|
||||
->label('Subusers')
|
||||
->counts('subusers')
|
||||
->icon('tabler-users')
|
||||
// ->formatStateUsing(fn (string $state, $record): string => (string) ($record->servers_count + $record->subusers_count))
|
||||
->label('Subuser Accounts'),
|
||||
->icon('tabler-users'),
|
||||
// ->formatStateUsing(fn (string $state, $record): string => (string) ($record->servers_count + $record->subusers_count))
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
@ -72,7 +72,8 @@ class ListUsers extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
Actions\CreateAction::make()
|
||||
->label('Create User'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user