Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/Filament/Admin/Pages/ListLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Tables\Table;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Facades\Http;

class ListLogs extends BaseListLogs
{
protected string $view = 'filament.components.list-logs';

public function getHeading(): string|null|\Illuminate\Contracts\Support\Htmlable
public function getHeading(): string|null|Htmlable
{
return trans('admin/log.navigation.panel_logs');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Admin/Resources/Nodes/Pages/EditNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ protected function getDefaultTabs(): array
$set('pulled', false);
$set('uploaded', true);

} catch (\Exception $e) {
} catch (Exception $e) {
Notification::make()
->title(trans('admin/node.diagnostics.upload_failed'))
->body($e->getMessage())
Expand Down
10 changes: 5 additions & 5 deletions app/Filament/Admin/Resources/Servers/Pages/EditServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ protected function getDefaultTabs(): array

try {
if (!in_array(parse_url($state, PHP_URL_SCHEME), ['http', 'https'], true)) {
throw new \Exception(trans('admin/egg.import.invalid_url'));
throw new Exception(trans('admin/egg.import.invalid_url'));
}

if (!filter_var($state, FILTER_VALIDATE_URL)) {
throw new \Exception(trans('admin/egg.import.invalid_url'));
throw new Exception(trans('admin/egg.import.invalid_url'));
}

$extension = strtolower(pathinfo(parse_url($state, PHP_URL_PATH), PATHINFO_EXTENSION));

if (!array_key_exists($extension, Server::IMAGE_FORMATS)) {
throw new \Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
throw new Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
}

$host = parse_url($state, PHP_URL_HOST);
Expand All @@ -169,14 +169,14 @@ protected function getDefaultTabs(): array
if (
filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false
) {
throw new \Exception(trans('admin/egg.import.no_local_ip'));
throw new Exception(trans('admin/egg.import.no_local_ip'));
}

$set('imageUrl', $state);
$set('imageExtension', $extension);
$set('image_url_error', null);

} catch (\Exception $e) {
} catch (Exception $e) {
$set('image_url_error', $e->getMessage());
$set('imageUrl', null);
$set('imageExtension', null);
Expand Down
10 changes: 5 additions & 5 deletions app/Filament/Server/Pages/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ public function form(Schema $schema): Schema

try {
if (!in_array(parse_url($state, PHP_URL_SCHEME), ['http', 'https'], true)) {
throw new \Exception(trans('admin/egg.import.invalid_url'));
throw new Exception(trans('admin/egg.import.invalid_url'));
}

if (!filter_var($state, FILTER_VALIDATE_URL)) {
throw new \Exception(trans('admin/egg.import.invalid_url'));
throw new Exception(trans('admin/egg.import.invalid_url'));
}

$extension = strtolower(pathinfo(parse_url($state, PHP_URL_PATH), PATHINFO_EXTENSION));

if (!array_key_exists($extension, Server::IMAGE_FORMATS)) {
throw new \Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
throw new Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
}

$host = parse_url($state, PHP_URL_HOST);
Expand All @@ -137,14 +137,14 @@ public function form(Schema $schema): Schema
if (
filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false
) {
throw new \Exception(trans('admin/egg.import.no_local_ip'));
throw new Exception(trans('admin/egg.import.no_local_ip'));
}

$set('imageUrl', $state);
$set('imageExtension', $extension);
$set('image_url_error', null);

} catch (\Exception $e) {
} catch (Exception $e) {
$set('image_url_error', $e->getMessage());
$set('imageUrl', null);
$set('imageExtension', null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public static function defaultTable(Table $table): Table
]);
}

/** @return Builder<ActivityLog> */
public static function getEloquentQuery(): Builder
{
/** @var Server $server */
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Server/Resources/Files/Pages/EditFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ private function getDaemonFileRepository(): DaemonFileRepository
return $this->fileRepository;
}

public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null, bool $shouldGuessMissingParameters = false): string
public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null, bool $shouldGuessMissingParameters = false, ?string $configuration = null): string
{
return parent::getUrl($parameters, $isAbsolute, $panel, $tenant) . '/';
return parent::getUrl($parameters, $isAbsolute, $panel, $tenant, $shouldGuessMissingParameters, $configuration) . '/';
}

