Skip to content

Commit 3f4d58e

Browse files
committed
bugfixes and updates. joelbutcher discontinued
1 parent e6822a7 commit 3f4d58e

25 files changed

Lines changed: 278 additions & 490 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LOG_LEVEL=debug
1111
MULTITENANCY=false
1212

1313
DB_CONNECTION=mysql
14-
DB_HOST=mysql
14+
DB_HOST=127.0.0.1
1515
DB_PORT=3306
1616
DB_DATABASE=liberu_control_panel
1717
DB_USERNAME=root

app/Filament/Admin/Pages/DeploymentSettings.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use App\Models\InstallationMetadata;
88
use Filament\Pages\Page;
99
use Filament\Forms;
10+
use Filament\Schemas\Components\Grid;
11+
use Filament\Schemas\Components\Section;
1012
use Filament\Schemas\Schema;
1113
use Filament\Notifications\Notification;
1214
use Illuminate\Support\Facades\Cache;
@@ -49,7 +51,7 @@ public function form(Schema $schema): Schema
4951

5052
return $schema
5153
->components([
52-
Forms\Components\Section::make('Deployment Information')
54+
Section::make('Deployment Information')
5355
->description('Current deployment environment and configuration')
5456
->schema([
5557
Forms\Components\Placeholder::make('deployment_mode')
@@ -60,7 +62,7 @@ public function form(Schema $schema): Schema
6062
->label('Cloud Provider')
6163
->content(fn ($state) => $detectionService->getCloudProviderLabel($state)),
6264

63-
Forms\Components\Grid::make(3)
65+
Grid::make(3)
6466
->schema([
6567
Forms\Components\Placeholder::make('is_kubernetes')
6668
->label('Kubernetes')
@@ -76,7 +78,7 @@ public function form(Schema $schema): Schema
7678
]),
7779
]),
7880

79-
Forms\Components\Section::make('Auto-Scaling Configuration')
81+
Section::make('Auto-Scaling Configuration')
8082
->description('Configure automatic horizontal and vertical scaling')
8183
->schema([
8284
Forms\Components\Placeholder::make('supports_auto_scaling')
@@ -91,10 +93,10 @@ public function form(Schema $schema): Schema
9193
->disabled(fn () => !$this->data['supports_auto_scaling'] ?? true),
9294
]),
9395

94-
Forms\Components\Section::make('System Capabilities')
96+
Section::make('System Capabilities')
9597
->description('Available features based on current deployment')
9698
->schema([
97-
Forms\Components\Grid::make(2)
99+
Grid::make(2)
98100
->schema([
99101
Forms\Components\Placeholder::make('horizontal_scaling')
100102
->label('Horizontal Pod Autoscaling (HPA)')

app/Filament/Admin/Pages/ManageGeneralSettings.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
class ManageGeneralSettings extends SettingsPage
1414
{
15-
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-cog-6-tooth';
15+
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-cog-6-tooth';
1616

1717
protected static string $settings = GeneralSettings::class;
1818

19-
protected static string | \UnitEnum | null $navigationGroup = 'Settings';
19+
protected static string|\UnitEnum|null $navigationGroup = 'Settings';
2020

2121
protected static ?string $title = 'General Settings';
2222

@@ -25,8 +25,9 @@ class ManageGeneralSettings extends SettingsPage
2525
public function form(Schema $schema): Schema
2626
{
2727
return $schema
28+
->columns(1)
2829
->components([
29-
Section::make('Site Information')
30+
Section::make('Site Informations')
3031
->schema([
3132
TextInput::make('site_name')
3233
->label('Site Name')

app/Filament/Admin/Resources/BackupResource.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
use App\Filament\Admin\Resources\BackupResource\Pages\EditBackup;
77
use App\Filament\Admin\Resources\BackupResource\Pages\ListBackups;
88
use App\Models\BackupSchedule;
9+
use Filament\Actions\BulkActionGroup;
10+
use Filament\Actions\DeleteAction;
11+
use Filament\Actions\DeleteBulkAction;
12+
use Filament\Actions\EditAction;
913
use Filament\Forms;
14+
use Filament\Schemas\Components\Section;
1015
use Filament\Schemas\Schema;
1116
use Filament\Resources\Resource;
1217
use Filament\Tables;
@@ -26,7 +31,8 @@ public static function form(Schema $schema): Schema
2631
{
2732
return $schema
2833
->components([
29-
Forms\Components\Section::make('Schedule Details')
34+
Section::make('Schedule Details')
35+
->columnSpanFull()
3036
->schema([
3137
Forms\Components\TextInput::make('name')
3238
->required()
@@ -79,7 +85,7 @@ public static function form(Schema $schema): Schema
7985
}
8086

8187
public static function table(Table $table): Table
82-
{
88+
{
8389
return $table
8490
->columns([
8591
Tables\Columns\TextColumn::make('name')->searchable()->sortable(),
@@ -92,12 +98,12 @@ public static function table(Table $table): Table
9298
Tables\Columns\TextColumn::make('last_run_at')->label('Last Run')->dateTime()->sortable(),
9399
])
94100
->actions([
95-
Tables\Actions\EditAction::make(),
96-
Tables\Actions\DeleteAction::make(),
101+
EditAction::make(),
102+
DeleteAction::make(),
97103
])
98104
->bulkActions([
99-
Tables\Actions\BulkActionGroup::make([
100-
Tables\Actions\DeleteBulkAction::make(),
105+
BulkActionGroup::make([
106+
DeleteBulkAction::make(),
101107
]),
102108
])
103109
->defaultSort('created_at', 'desc');

app/Filament/Admin/Resources/HelmReleaseResource.php

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
use App\Models\HelmRelease;
77
use App\Models\Server;
88
use App\Services\HelmChartService;
9+
use Filament\Actions\Action;
10+
use Filament\Actions\BulkActionGroup;
11+
use Filament\Actions\DeleteAction;
12+
use Filament\Actions\DeleteBulkAction;
13+
use Filament\Actions\EditAction;
914
use Filament\Forms;
15+
use Filament\Schemas\Components\Section;
1016
use Filament\Schemas\Schema;
1117
use Filament\Resources\Resource;
1218
use Filament\Tables;
@@ -18,11 +24,11 @@ class HelmReleaseResource extends Resource
1824
{
1925
protected static ?string $model = HelmRelease::class;
2026

21-
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-cube';
27+
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-cube';
2228

2329
protected static ?string $navigationLabel = 'Helm Charts';
2430

25-
protected static string | \UnitEnum | null $navigationGroup = 'Kubernetes';
31+
protected static string|\UnitEnum|null $navigationGroup = 'Kubernetes';
2632

2733
protected static ?int $navigationSort = 2;
2834

@@ -33,7 +39,7 @@ public static function form(Schema $schema): Schema
3339

3440
return $schema
3541
->components([
36-
Forms\Components\Section::make('Release Information')
42+
Section::make('Release Information')
3743
->schema([
3844
Forms\Components\Select::make('server_id')
3945
->label('Server')
@@ -71,7 +77,7 @@ public static function form(Schema $schema): Schema
7177
])
7278
->columns(2),
7379

74-
Forms\Components\Section::make('Configuration')
80+
Section::make('Configuration')
7581
->schema([
7682
Forms\Components\KeyValue::make('values')
7783
->label('Helm Values')
@@ -115,7 +121,7 @@ public static function table(Table $table): Table
115121
Tables\Columns\TextColumn::make('status')
116122
->label('Status')
117123
->badge()
118-
->color(fn (string $state): string => match ($state) {
124+
->color(fn(string $state): string => match ($state) {
119125
'deployed' => 'success',
120126
'failed' => 'danger',
121127
'pending' => 'warning',
@@ -153,18 +159,18 @@ public static function table(Table $table): Table
153159
'uninstalled' => 'Uninstalled',
154160
]),
155161

156-
Tables\Filters\SelectFilter::make('chart_name')
157-
->label('Chart Type')
158-
->options(function () {
159-
$helmService = app(HelmChartService::class);
160-
$charts = $helmService->getAvailableCharts();
161-
return collect($charts)->mapWithKeys(function ($chart, $key) {
162-
return [$key => $chart['name']];
163-
})->toArray();
164-
}),
162+
// Tables\Filters\SelectFilter::make('chart_name')
163+
// ->label('Chart Type')
164+
// ->options(function () {
165+
// $helmService = app(HelmChartService::class);
166+
// $charts = $helmService->getAvailableCharts();
167+
// return collect($charts)->mapWithKeys(function ($chart, $key) {
168+
// return [$key => $chart['name']];
169+
// })->toArray();
170+
// }),
165171
])
166-
->actions([
167-
Tables\Actions\Action::make('sync')
172+
->recordActions([
173+
Action::make('sync')
168174
->label('Sync Status')
169175
->icon('heroicon-o-arrow-path')
170176
->action(function (HelmRelease $record) {
@@ -177,15 +183,15 @@ public static function table(Table $table): Table
177183

178184
if ($status && isset($status['info'])) {
179185
$updateData = [];
180-
186+
181187
if (isset($status['info']['status'])) {
182188
$updateData['status'] = $status['info']['status'];
183189
}
184-
190+
185191
if (isset($status['chart']['metadata']['version'])) {
186192
$updateData['chart_version'] = $status['chart']['metadata']['version'];
187193
}
188-
194+
189195
if (!empty($updateData)) {
190196
$record->update($updateData);
191197

@@ -208,9 +214,9 @@ public static function table(Table $table): Table
208214
}
209215
}),
210216

211-
Tables\Actions\EditAction::make(),
217+
EditAction::make(),
212218

213-
Tables\Actions\Action::make('upgrade')
219+
Action::make('upgrade')
214220
->label('Upgrade')
215221
->icon('heroicon-o-arrow-up-circle')
216222
->color('warning')
@@ -244,7 +250,7 @@ public static function table(Table $table): Table
244250
}
245251
}),
246252

247-
Tables\Actions\DeleteAction::make()
253+
DeleteAction::make()
248254
->label('Uninstall')
249255
->requiresConfirmation()
250256
->action(function (HelmRelease $record) {
@@ -272,8 +278,8 @@ public static function table(Table $table): Table
272278
}),
273279
])
274280
->bulkActions([
275-
Tables\Actions\BulkActionGroup::make([
276-
Tables\Actions\DeleteBulkAction::make(),
281+
BulkActionGroup::make([
282+
DeleteBulkAction::make(),
277283
]),
278284
])
279285
->defaultSort('created_at', 'desc');

app/Filament/Admin/Resources/KubernetesNodeResource.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
use App\Filament\Admin\Resources\KubernetesNodeResource\Pages;
66
use App\Models\KubernetesNode;
77
use App\Services\KubernetesNodeService;
8+
use Filament\Actions\Action;
9+
use Filament\Actions\BulkActionGroup;
10+
use Filament\Actions\DeleteBulkAction;
11+
use Filament\Actions\ViewAction;
812
use Filament\Forms;
13+
use Filament\Schemas\Components\Section;
914
use Filament\Schemas\Schema;
1015
use Filament\Resources\Resource;
1116
use Filament\Tables;
@@ -28,7 +33,7 @@ public static function form(Schema $schema): Schema
2833
{
2934
return $schema
3035
->components([
31-
Forms\Components\Section::make('Node Information')
36+
Section::make('Node Information')
3237
->schema([
3338
Forms\Components\Select::make('server_id')
3439
->relationship('server', 'name')
@@ -47,7 +52,7 @@ public static function form(Schema $schema): Schema
4752
->disabled(),
4853
])->columns(2),
4954

50-
Forms\Components\Section::make('System Information')
55+
Section::make('System Information')
5156
->schema([
5257
Forms\Components\TextInput::make('kubernetes_version')
5358
->disabled(),
@@ -61,15 +66,15 @@ public static function form(Schema $schema): Schema
6166
->disabled(),
6267
])->columns(2),
6368

64-
Forms\Components\Section::make('Resources')
69+
Section::make('Resources')
6570
->schema([
6671
Forms\Components\KeyValue::make('capacity')
6772
->disabled(),
6873
Forms\Components\KeyValue::make('allocatable')
6974
->disabled(),
7075
])->columns(2),
7176

72-
Forms\Components\Section::make('Labels & Taints')
77+
Section::make('Labels & Taints')
7378
->schema([
7479
Forms\Components\KeyValue::make('labels')
7580
->disabled(),
@@ -138,8 +143,8 @@ public static function table(Table $table): Table
138143
->label('Schedulable'),
139144
])
140145
->actions([
141-
Tables\Actions\ViewAction::make(),
142-
Tables\Actions\Action::make('cordon')
146+
ViewAction::make(),
147+
Action::make('cordon')
143148
->icon('heroicon-o-no-symbol')
144149
->color('warning')
145150
->requiresConfirmation()
@@ -158,7 +163,7 @@ public static function table(Table $table): Table
158163
->send();
159164
}
160165
}),
161-
Tables\Actions\Action::make('uncordon')
166+
Action::make('uncordon')
162167
->icon('heroicon-o-check-circle')
163168
->color('success')
164169
->requiresConfirmation()
@@ -177,7 +182,7 @@ public static function table(Table $table): Table
177182
->send();
178183
}
179184
}),
180-
Tables\Actions\Action::make('drain')
185+
Action::make('drain')
181186
->icon('heroicon-o-arrow-down-tray')
182187
->color('danger')
183188
->requiresConfirmation()
@@ -198,12 +203,12 @@ public static function table(Table $table): Table
198203
}),
199204
])
200205
->bulkActions([
201-
Tables\Actions\BulkActionGroup::make([
202-
Tables\Actions\DeleteBulkAction::make(),
206+
BulkActionGroup::make([
207+
DeleteBulkAction::make(),
203208
]),
204209
])
205210
->headerActions([
206-
Tables\Actions\Action::make('sync')
211+
Action::make('sync')
207212
->icon('heroicon-o-arrow-path')
208213
->color('primary')
209214
->action(function () {

0 commit comments

Comments
 (0)