Skip to content

Commit

Permalink
Tweak EditNode layout for mobile (#752)
Browse files Browse the repository at this point in the history
* Tweak EditNode layout for mobile

* Replace hidden with toggle
  • Loading branch information
notAreYouScared authored Dec 3, 2024
1 parent 141baeb commit 994852c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
23 changes: 20 additions & 3 deletions app/Filament/Resources/NodeResource/Pages/EditNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public function form(Forms\Form $form): Forms\Form
Tab::make('')
->label('Overview')
->icon('tabler-chart-area-line-filled')
->columns(6)
->columns([
'default' => 4,
'sm' => 2,
'md' => 4,
'lg' => 4,
])
->schema([
Fieldset::make()
->label('Node Information')
Expand All @@ -67,8 +72,20 @@ public function form(Forms\Form $form): Forms\Form
->label('Kernel')
->content(fn (Node $node) => $node->systemInformation()['kernel_version'] ?? 'Unknown'),
]),
View::make('filament.components.node-cpu-chart')->columnSpan(3),
View::make('filament.components.node-memory-chart')->columnSpan(3),
View::make('filament.components.node-cpu-chart')
->columnSpan([
'default' => 4,
'sm' => 1,
'md' => 2,
'lg' => 2,
]),
View::make('filament.components.node-memory-chart')
->columnSpan([
'default' => 4,
'sm' => 1,
'md' => 2,
'lg' => 2,
]),
// TODO: Make purdy View::make('filament.components.node-storage-chart')->columnSpan(3),
]),
Tab::make('Basic Settings')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ public function table(Table $table): Table

// All assigned allocations
->checkIfRecordIsSelectableUsing(fn (Allocation $allocation) => $allocation->server_id === null)
->paginationPageOptions(['10', '20', '50', '100', '200', '500', '1000'])
->searchable()
->selectCurrentPageOnly() //Prevent people from trying to nuke 30,000 ports at once.... -,-
->columns([
TextColumn::make('id'),
TextColumn::make('id')
->toggleable()
->toggledHiddenByDefault(),
TextColumn::make('port')
->searchable()
->label('Port'),
TextColumn::make('server.name')
->label('Server')
->icon('tabler-brand-docker')
->visibleFrom('md')
->searchable()
->url(fn (Allocation $allocation): string => $allocation->server ? route('filament.admin.resources.servers.edit', ['record' => $allocation->server]) : ''),
TextInputColumn::make('ip_alias')
Expand Down

0 comments on commit 994852c

Please sign in to comment.