public static function route(string $path): PageRegistration
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/RequireTwoFactorAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RequireTwoFactorAuthentication
* order to perform actions. If so, we check the level at which it is required (all users
* or just admins) and then check if the user has enabled it for their account.
*
* @throws \App\Exceptions\Http\TwoFactorAuthRequiredException
* @throws TwoFactorAuthRequiredException
*/
public function handle(Request $request, \Closure $next): mixed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function parameter(string $key, string $expect)
$value = $this->route()->parameter($key);

Assert::isInstanceOf($value, $expect);
Assert::isInstanceOf($value, Model::class);
Assert::isInstanceOf($value, Model::class); // @phpstan-ignore staticMethod.alreadyNarrowedType
Assert::true($value->exists);

/* @var T $value */
Expand Down
3 changes: 2 additions & 1 deletion app/Livewire/NodeClientConnectivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Services\Servers\GetUserPermissionsService;
use Filament\Support\Enums\IconSize;
use Filament\Tables\View\Components\Columns\IconColumnComponent\IconComponent;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\ComponentAttributeBag;
use Livewire\Attributes\Locked;
Expand All @@ -30,7 +31,7 @@ public function boot(GetUserPermissionsService $getUserPermissionsService, NodeJ
$this->nodeJWTService = $nodeJWTService;
}

