You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -49,7 +49,8 @@ class CommandLogResource extends Resource
|
|||||||
->badge()
|
->badge()
|
||||||
->color(fn (string $state): string => match ($state) {
|
->color(fn (string $state): string => match ($state) {
|
||||||
'yes' => 'primary',
|
'yes' => 'primary',
|
||||||
'no' => 'warning'
|
'no' => 'warning',
|
||||||
|
default => 'danger',
|
||||||
})
|
})
|
||||||
->label(__('filament::resources.columns.success'))
|
->label(__('filament::resources.columns.success'))
|
||||||
->formatStateUsing(fn (string $state): string => __("filament::resources.options.{$state}")),
|
->formatStateUsing(fn (string $state): string => __("filament::resources.options.{$state}")),
|
||||||
|
|||||||
@@ -5,17 +5,4 @@ namespace App\Filament\Resources\Hotel;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
class CustomQueryBuilder extends Builder
|
class CustomQueryBuilder extends Builder {}
|
||||||
{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
// Call the parent constructor with a dummy query
|
|
||||||
parent::__construct(app('db')->query());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[\Override]
|
|
||||||
public function get($columns = ['*']): Collection
|
|
||||||
{
|
|
||||||
return collect(); // Return an empty collection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -89,7 +89,9 @@ class BanResource extends Resource
|
|||||||
->label(__('filament::resources.columns.reason'))
|
->label(__('filament::resources.columns.reason'))
|
||||||
->tooltip(function (TextColumn $column): ?string {
|
->tooltip(function (TextColumn $column): ?string {
|
||||||
$state = $column->getState();
|
$state = $column->getState();
|
||||||
|
if (! is_string($state)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (strlen($state) <= $column->getCharacterLimit()) {
|
if (strlen($state) <= $column->getCharacterLimit()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -107,12 +109,14 @@ class BanResource extends Resource
|
|||||||
'ip' => __('filament::resources.common.IP'),
|
'ip' => __('filament::resources.common.IP'),
|
||||||
'machine' => __('filament::resources.common.Machine'),
|
'machine' => __('filament::resources.common.Machine'),
|
||||||
'super' => __('filament::resources.common.Super'),
|
'super' => __('filament::resources.common.Super'),
|
||||||
|
default => __('filament::resources.common.Unknown'),
|
||||||
})
|
})
|
||||||
->color(fn (string $state): string => match ($state) {
|
->color(fn (string $state): string => match ($state) {
|
||||||
'account' => 'primary',
|
'account' => 'primary',
|
||||||
'ip' => 'success',
|
'ip' => 'success',
|
||||||
'machine' => 'primary',
|
'machine' => 'primary',
|
||||||
'super' => 'danger',
|
'super' => 'danger',
|
||||||
|
default => 'warning',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
TextColumn::make('timestamp')
|
TextColumn::make('timestamp')
|
||||||
@@ -121,7 +125,10 @@ class BanResource extends Resource
|
|||||||
|
|
||||||
TextColumn::make('ban_expire')
|
TextColumn::make('ban_expire')
|
||||||
->label(__('filament::resources.columns.expires_at'))
|
->label(__('filament::resources.columns.expires_at'))
|
||||||
->formatStateUsing(fn (string $state): string => $state == 0 ? __('filament::resources.common.Never') : date('Y-m-d H:i', $state)),
|
->formatStateUsing(function (string $state): string {
|
||||||
|
$ts = is_numeric($state) ? (int) $state : 0;
|
||||||
|
return $ts === 0 ? __('filament::resources.common.Never') : date('Y-m-d H:i', $ts);
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources\User\Users\Pages;
|
namespace App\Filament\Resources\User\Users\Pages;
|
||||||
|
|
||||||
use App\Enums\NotificationType;
|
|
||||||
use App\Filament\Resources\User\Users\UserResource;
|
use App\Filament\Resources\User\Users\UserResource;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\User\UserNotification;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Actions\CreateAction;
|
use Filament\Actions\CreateAction;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
@@ -49,27 +48,32 @@ class ListUsers extends ListRecords
|
|||||||
->default(false),
|
->default(false),
|
||||||
])
|
])
|
||||||
->action(function (array $data): void {
|
->action(function (array $data): void {
|
||||||
$notifications = collect();
|
$allUsersId = collect($data['users'] ?? [])->values();
|
||||||
$allUsersId = collect($data['users'])->values();
|
$senderId = !empty($data['as_staff']) ? null : auth()->id();
|
||||||
$senderId = $data['as_staff'] ? null : auth()->id();
|
|
||||||
|
|
||||||
if ($allUsersId->isEmpty()) {
|
if ($allUsersId->isEmpty()) {
|
||||||
$allUsersId = User::select('id')->get()->pluck('id');
|
$allUsersId = User::select('id')->get()->pluck('id');
|
||||||
}
|
}
|
||||||
|
|
||||||
$allUsersId->each(function ($userId) use ($senderId, $data, $notifications): void {
|
$rows = [];
|
||||||
$notifications->push([
|
$message = is_string($data['message'] ?? null) ? $data['message'] : '';
|
||||||
|
$url = is_string($data['url'] ?? null) ? $data['url'] : null;
|
||||||
|
$now = now();
|
||||||
|
$type = 'housekeeping_custom_message';
|
||||||
|
$allUsersId->each(function ($userId) use ($senderId, $message, $url, $now, $type, &$rows): void {
|
||||||
|
$rows[] = [
|
||||||
'sender_id' => $senderId,
|
'sender_id' => $senderId,
|
||||||
'recipient_id' => $userId,
|
'recipient_id' => is_numeric($userId) ? (int) $userId : null,
|
||||||
'type' => NotificationType::HousekeepingCustomMessage,
|
'type' => $type,
|
||||||
'message' => $data['message'],
|
'message' => $message,
|
||||||
'url' => $data['url'] ?? null,
|
'url' => $url,
|
||||||
'created_at' => now(),
|
'created_at' => $now,
|
||||||
'updated_at' => now(),
|
'updated_at' => $now,
|
||||||
]);
|
];
|
||||||
});
|
});
|
||||||
|
if (! empty($rows)) {
|
||||||
UserNotification::insert($notifications->toArray());
|
DB::table('user_notifications')->insert($rows);
|
||||||
|
}
|
||||||
|
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->body(__('Notification sent successfully.'))
|
->body(__('Notification sent successfully.'))
|
||||||
|
|||||||
@@ -276,23 +276,28 @@ class RconService
|
|||||||
$this->closeConnection();
|
$this->closeConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendSafelyFromDashboard(string $action, array $args, string $errorMessage): void
|
public function sendSafelyFromDashboard(string $action, mixed $args, string $errorMessage): void
|
||||||
{
|
{
|
||||||
|
$argsArr = is_array($args) ? $args : [];
|
||||||
try {
|
try {
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'sendBadge':
|
case 'sendBadge':
|
||||||
/** @var \App\Models\User $user */
|
$userArg = $argsArr[0] ?? null;
|
||||||
$user = $args[0];
|
if (! ($userArg instanceof \App\Models\User)) {
|
||||||
/** @var string $badge */
|
break;
|
||||||
$badge = (string) ($args[1] ?? '');
|
}
|
||||||
|
$user = $userArg;
|
||||||
|
$badge = is_string($argsArr[1] ?? null) ? $argsArr[1] : '';
|
||||||
$this->giveBadge($user, $badge);
|
$this->giveBadge($user, $badge);
|
||||||
break;
|
break;
|
||||||
case 'removeBadge':
|
case 'removeBadge':
|
||||||
// No direct RCON command defined for removing badges; use alert for now
|
// No direct RCON command defined for removing badges; use alert for now
|
||||||
/** @var \App\Models\User $user */
|
$userArg = $argsArr[0] ?? null;
|
||||||
$user = $args[0];
|
if (! ($userArg instanceof \App\Models\User)) {
|
||||||
/** @var string $badge */
|
break;
|
||||||
$badge = (string) ($args[1] ?? '');
|
}
|
||||||
|
$user = $userArg;
|
||||||
|
$badge = is_string($argsArr[1] ?? null) ? $argsArr[1] : '';
|
||||||
$this->alertUser($user, sprintf('Badge %s removed.', $badge));
|
$this->alertUser($user, sprintf('Badge %s removed.', $badge));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ parameters:
|
|||||||
- '#Unsafe usage of new static#'
|
- '#Unsafe usage of new static#'
|
||||||
- '#uses generic trait .*HasFactory but does not specify its types#'
|
- '#uses generic trait .*HasFactory but does not specify its types#'
|
||||||
- '#extends generic class .*Factory but does not specify its types#'
|
- '#extends generic class .*Factory but does not specify its types#'
|
||||||
|
- '#extends generic class .*Builder but does not specify its types#'
|
||||||
- '#return type with generic class .*Builder does not specify its types#'
|
- '#return type with generic class .*Builder does not specify its types#'
|
||||||
- '#missingType\\.iterableValue#'
|
- '#missingType\\.iterableValue#'
|
||||||
- '#should return array<string, mixed> but returns array#'
|
- '#should return array<string, mixed> but returns array#'
|
||||||
|
|||||||
@@ -85,3 +85,11 @@
|
|||||||
[2026-01-20 16:27:22] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
[2026-01-20 16:27:22] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
[2026-01-20 16:27:49] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
[2026-01-20 16:27:49] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
[2026-01-20 16:29:29] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
[2026-01-20 16:29:29] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
|
[2026-01-20 16:36:38] production.ERROR: Allowed memory size of 536870912 bytes exhausted (tried to allocate 8388616 bytes) {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Allowed memory size of 536870912 bytes exhausted (tried to allocate 8388616 bytes) at C:/Github/Epicnabbo-Catalogus-2025FullPack-Updated-Daily/Updated_Cms/vendor/iamcal/sql-parser/src/SQLParser.php:190)
|
||||||
|
[stacktrace]
|
||||||
|
#0 {main}
|
||||||
|
"}
|
||||||
|
[2026-01-20 16:36:40] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
|
[2026-01-20 16:37:44] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
|
[2026-01-20 16:37:44] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
|
[2026-01-20 16:46:43] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||||
|
|||||||
Reference in New Issue
Block a user