Update Mobile View

This commit is contained in:
notCharles 2024-05-18 17:47:33 -04:00
parent 1db1a1a3e0
commit 5344d99a40
3 changed files with 29 additions and 46 deletions

View File

@ -25,12 +25,12 @@ class EditEgg extends EditRecord
Forms\Components\TextInput::make('name') Forms\Components\TextInput::make('name')
->required() ->required()
->maxLength(191) ->maxLength(191)
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 1]) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 1])
->helperText('A simple, human-readable name to use as an identifier for this Egg.'), ->helperText('A simple, human-readable name to use as an identifier for this Egg.'),
Forms\Components\TextInput::make('uuid') Forms\Components\TextInput::make('uuid')
->label('Egg UUID') ->label('Egg UUID')
->disabled() ->disabled()
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2])
->helperText('This is the globally unique identifier for this Egg which Wings uses as an identifier.'), ->helperText('This is the globally unique identifier for this Egg which Wings uses as an identifier.'),
Forms\Components\TextInput::make('id') Forms\Components\TextInput::make('id')
->label('Egg ID') ->label('Egg ID')

View File

@ -31,28 +31,13 @@ class ListEggs extends ListRecords
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('name') Tables\Columns\TextColumn::make('name')
->icon('tabler-egg') ->icon('tabler-egg')
->description(fn ($record): ?string => $record->description) ->description(fn ($record): ?string => (strlen($record->description) > 120) ? substr($record->description, 0, 120).'...' : $record->description)
->wrap() ->wrap()
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('author')
->hidden()
->searchable(),
Tables\Columns\TextColumn::make('servers_count') Tables\Columns\TextColumn::make('servers_count')
->counts('servers') ->counts('servers')
->icon('tabler-server') ->icon('tabler-server')
->label('Servers'), ->label('Servers'),
Tables\Columns\TextColumn::make('script_container')
->searchable()
->hidden(),
Tables\Columns\TextColumn::make('copyFrom.name')
->hidden()
->sortable(),
Tables\Columns\TextColumn::make('script_entry')
->hidden()
->searchable(),
])
->filters([
//
]) ])
->actions([ ->actions([
Tables\Actions\EditAction::make(), Tables\Actions\EditAction::make(),
@ -63,9 +48,6 @@ class ListEggs extends ListRecords
// TODO uses old admin panel export service // TODO uses old admin panel export service
->url(fn (Egg $egg): string => route('admin.eggs.export', ['egg' => $egg])), ->url(fn (Egg $egg): string => route('admin.eggs.export', ['egg' => $egg])),
]) ])
->headerActions([
//
])
->bulkActions([ ->bulkActions([
Tables\Actions\BulkActionGroup::make([ Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(), Tables\Actions\DeleteBulkAction::make(),

View File

@ -185,26 +185,37 @@ class EditNode extends EditRecord
]) ])
->default(fn () => request()->isSecure() ? 'https' : 'http'), ]), ->default(fn () => request()->isSecure() ? 'https' : 'http'), ]),
Tabs\Tab::make('Advanced Settings') Tabs\Tab::make('Advanced Settings')
->columns(['default' => 1, 'sm' => 1, 'md' => 4, 'lg' => 6])
->icon('tabler-server-cog') ->icon('tabler-server-cog')
->schema([ ->schema([
Forms\Components\TextInput::make('id') Forms\Components\TextInput::make('id')
->label('Node ID') ->label('Node ID')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 1])
->disabled(), ->disabled(),
Forms\Components\TextInput::make('uuid') Forms\Components\TextInput::make('uuid')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2])
->label('Node UUID') ->label('Node UUID')
->hintAction(CopyAction::make()) ->hintAction(CopyAction::make())
->columnSpan(2)
->disabled(), ->disabled(),
Forms\Components\TagsInput::make('tags') Forms\Components\TagsInput::make('tags')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2])
->label('Tags') ->label('Tags')
->disabled() ->disabled()
->placeholder('Not Implemented') ->placeholder('Not Implemented')
->hintIcon('tabler-question-mark') ->hintIcon('tabler-question-mark')
->hintIconTooltip('Not Implemented') ->hintIconTooltip('Not Implemented'),
->columnSpan(1), Forms\Components\TextInput::make('upload_size')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 1])
->label('Upload Limit')
->hintIcon('tabler-question-mark')
->hintIconTooltip('Enter the maximum size of files that can be uploaded through the web-based file manager.')
->numeric()->required()
->minValue(1)
->maxValue(1024)
->suffix('MiB'),
Forms\Components\ToggleButtons::make('public') Forms\Components\ToggleButtons::make('public')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 3])
->label('Automatic Allocation')->inline() ->label('Automatic Allocation')->inline()
->columnSpan(1)
->options([ ->options([
true => 'Yes', true => 'Yes',
false => 'No', false => 'No',
@ -214,29 +225,20 @@ class EditNode extends EditRecord
false => 'danger', false => 'danger',
]), ]),
Forms\Components\ToggleButtons::make('maintenance_mode') Forms\Components\ToggleButtons::make('maintenance_mode')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 3])
->label('Maintenance Mode')->inline() ->label('Maintenance Mode')->inline()
->columnSpan(1)
->hinticon('tabler-question-mark') ->hinticon('tabler-question-mark')
->hintIconTooltip("If the node is marked 'Under Maintenance' users won't be able to access servers that are on this node.") ->hintIconTooltip("If the node is marked 'Under Maintenance' users won't be able to access servers that are on this node.")
->options([ ->options([
true => 'Enable',
false => 'Disable', false => 'Disable',
true => 'Enable',
]) ])
->colors([ ->colors([
true => 'danger',
false => 'success', false => 'success',
true => 'danger',
]), ]),
Forms\Components\TextInput::make('upload_size')
->label('Upload Limit')
->hintIcon('tabler-question-mark')
->hintIconTooltip('Enter the maximum size of files that can be uploaded through the web-based file manager.')
->columnStart(4)->columnSpan(1)
->numeric()->required()
->minValue(1)
->maxValue(1024)
->suffix('MiB'),
Forms\Components\Grid::make() Forms\Components\Grid::make()
->columns(6) ->columns(['default' => 1, 'sm' => 1, 'md' => 3, 'lg' => 6])
->columnSpanFull() ->columnSpanFull()
->schema([ ->schema([
Forms\Components\ToggleButtons::make('unlimited_mem') Forms\Components\ToggleButtons::make('unlimited_mem')
@ -253,14 +255,14 @@ class EditNode extends EditRecord
true => 'primary', true => 'primary',
false => 'warning', false => 'warning',
]) ])
->columnSpan(2), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2]),
Forms\Components\TextInput::make('memory') Forms\Components\TextInput::make('memory')
->dehydratedWhenHidden() ->dehydratedWhenHidden()
->hidden(fn (Forms\Get $get) => $get('unlimited_mem')) ->hidden(fn (Forms\Get $get) => $get('unlimited_mem'))
->label('Memory Limit')->inlineLabel() ->label('Memory Limit')->inlineLabel()
->suffix('MiB') ->suffix('MiB')
->required() ->required()
->columnSpan(2) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2])
->numeric() ->numeric()
->minValue(0), ->minValue(0),
Forms\Components\TextInput::make('memory_overallocate') Forms\Components\TextInput::make('memory_overallocate')
@ -270,15 +272,14 @@ class EditNode extends EditRecord
->hidden(fn (Forms\Get $get) => $get('unlimited_mem')) ->hidden(fn (Forms\Get $get) => $get('unlimited_mem'))
->hintIcon('tabler-question-mark') ->hintIcon('tabler-question-mark')
->hintIconTooltip('The % allowable to go over the set limit.') ->hintIconTooltip('The % allowable to go over the set limit.')
->columnSpan(2) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2])
->numeric() ->numeric()
->minValue(-1) ->minValue(-1)
->maxValue(100) ->maxValue(100)
->suffix('%'), ->suffix('%'),
]), ]),
Forms\Components\Grid::make() Forms\Components\Grid::make()
->columns(6) ->columns(['default' => 1, 'sm' => 1, 'md' => 3, 'lg' => 6])
->columnSpanFull()
->schema([ ->schema([
Forms\Components\ToggleButtons::make('unlimited_disk') Forms\Components\ToggleButtons::make('unlimited_disk')
->label('Disk')->inlineLabel()->inline() ->label('Disk')->inlineLabel()->inline()
@ -294,14 +295,14 @@ class EditNode extends EditRecord
true => 'primary', true => 'primary',
false => 'warning', false => 'warning',
]) ])
->columnSpan(2), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2]),
Forms\Components\TextInput::make('disk') Forms\Components\TextInput::make('disk')
->dehydratedWhenHidden() ->dehydratedWhenHidden()
->hidden(fn (Forms\Get $get) => $get('unlimited_disk')) ->hidden(fn (Forms\Get $get) => $get('unlimited_disk'))
->label('Disk Limit')->inlineLabel() ->label('Disk Limit')->inlineLabel()
->suffix('MiB') ->suffix('MiB')
->required() ->required()
->columnSpan(2) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2])
->numeric() ->numeric()
->minValue(0), ->minValue(0),
Forms\Components\TextInput::make('disk_overallocate') Forms\Components\TextInput::make('disk_overallocate')
@ -310,7 +311,7 @@ class EditNode extends EditRecord
->label('Overallocate')->inlineLabel() ->label('Overallocate')->inlineLabel()
->hintIcon('tabler-question-mark') ->hintIcon('tabler-question-mark')
->hintIconTooltip('The % allowable to go over the set limit.') ->hintIconTooltip('The % allowable to go over the set limit.')
->columnSpan(2) ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 2])
->required() ->required()
->numeric() ->numeric()
->minValue(-1) ->minValue(-1)