mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 21:04:44 +02:00
linting
This commit is contained in:
parent
c54217f236
commit
f26373dfd5
@ -33,7 +33,7 @@ class ApiKeyResource extends Resource
|
||||
];
|
||||
}
|
||||
|
||||
public function getDefaultActiveTab(): string | int | null
|
||||
public function getDefaultActiveTab(): string|int|null
|
||||
{
|
||||
return 'application';
|
||||
}
|
||||
@ -73,8 +73,7 @@ class ApiKeyResource extends Resource
|
||||
->default(ApiKey::TYPE_APPLICATION),
|
||||
|
||||
Forms\Components\Fieldset::make('Permissions')->schema(
|
||||
collect(ApiKey::RESOURCES)->map(fn ($resource) =>
|
||||
Forms\Components\ToggleButtons::make("r_$resource")
|
||||
collect(ApiKey::RESOURCES)->map(fn ($resource) => Forms\Components\ToggleButtons::make("r_$resource")
|
||||
->label(str($resource)->replace('_', ' ')->title())
|
||||
->options([
|
||||
0 => 'None',
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\ApiKeyResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ApiKeyResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateApiKey extends CreateRecord
|
||||
|
@ -25,17 +25,15 @@ class ListApiKeys extends ListRecords
|
||||
return [
|
||||
'all' => Tab::make('All Keys'),
|
||||
'application' => Tab::make('Application Keys')
|
||||
->modifyQueryUsing(fn (Builder $query) =>
|
||||
$query->where('key_type', ApiKey::TYPE_APPLICATION)
|
||||
->modifyQueryUsing(fn (Builder $query) => $query->where('key_type', ApiKey::TYPE_APPLICATION)
|
||||
),
|
||||
'account' => Tab::make('Account Keys')
|
||||
->modifyQueryUsing(fn (Builder $query) =>
|
||||
$query->where('key_type', ApiKey::TYPE_ACCOUNT)
|
||||
->modifyQueryUsing(fn (Builder $query) => $query->where('key_type', ApiKey::TYPE_ACCOUNT)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
public function getDefaultActiveTab(): string | int | null
|
||||
public function getDefaultActiveTab(): string|int|null
|
||||
{
|
||||
return 'application';
|
||||
}
|
||||
|
@ -3,15 +3,12 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\DatabaseHostResource\Pages;
|
||||
use App\Filament\Resources\DatabaseHostResource\RelationManagers;
|
||||
use App\Models\DatabaseHost;
|
||||
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 DatabaseHostResource extends Resource
|
||||
{
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\DatabaseHostResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DatabaseHostResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateDatabaseHost extends CreateRecord
|
||||
|
@ -3,15 +3,12 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\DatabaseResource\Pages;
|
||||
use App\Filament\Resources\DatabaseResource\RelationManagers;
|
||||
use App\Models\Database;
|
||||
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 DatabaseResource extends Resource
|
||||
{
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\DatabaseResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DatabaseResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateDatabase extends CreateRecord
|
||||
|
@ -20,7 +20,6 @@ class EggResource extends Resource
|
||||
|
||||
protected static ?string $recordRouteKeyName = 'id';
|
||||
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
@ -94,7 +93,7 @@ class EggResource extends Resource
|
||||
Forms\Components\TextInput::make('env_variable')->maxLength(191),
|
||||
Forms\Components\TextInput::make('default_value')->maxLength(191),
|
||||
Forms\Components\Textarea::make('rules')->rows(3)->columnSpanFull()->required(),
|
||||
])
|
||||
]),
|
||||
]),
|
||||
Forms\Components\Tabs\Tab::make('Install Script')
|
||||
->columns(3)
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\EggResource\Pages;
|
||||
|
||||
use App\Filament\Resources\EggResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateEgg extends CreateRecord
|
||||
|
@ -53,7 +53,7 @@ class ListEggs extends ListRecords
|
||||
->send();
|
||||
|
||||
redirect()->route('filament.admin.resources.eggs.edit', [$newEgg]);
|
||||
})
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class MountResource extends Resource
|
||||
->relationship('nodes', 'name')
|
||||
->searchable(['name', 'fqdn'])
|
||||
->preload(),
|
||||
])
|
||||
]),
|
||||
])->columns([
|
||||
'default' => 1,
|
||||
]),
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\MountResource\Pages;
|
||||
|
||||
use App\Filament\Resources\MountResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateMount extends CreateRecord
|
||||
|
@ -3,10 +3,7 @@
|
||||
namespace App\Filament\Resources\NodeResource\Pages;
|
||||
|
||||
use App\Filament\Resources\NodeResource;
|
||||
use App\Models\Node;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@ -98,11 +95,11 @@ class CreateNode extends CreateRecord
|
||||
->hintColor('success')
|
||||
->options([
|
||||
true => 'Valid',
|
||||
false => 'Invalid'
|
||||
false => 'Invalid',
|
||||
])
|
||||
->colors([
|
||||
true => 'success',
|
||||
false => 'danger'
|
||||
false => 'danger',
|
||||
]),
|
||||
|
||||
Forms\Components\TextInput::make('daemonListen')
|
||||
@ -115,8 +112,6 @@ class CreateNode extends CreateRecord
|
||||
->required()
|
||||
->integer(),
|
||||
|
||||
|
||||
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('Display Name')
|
||||
->columnSpan(2)
|
||||
|
@ -64,9 +64,9 @@ class EditNode extends EditRecord
|
||||
->maxValue(65535)
|
||||
->numeric(),
|
||||
Forms\Components\Select::make('server_id')->relationship('server', 'name'),
|
||||
])
|
||||
]),
|
||||
])
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class ServerResource extends Resource
|
||||
{
|
||||
@ -359,7 +358,7 @@ class ServerResource extends Resource
|
||||
->helperText(fn (Forms\Get $get) => empty($get('description')) ? '—' : $get('description'))
|
||||
->maxLength(191),
|
||||
|
||||
Forms\Components\Hidden::make('variable_id')->default(0)
|
||||
Forms\Components\Hidden::make('variable_id')->default(0),
|
||||
])
|
||||
->columnSpanFull(),
|
||||
]),
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\ServerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ServerResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateServer extends CreateRecord
|
||||
|
@ -3,9 +3,7 @@
|
||||
namespace App\Filament\Resources\ServerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ServerResource;
|
||||
use App\Models\Allocation;
|
||||
use Filament\Actions;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditServer extends EditRecord
|
||||
|
@ -3,15 +3,12 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\UserResource\Pages;
|
||||
use App\Filament\Resources\UserResource\RelationManagers;
|
||||
use App\Models\User;
|
||||
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;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserResource extends Resource
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\UserResource\Pages;
|
||||
|
||||
use App\Filament\Resources\UserResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateUser extends CreateRecord
|
||||
|
@ -8,7 +8,6 @@ use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Tabs;
|
||||
use Filament\Forms\Components\Tabs\Tab;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\HtmlString;
|
||||
@ -85,14 +84,14 @@ class EditProfile extends \Filament\Pages\Auth\EditProfile
|
||||
|
||||
->schema([
|
||||
Placeholder::make('activity!')->label('')->content(fn (ActivityLog $log) => new HtmlString($log->htmlable())),
|
||||
])
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
->operation('edit')
|
||||
->model($this->getUser())
|
||||
->statePath('data')
|
||||
->inlineLabel(! static::isSimple()),
|
||||
->inlineLabel(!static::isSimple()),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
@ -126,7 +126,6 @@ class Node extends Model
|
||||
return 'id';
|
||||
}
|
||||
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $node) {
|
||||
|
@ -83,7 +83,7 @@ use App\Notifications\SendPasswordReset as ResetPasswordNotification;
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, FilamentUser, HasName, HasAvatar
|
||||
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, FilamentUser, HasAvatar, HasName
|
||||
{
|
||||
use Authenticatable;
|
||||
use Authorizable {can as protected canned; }
|
||||
@ -340,7 +340,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
||||
{
|
||||
$rootAdmins = User::query()->where('root_admin', true)->limit(2)->get();
|
||||
|
||||
return once(fn() => $rootAdmins->count() === 1 && $rootAdmins->first()->is($this));
|
||||
return once(fn () => $rootAdmins->count() === 1 && $rootAdmins->first()->is($this));
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
|
@ -25,6 +25,7 @@ class EggParserService
|
||||
$parsed = json_decode($file->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$version = $parsed['meta']['version'] ?? '';
|
||||
|
||||
return match ($version) {
|
||||
'PTDL_v1' => $this->convertToV2($parsed),
|
||||
'PTDL_v2' => $parsed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user