public function render(): \Illuminate\Contracts\View\View
public function render(): View
{
$httpUrl = $this->node->getConnectionAddress();

Expand Down
42 changes: 21 additions & 21 deletions app/Models/ActivityLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Events\ActivityLogged;
use App\Traits\HasValidation;
use BackedEnum;
use Carbon\Carbon;
use Filament\Facades\Filament;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
Expand All @@ -17,6 +16,7 @@
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Str;
Expand All @@ -31,28 +31,28 @@
* @property string|null $description
* @property string|null $actor_type
* @property int|null $actor_id
* @property Collection<array-key, mixed> $properties
* @property Carbon $timestamp
* @property int|null $api_key_id
* @property Collection|null $properties
* @property \Carbon\Carbon $timestamp
* @property Model|\Eloquent $actor
* @property \Illuminate\Database\Eloquent\Collection|ActivityLogSubject[] $subjects
* @property int|null $subjects_count
* @property ApiKey|null $apiKey
* @property-read Model|\Eloquent|null $actor
* @property-read ApiKey|null $apiKey
* @property-read \Illuminate\Database\Eloquent\Collection<int, ActivityLogSubject> $subjects
* @property-read int|null $subjects_count
*
* @method static Builder|ActivityLog forActor(Model $actor)
* @method static Builder|ActivityLog forEvent(string $action)
* @method static Builder|ActivityLog newModelQuery()
* @method static Builder|ActivityLog newQuery()
* @method static Builder|ActivityLog query()
* @method static Builder|ActivityLog whereActorId($value)
* @method static Builder|ActivityLog whereActorType($value)
* @method static Builder|ActivityLog whereApiKeyId($value)
* @method static Builder|ActivityLog whereDescription($value)
* @method static Builder|ActivityLog whereEvent($value)
* @method static Builder|ActivityLog whereId($value)
* @method static Builder|ActivityLog whereIp($value)
* @method static Builder|ActivityLog whereProperties($value)
* @method static Builder|ActivityLog whereTimestamp($value)
* @method static Builder<static>|ActivityLog forActor(\Illuminate\Database\Eloquent\Model $actor)
* @method static Builder<static>|ActivityLog forEvent(string $action)
* @method static Builder<static>|ActivityLog newModelQuery()
* @method static Builder<static>|ActivityLog newQuery()
* @method static Builder<static>|ActivityLog query()
* @method static Builder<static>|ActivityLog whereActorId($value)
* @method static Builder<static>|ActivityLog whereActorType($value)
* @method static Builder<static>|ActivityLog whereApiKeyId($value)
* @method static Builder<static>|ActivityLog whereDescription($value)
* @method static Builder<static>|ActivityLog whereEvent($value)
* @method static Builder<static>|ActivityLog whereId($value)
* @method static Builder<static>|ActivityLog whereIp($value)
* @method static Builder<static>|ActivityLog whereProperties($value)
* @method static Builder<static>|ActivityLog whereTimestamp($value)
*/
class ActivityLog extends Model implements HasIcon, HasLabel
{
Expand Down
16 changes: 10 additions & 6 deletions app/Models/ActivityLogSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
*
* @property int $id
* @property int $activity_log_id
* @property int $subject_id
* @property string $subject_type
* @property ActivityLog|null $activityLog
* @property Model|\Eloquent $subject
* @property int $subject_id
* @property-read ActivityLog $activityLog
* @property-read Model|\Eloquent $subject
*
* @method static Builder|ActivityLogSubject newModelQuery()
* @method static Builder|ActivityLogSubject newQuery()
* @method static Builder|ActivityLogSubject query()
* @method static Builder<static>|ActivityLogSubject newModelQuery()
* @method static Builder<static>|ActivityLogSubject newQuery()
* @method static Builder<static>|ActivityLogSubject query()
* @method static Builder<static>|ActivityLogSubject whereActivityLogId($value)
* @method static Builder<static>|ActivityLogSubject whereId($value)
* @method static Builder<static>|ActivityLogSubject whereSubjectId($value)
* @method static Builder<static>|ActivityLogSubject whereSubjectType($value)
*/
class ActivityLogSubject extends Pivot
{
Expand Down
44 changes: 22 additions & 22 deletions app/Models/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@

use App\Exceptions\Service\Allocation\ServerUsingAllocationException;
use App\Traits\HasValidation;
use Carbon\Carbon;
use Database\Factories\AllocationFactory;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;

/**
* App\Models\Allocation.
*
* @property int $id
* @property int $node_id
* @property string $ip
* @property string|null $ip_alias
* @property int $port
* @property int|null $server_id
* @property string|null $notes
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $alias
* @property bool $has_alias
* @property string $address
* @property Server|null $server
* @property Node $node
* @property string|null $ip_alias
* @property string|null $notes
* @property bool $is_locked
* @property-read string $address
* @property-read string $alias
* @property-read bool $has_alias
* @property-read Node $node
* @property-read Server|null $server
*
* @method static AllocationFactory factory(...$parameters)
* @method static Builder|Allocation newModelQuery()
* @method static Builder|Allocation newQuery()
* @method static Builder|Allocation query()
* @method static Builder|Allocation whereCreatedAt($value)
* @method static Builder|Allocation whereId($value)
* @method static Builder|Allocation whereIp($value)
* @method static Builder|Allocation whereIpAlias($value)
* @method static Builder|Allocation whereNodeId($value)
* @method static Builder|Allocation whereNotes($value)
* @method static Builder|Allocation wherePort($value)
* @method static Builder|Allocation whereServerId($value)
* @method static Builder|Allocation whereUpdatedAt($value)
* @method static \Database\Factories\AllocationFactory factory($count = null, $state = [])
* @method static Builder<static>|Allocation newModelQuery()
* @method static Builder<static>|Allocation newQuery()
* @method static Builder<static>|Allocation query()
* @method static Builder<static>|Allocation whereCreatedAt($value)
* @method static Builder<static>|Allocation whereId($value)
* @method static Builder<static>|Allocation whereIp($value)
* @method static Builder<static>|Allocation whereIpAlias($value)
* @method static Builder<static>|Allocation whereIsLocked($value)
* @method static Builder<static>|Allocation whereNodeId($value)
* @method static Builder<static>|Allocation whereNotes($value)
* @method static Builder<static>|Allocation wherePort($value)
* @method static Builder<static>|Allocation whereServerId($value)
* @method static Builder<static>|Allocation whereUpdatedAt($value)
*/
class Allocation extends Model
{
Expand Down
Loading
Loading