Skip to content

Commit

Permalink
Merge branch 'liberu-control-panel:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata authored Jun 16, 2024
2 parents 78c8c4d + 91442ab commit 04cbb2e
Show file tree
Hide file tree
Showing 26 changed files with 849 additions and 1 deletion.
97 changes: 97 additions & 0 deletions app/Filament/Admin/Resources/DnsSettingResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

namespace App\Filament\Admin\Resources;

use App\Filament\Admin\Resources\DnsSettingResource\Pages;
use App\Filament\Admin\Resources\DnsSettingResource\RelationManagers;
use App\Models\DnsSetting;
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 DnsSettingResource extends Resource
{
protected static ?string $model = DnsSetting::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('domain_id')
->required()
->numeric(),
Forms\Components\TextInput::make('record_type')
->required()
->maxLength(255),
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\TextInput::make('value')
->required()
->maxLength(255),
Forms\Components\TextInput::make('ttl')
->required()
->numeric(),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('domain_id')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('record_type')
->searchable(),
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('value')
->searchable(),
Tables\Columns\TextColumn::make('ttl')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->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\ListDnsSettings::route('/'),
'create' => Pages\CreateDnsSetting::route('/create'),
'edit' => Pages\EditDnsSetting::route('/{record}/edit'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Filament\Admin\Resources\DnsSettingResource\Pages;

use App\Filament\Admin\Resources\DnsSettingResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateDnsSetting extends CreateRecord
{
protected static string $resource = DnsSettingResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Admin\Resources\DnsSettingResource\Pages;

use App\Filament\Admin\Resources\DnsSettingResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditDnsSetting extends EditRecord
{
protected static string $resource = DnsSettingResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Admin\Resources\DnsSettingResource\Pages;

use App\Filament\Admin\Resources\DnsSettingResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListDnsSettings extends ListRecords
{
protected static string $resource = DnsSettingResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
91 changes: 91 additions & 0 deletions app/Filament/Admin/Resources/DomainResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

namespace App\Filament\Admin\Resources;

use App\Filament\Admin\Resources\DomainResource\Pages;
use App\Filament\Admin\Resources\DomainResource\RelationManagers;
use App\Models\Domain;
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 DomainResource extends Resource
{
protected static ?string $model = Domain::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('user_id')
->required()
->numeric(),
Forms\Components\TextInput::make('domain_name')
->required()
->maxLength(255),
Forms\Components\DatePicker::make('registration_date')
->required(),
Forms\Components\DatePicker::make('expiration_date')
->required(),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('user_id')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('domain_name')
->searchable(),
Tables\Columns\TextColumn::make('registration_date')
->date()
->sortable(),
Tables\Columns\TextColumn::make('expiration_date')
->date()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->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\ListDomains::route('/'),
'create' => Pages\CreateDomain::route('/create'),
'edit' => Pages\EditDomain::route('/{record}/edit'),
];
}
}
12 changes: 12 additions & 0 deletions app/Filament/Admin/Resources/DomainResource/Pages/CreateDomain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Filament\Admin\Resources\DomainResource\Pages;

use App\Filament\Admin\Resources\DomainResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateDomain extends CreateRecord
{
protected static string $resource = DomainResource::class;
}
19 changes: 19 additions & 0 deletions app/Filament/Admin/Resources/DomainResource/Pages/EditDomain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Admin\Resources\DomainResource\Pages;

use App\Filament\Admin\Resources\DomainResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditDomain extends EditRecord
{
protected static string $resource = DomainResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}
19 changes: 19 additions & 0 deletions app/Filament/Admin/Resources/DomainResource/Pages/ListDomains.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Filament\Admin\Resources\DomainResource\Pages;

use App\Filament\Admin\Resources\DomainResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListDomains extends ListRecords
{
protected static string $resource = DomainResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
96 changes: 96 additions & 0 deletions app/Filament/Admin/Resources/HostingPlanResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

namespace App\Filament\Admin\Resources;

use App\Filament\Admin\Resources\HostingPlanResource\Pages;
use App\Filament\Admin\Resources\HostingPlanResource\RelationManagers;
use App\Models\HostingPlan;
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 HostingPlanResource extends Resource
{
protected static ?string $model = HostingPlan::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\Textarea::make('description')
->columnSpanFull(),
Forms\Components\TextInput::make('disk_space')
->required()
->numeric(),
Forms\Components\TextInput::make('bandwidth')
->required()
->numeric(),
Forms\Components\TextInput::make('price')
->required()
->numeric()
->prefix('$'),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('disk_space')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('bandwidth')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('price')
->money()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->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\ListHostingPlans::route('/'),
'create' => Pages\CreateHostingPlan::route('/create'),
'edit' => Pages\EditHostingPlan::route('/{record}/edit'),
];
}
}
Loading

0 comments on commit 04cbb2e

Please sign in to comment.