Compare commits

...

4 Commits

Author SHA1 Message Date
MartinOscar
c8556a4c56 Use placeholder for EditServer db_delete (#1362) 2025-05-10 00:01:58 +02:00
MartinOscar
6de6306a19 Fix GSLToken id, label & query (#1361) 2025-05-09 17:57:18 -04:00
Charles
1f8a5cdd1d Fix font dropdown on EditProfile Page (#1360) 2025-05-09 17:42:39 -04:00
Charles
30ae860d69 Fix server notification body translation key (#1359) 2025-05-09 17:39:15 -04:00
4 changed files with 18 additions and 13 deletions

View File

@@ -14,8 +14,11 @@ use Filament\Facades\Filament;
use Filament\Forms\Components\Placeholder;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\HtmlString;
class GSLToken extends FeatureProvider
{
@@ -35,7 +38,7 @@ class GSLToken extends FeatureProvider
public function getId(): string
{
return 'gsltoken';
return 'gsl_token';
}
public function getAction(): Action
@@ -44,7 +47,9 @@ class GSLToken extends FeatureProvider
$server = Filament::getTenant();
/** @var ServerVariable $serverVariable */
$serverVariable = $server->serverVariables()->where('env_variable', 'STEAM_ACC')->first();
$serverVariable = $server->serverVariables()->whereHas('variable', function (Builder $query) {
$query->where('env_variable', 'STEAM_ACC');
})->first();
return Action::make($this->getId())
->requiresConfirmation()
@@ -54,7 +59,7 @@ class GSLToken extends FeatureProvider
->disabledForm(fn () => !auth()->user()->can(Permission::ACTION_STARTUP_UPDATE, $server))
->form([
Placeholder::make('info')
->label('You can either <x-filament::link href="https://steamcommunity.com/dev/managegameservers" target="_blank">generate a new one</x-filament::link> and enter it below or leave the field blank to remove it completely.'),
->label(new HtmlString(Blade::render('You can either <x-filament::link href="https://steamcommunity.com/dev/managegameservers" target="_blank">generate a new one</x-filament::link> and enter it below or leave the field blank to remove it completely.'))),
TextInput::make('gsltoken')
->label('GSL Token')
->rules([

View File

@@ -716,8 +716,8 @@ class EditServer extends EditRecord
->requiresConfirmation()
->modalIcon('tabler-database-x')
->modalHeading(trans('admin/server.delete_db_heading'))
->modalSubmitActionLabel(fn (Get $get) => 'Delete ' . $get('database') . '?')
->modalDescription(fn (Get $get) => trans('admin/server.delete_db') . $get('database') . '?')
->modalSubmitActionLabel(trans('filament-actions::delete.single.label'))
->modalDescription(fn (Get $get) => trans('admin/server.delete_db', ['name' => $get('database')]))
->action(function (DatabaseManagementService $databaseManagementService, $record) {
$databaseManagementService->delete($record);
$this->fillForm();
@@ -851,7 +851,7 @@ class EditServer extends EditRecord
} catch (Exception) {
Notification::make()
->title(trans('admin/server.notifications.reinstall_failed'))
->body(trans('admin/server.error_connecting', ['node' => $server->node->name]))
->body(trans('admin/server.notifications.error_connecting', ['node' => $server->node->name]))
->danger()
->send();
}
@@ -900,7 +900,7 @@ class EditServer extends EditRecord
Notification::make()
->warning()
->title(trans('admin/server.notifications.server_suspension'))
->body(trans('admin/server.error_connecting', ['node' => $server->node->name]))
->body(trans('admin/server.notifications.error_connecting', ['node' => $server->node->name]))
->send();
}
}),
@@ -922,7 +922,7 @@ class EditServer extends EditRecord
Notification::make()
->warning()
->title(trans('admin/server.notifications.server_suspension'))
->body(trans('admin/server.error_connecting', ['node' => $server->node->name]))
->body(trans('admin/server.notifications.error_connecting', ['node' => $server->node->name]))
->send();
}
}),
@@ -987,7 +987,7 @@ class EditServer extends EditRecord
} catch (Exception) {
Notification::make()
->title(trans('admin/server.notifications.reinstall_failed'))
->body(trans('admin/server.error_connecting', ['node' => $server->node->name]))
->body(trans('admin/server.notifications.error_connecting', ['node' => $server->node->name]))
->danger()
->send();
}

View File

@@ -383,12 +383,12 @@ class EditProfile extends BaseEditProfile
'monospace' => 'monospace', //default
];
if (!Storage::disk('public')->exists('storage/fonts')) {
Storage::disk('public')->makeDirectory('storage/fonts');
if (!Storage::disk('public')->exists('fonts')) {
Storage::disk('public')->makeDirectory('fonts');
$this->fillForm();
}
foreach (Storage::disk('public')->allFiles('storage/fonts') as $file) {
foreach (Storage::disk('public')->allFiles('fonts') as $file) {
$fileInfo = pathinfo($file);
if ($fileInfo['extension'] === 'ttf') {

View File

@@ -86,7 +86,7 @@ return [
'allocations' => 'Allocations',
'databases' => 'Databases',
'no_databases' => 'No Databases exist for this Server',
'delete_db' => 'Are you sure you want to delete',
'delete_db' => 'Are you sure you want to delete :name ?',
'delete_db_heading' => 'Delete Database?',
'backups' => 'Backups',
'egg' => 'Egg',