diff --git a/web/app/Filament/Resources/CronJobResource.php b/web/app/Filament/Resources/CronJobResource.php new file mode 100644 index 0000000..8c02d72 --- /dev/null +++ b/web/app/Filament/Resources/CronJobResource.php @@ -0,0 +1,64 @@ +schema([ + // + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + // + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListCronJobs::route('/'), + 'create' => Pages\CreateCronJob::route('/create'), + 'edit' => Pages\EditCronJob::route('/{record}/edit'), + ]; + } +} diff --git a/web/app/Filament/Resources/CronJobResource/Pages/CreateCronJob.php b/web/app/Filament/Resources/CronJobResource/Pages/CreateCronJob.php new file mode 100644 index 0000000..aa1465a --- /dev/null +++ b/web/app/Filament/Resources/CronJobResource/Pages/CreateCronJob.php @@ -0,0 +1,12 @@ +columns([ - // + Tables\Columns\TextColumn::make('label') + ->searchable() + ->sortable() ]) ->filters([ // diff --git a/web/app/Models/Backup.php b/web/app/Models/Backup.php index ca557cf..4ddb2ed 100644 --- a/web/app/Models/Backup.php +++ b/web/app/Models/Backup.php @@ -4,8 +4,18 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Sushi\Sushi; class Backup extends Model { - use HasFactory; + use Sushi; + + public function getRows() + { + return [ + ['id' => 1, 'label' => 'admin'], + ['id' => 2, 'label' => 'manager'], + ['id' => 3, 'label' => 'user'], + ]; + } } diff --git a/web/app/Models/CronJob.php b/web/app/Models/CronJob.php index 3da7e36..f72fefb 100644 --- a/web/app/Models/CronJob.php +++ b/web/app/Models/CronJob.php @@ -4,8 +4,23 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Sushi\Sushi; class CronJob extends Model { - use HasFactory; + use Sushi; + + public function getRows() + { + + exec('/usr/local/phyre/bin/crontab-list.sh', $output); + + dd($output); + + return [ + ['id' => 1, 'label' => 'admin'], + ['id' => 2, 'label' => 'manager'], + ['id' => 3, 'label' => 'user'], + ]; + } }