|
@@ -0,0 +1,93 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Filament\Resources;
|
|
|
+
|
|
|
+use App\Filament\Resources\PhyreServerResource\Pages;
|
|
|
+use App\Filament\Resources\PhyreServerResource\RelationManagers;
|
|
|
+use App\Models\PhyreServer;
|
|
|
+use Filament\Forms;
|
|
|
+use Filament\Forms\Form;
|
|
|
+use Filament\Resources\Resource;
|
|
|
+use Filament\Tables;
|
|
|
+use Filament\Tables\Table;
|
|
|
+use Illuminate\Database\Eloquent\Builder;
|
|
|
+use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
+
|
|
|
+class PhyreServerResource extends Resource
|
|
|
+{
|
|
|
+ protected static ?string $model = PhyreServer::class;
|
|
|
+
|
|
|
+ protected static ?string $navigationIcon = 'heroicon-o-server-stack';
|
|
|
+
|
|
|
+ protected static ?string $navigationGroup = 'Server Management';
|
|
|
+
|
|
|
+ protected static ?int $navigationSort = 1;
|
|
|
+
|
|
|
+ public static function form(Form $form): Form
|
|
|
+ {
|
|
|
+ return $form
|
|
|
+ ->schema([
|
|
|
+
|
|
|
+ Forms\Components\TextInput::make('name')
|
|
|
+ ->label('Name')
|
|
|
+ ->placeholder('Enter the name of the server')
|
|
|
+ ->columnSpanFull(),
|
|
|
+
|
|
|
+ Forms\Components\TextInput::make('ip')
|
|
|
+ ->label('IP Address')
|
|
|
+ ->placeholder('Enter the IP address of the server')
|
|
|
+ ->required(),
|
|
|
+
|
|
|
+ Forms\Components\TextInput::make('port')
|
|
|
+ ->label('Port')
|
|
|
+ ->placeholder('Enter the port of the server')
|
|
|
+ ->required(),
|
|
|
+
|
|
|
+ Forms\Components\TextInput::make('username')
|
|
|
+ ->label('Username')
|
|
|
+ ->placeholder('Enter the username of the server')
|
|
|
+ ->required(),
|
|
|
+
|
|
|
+ Forms\Components\TextInput::make('password')
|
|
|
+ ->label('Password')
|
|
|
+ ->placeholder('Enter the password of the server')
|
|
|
+ ->required(),
|
|
|
+
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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\ListPhyreServers::route('/'),
|
|
|
+ 'create' => Pages\CreatePhyreServer::route('/create'),
|
|
|
+ 'edit' => Pages\EditPhyreServer::route('/{record}/edit'),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+}
|