mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-26 14:01:08 +02:00
Disaster Recovery v1
This commit is contained in:
parent
5121cf7170
commit
e5cdd05167
@ -33,8 +33,10 @@ final class DiscordProvider extends OAuthProvider
|
||||
\Filament\Schemas\Components\Wizard\Step::make('Register new Discord OAuth App')
|
||||
->schema([
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(Blade::render('<p>Visit the <x-filament::link href="https://discord.com/developers/applications" target="_blank">Discord Developer Portal</x-filament::link> and click on <b>New Application</b>. Enter a <b>Name</b> (e.g. your panel name) and click on <b>Create</b>.</p><p>Copy the <b>Client ID</b> and the <b>Client Secret</b> from the OAuth2 tab, you will need them in the final step.</p>'))),
|
||||
TextEntry::make('INeedAName2')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString('<p>Under <b>Redirects</b> add the below URL.</p>')),
|
||||
TextInput::make('_noenv_callback')
|
||||
->label('Redirect URL')
|
||||
|
@ -27,6 +27,7 @@ final class GithubProvider extends OAuthProvider
|
||||
\Filament\Schemas\Components\Wizard\Step::make('Register new Github OAuth App')
|
||||
->schema([
|
||||
TextEntry::make('INeedAName2')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(Blade::render('<p>Visit the <x-filament::link href="https://github.com/settings/developers" target="_blank">Github Developer Dashboard</x-filament::link>, go to <b>OAuth Apps</b> and click on <b>New OAuth App</b>.</p><p>Enter an <b>Application name</b> (e.g. your panel name), set <b>Homepage URL</b> to your panel url and enter the below url as <b>Authorization callback URL</b>.</p>'))),
|
||||
TextInput::make('_noenv_callback')
|
||||
->label('Authorization callback URL')
|
||||
@ -35,11 +36,13 @@ final class GithubProvider extends OAuthProvider
|
||||
//TODO ->hintAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null)
|
||||
->default(fn () => url('/auth/oauth/callback/github')),
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString('<p>When you filled all fields click on <b>Register application</b>.</p>')),
|
||||
]),
|
||||
\Filament\Schemas\Components\Wizard\Step::make('Create Client Secret')
|
||||
->schema([
|
||||
TextEntry::make('INeedAName3')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString('<p>Once you registered your app, generate a new <b>Client Secret</b>.</p><p>You will also need the <b>Client ID</b>.</p>')),
|
||||
]),
|
||||
], parent::getSetupSteps());
|
||||
|
@ -47,6 +47,7 @@ final class GitlabProvider extends OAuthProvider
|
||||
\Filament\Schemas\Components\Wizard\Step::make('Register new Gitlab OAuth App')
|
||||
->schema([
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(Blade::render('Check out the <x-filament::link href="https://docs.gitlab.com/integration/oauth_provider/" target="_blank">Gitlab docs</x-filament::link> on how to create the oauth app.'))),
|
||||
TextInput::make('_noenv_callback')
|
||||
->label('Redirect URI')
|
||||
|
@ -58,6 +58,7 @@ final class SteamProvider extends OAuthProvider
|
||||
\Filament\Schemas\Components\Wizard\Step::make('Create API Key')
|
||||
->schema([
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(Blade::render('Visit <x-filament::link href="https://steamcommunity.com/dev/apikey" target="_blank">https://steamcommunity.com/dev/apikey</x-filament::link> to generate an API key.'))),
|
||||
]),
|
||||
], parent::getSetupSteps());
|
||||
|
@ -13,10 +13,7 @@ use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Forms\Components\Actions;
|
||||
use Filament\Forms\Components\Component;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Group;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
@ -82,6 +79,9 @@ class Settings extends Page implements HasSchemas
|
||||
return trans('admin/setting.title');
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function getFormSchema(): array
|
||||
{
|
||||
return [
|
||||
@ -210,7 +210,7 @@ class Settings extends Page implements HasSchemas
|
||||
Select::make('FILAMENT_WIDTH')
|
||||
->label(trans('admin/setting.general.display_width'))
|
||||
->native(false)
|
||||
->options(MaxWidth::class)
|
||||
//TODO->options(MaxWidth::class)
|
||||
->selectablePlaceholder(false)
|
||||
->default(env('FILAMENT_WIDTH', config('panel.filament.display-width'))),
|
||||
TagsInput::make('TRUSTED_PROXIES')
|
||||
|
@ -6,12 +6,13 @@ use App\Filament\Admin\Resources\DatabaseHostResource;
|
||||
use App\Services\Databases\Hosts\HostCreationService;
|
||||
use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Filament\Forms\Components\Fieldset;
|
||||
use Exception;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Components\Utilities\Set;
|
||||
use Filament\Notifications\Notification;
|
||||
@ -53,6 +54,7 @@ class CreateDatabaseHost extends CreateRecord
|
||||
->columns()
|
||||
->schema([
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/databasehost.setup.note')),
|
||||
Toggle::make('different_server')
|
||||
->label(new HtmlString(trans('admin/databasehost.setup.different_server')))
|
||||
@ -87,6 +89,7 @@ class CreateDatabaseHost extends CreateRecord
|
||||
Fieldset::make(trans('admin/databasehost.setup.database_user'))
|
||||
->schema([
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(trans('admin/databasehost.setup.cli_login')))
|
||||
->columnSpanFull(),
|
||||
TextInput::make('create_user')
|
||||
@ -104,12 +107,14 @@ class CreateDatabaseHost extends CreateRecord
|
||||
// TODO ->suffixAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null)
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('INeedAName')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(trans('admin/databasehost.setup.cli_exit')))
|
||||
->columnSpanFull(),
|
||||
]),
|
||||
Fieldset::make(trans('admin/databasehost.setup.external_access'))
|
||||
->schema([
|
||||
TextEntry::make('INeedAName2')
|
||||
->hiddenLabel()
|
||||
->state(new HtmlString(trans('admin/databasehost.setup.allow_external_access')))
|
||||
->columnSpanFull(),
|
||||
]),
|
||||
|
@ -14,6 +14,7 @@ use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\CreateAction as CreateHeaderAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
@ -31,6 +32,9 @@ class ListEggs extends ListRecords
|
||||
|
||||
protected static string $resource = EggResource::class;
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
@ -52,7 +56,7 @@ class ListEggs extends ListRecords
|
||||
->icon('tabler-server')
|
||||
->label(trans('admin/egg.servers')),
|
||||
])
|
||||
->actions([
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->iconButton()
|
||||
->tooltip(trans('filament-actions::edit.single.label')),
|
||||
|
@ -6,12 +6,13 @@ use App\Filament\Admin\Resources\NodeResource;
|
||||
use App\Models\Node;
|
||||
use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Grid;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Wizard;
|
||||
use Filament\Schemas\Components\Wizard\Step;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
@ -30,6 +31,9 @@ class CreateNode extends CreateRecord
|
||||
|
||||
protected static bool $canCreateAnother = false;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
@ -12,17 +12,14 @@ use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Exception;
|
||||
use Filament\Actions;
|
||||
use Filament\Forms\Components\Fieldset;
|
||||
use Filament\Forms\Components\Grid;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Tabs;
|
||||
use Filament\Forms\Components\Tabs\Tab;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Form;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
@ -53,6 +50,9 @@ class EditNode extends EditRecord
|
||||
$this->nodeUpdateService = $nodeUpdateService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
|
@ -9,10 +9,10 @@ use App\Models\Server;
|
||||
use App\Traits\Filament\CanCustomizePages;
|
||||
use App\Traits\Filament\CanCustomizeRelations;
|
||||
use Filament\Forms\Components\CheckboxList;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Resources\Pages\PageRegistration;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ServerResource extends Resource
|
||||
@ -51,6 +51,9 @@ class ServerResource extends Resource
|
||||
return (string) static::getEloquentQuery()->count() ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getMountCheckboxList(Get $get): CheckboxList
|
||||
{
|
||||
$allowedMounts = Mount::all();
|
||||
|
@ -43,6 +43,7 @@ use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use LogicException;
|
||||
use Filament\Schemas\Schema;
|
||||
use Random\RandomException;
|
||||
|
||||
class CreateServer extends CreateRecord
|
||||
{
|
||||
@ -62,6 +63,10 @@ class CreateServer extends CreateRecord
|
||||
$this->serverCreationService = $serverCreationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RandomException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
@ -12,7 +12,6 @@ use App\Traits\Filament\CanModifyForm;
|
||||
use App\Traits\Filament\CanModifyTable;
|
||||
use Filament\Forms\Components\CheckboxList;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Form;
|
||||
use Filament\Resources\Pages\PageRegistration;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
|
@ -3,10 +3,9 @@
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class CanaryWidget extends FormWidget
|
||||
{
|
||||
@ -17,9 +16,12 @@ class CanaryWidget extends FormWidget
|
||||
return config('app.version') === 'canary';
|
||||
}
|
||||
|
||||
public function form(Form $form): Form
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
return $schema
|
||||
->schema([
|
||||
Section::make(trans('admin/dashboard.sections.intro-developers.heading'))
|
||||
->icon('tabler-code')
|
||||
@ -28,10 +30,12 @@ class CanaryWidget extends FormWidget
|
||||
->collapsed()
|
||||
->persistCollapsed()
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-developers.content')),
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-developers.extra_note')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-developers.content')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-developers.extra_note')),
|
||||
])
|
||||
->headerActions([
|
||||
Action::make('issues')
|
||||
|
@ -12,5 +12,5 @@ abstract class FormWidget extends Widget implements HasForms
|
||||
|
||||
protected static bool $isLazy = false;
|
||||
|
||||
protected static string $view = 'filament.admin.widgets.form-widget';
|
||||
protected string $view = 'filament.admin.widgets.form-widget';
|
||||
}
|
||||
|
@ -2,18 +2,22 @@
|
||||
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Form;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class HelpWidget extends FormWidget
|
||||
{
|
||||
protected static ?int $sort = 4;
|
||||
|
||||
public function form(Form $form): Form
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
return $schema
|
||||
->schema([
|
||||
Section::make(trans('admin/dashboard.sections.intro-help.heading'))
|
||||
->icon('tabler-question-mark')
|
||||
@ -21,8 +25,9 @@ class HelpWidget extends FormWidget
|
||||
->collapsible()
|
||||
->persistCollapsed()
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-help.content')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-help.content')),
|
||||
])
|
||||
->headerActions([
|
||||
Action::make('docs')
|
||||
|
@ -4,10 +4,10 @@ namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use App\Filament\Admin\Resources\NodeResource\Pages\CreateNode;
|
||||
use App\Models\Node;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class NoNodesWidget extends FormWidget
|
||||
{
|
||||
@ -18,9 +18,12 @@ class NoNodesWidget extends FormWidget
|
||||
return Node::count() <= 0;
|
||||
}
|
||||
|
||||
public function form(Form $form): Form
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
return $schema
|
||||
->schema([
|
||||
Section::make(trans('admin/dashboard.sections.intro-first-node.heading'))
|
||||
->icon('tabler-server-2')
|
||||
@ -28,8 +31,9 @@ class NoNodesWidget extends FormWidget
|
||||
->collapsible()
|
||||
->persistCollapsed()
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-first-node.content')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-first-node.content')),
|
||||
])
|
||||
->headerActions([
|
||||
Action::make('create-node')
|
||||
|
@ -2,18 +2,22 @@
|
||||
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Form;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class SupportWidget extends FormWidget
|
||||
{
|
||||
protected static ?int $sort = 3;
|
||||
|
||||
public function form(Form $form): Form
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
return $schema
|
||||
->schema([
|
||||
Section::make(trans('admin/dashboard.sections.intro-support.heading'))
|
||||
->icon('tabler-heart-filled')
|
||||
@ -21,10 +25,12 @@ class SupportWidget extends FormWidget
|
||||
->collapsible()
|
||||
->persistCollapsed()
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-support.content')),
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-support.extra_note')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-support.content')),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-support.extra_note')),
|
||||
])
|
||||
->headerActions([
|
||||
Action::make('donate')
|
||||
|
@ -3,10 +3,11 @@
|
||||
namespace App\Filament\Admin\Widgets;
|
||||
|
||||
use App\Services\Helpers\SoftwareVersionService;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Form;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class UpdateWidget extends FormWidget
|
||||
{
|
||||
@ -19,26 +20,30 @@ class UpdateWidget extends FormWidget
|
||||
$this->softwareVersionService = $softwareVersionService;
|
||||
}
|
||||
|
||||
public function form(Form $form): Form
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
$isLatest = $this->softwareVersionService->isLatestPanel();
|
||||
|
||||
return $form
|
||||
return $schema
|
||||
->schema([
|
||||
$isLatest
|
||||
? Section::make(trans('admin/dashboard.sections.intro-no-update.heading'))
|
||||
->icon('tabler-checkbox')
|
||||
->iconColor('success')
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-no-update.content', ['version' => $this->softwareVersionService->currentPanelVersion()])),
|
||||
TextEntry::make('iNeedAName')
|
||||
->hiddenLabel()
|
||||
->state(trans('admin/dashboard.sections.intro-no-update.content', ['version' => $this->softwareVersionService->currentPanelVersion()])),
|
||||
])
|
||||
: Section::make(trans('admin/dashboard.sections.intro-update-available.heading'))
|
||||
->icon('tabler-info-circle')
|
||||
->iconColor('warning')
|
||||
->schema([
|
||||
Placeholder::make('')
|
||||
->content(trans('admin/dashboard.sections.intro-update-available.content', ['latestVersion' => $this->softwareVersionService->latestPanelVersion()])),
|
||||
TextEntry::make('iNeedAName')
|
||||
->state(trans('admin/dashboard.sections.intro-update-available.content', ['latestVersion' => $this->softwareVersionService->latestPanelVersion()])),
|
||||
])
|
||||
->headerActions([
|
||||
Action::make('update')
|
||||
|
@ -11,12 +11,15 @@ use App\Models\Server;
|
||||
use App\Repositories\Daemon\DaemonPowerRepository;
|
||||
use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Exception;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Components\Tab;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\TextSize;
|
||||
use Filament\Tables\Columns\ColumnGroup;
|
||||
use Filament\Tables\Columns\Column;
|
||||
use Filament\Tables\Columns\Layout\Stack;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
@ -43,7 +46,9 @@ class ListServers extends ListRecords
|
||||
$this->daemonPowerRepository = new DaemonPowerRepository();
|
||||
}
|
||||
|
||||
/** @return Stack[] */
|
||||
/** @return Stack[]
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function gridColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -54,7 +59,9 @@ class ListServers extends ListRecords
|
||||
];
|
||||
}
|
||||
|
||||
/** @return Column[] */
|
||||
/** @return Column[]
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function tableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -105,6 +112,9 @@ class ListServers extends ListRecords
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
$baseQuery = auth()->user()->accessibleServers();
|
||||
@ -117,8 +127,8 @@ class ListServers extends ListRecords
|
||||
->poll('15s')
|
||||
->columns($usingGrid ? $this->gridColumns() : $this->tableColumns())
|
||||
->recordUrl(!$usingGrid ? (fn (Server $server) => Console::getUrl(panel: 'server', tenant: $server)) : null)
|
||||
->actions(!$usingGrid ? ActionGroup::make(static::getPowerActions()) : [])
|
||||
->actionsAlignment(Alignment::Center->value)
|
||||
->recordActions(!$usingGrid ? ActionGroup::make(static::getPowerActions()) : [])
|
||||
->recordActionsAlignment(Alignment::Center->value)
|
||||
->contentGrid($usingGrid ? ['default' => 1, 'md' => 2] : null)
|
||||
->emptyStateIcon('tabler-brand-docker')
|
||||
->emptyStateDescription('')
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace App\Filament\Server\Components;
|
||||
|
||||
use Closure;
|
||||
use Filament\Schemas\Components\Component;
|
||||
use Filament\Support\Concerns\EvaluatesClosures;
|
||||
use Filament\Widgets\StatsOverviewWidget\Stat;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class SmallStatBlock extends Component
|
||||
@ -16,6 +16,7 @@ class SmallStatBlock extends Component
|
||||
public function copyOnClick(bool|Closure $copyOnClick = true): static
|
||||
{
|
||||
$this->copyOnClick = $copyOnClick;
|
||||
}
|
||||
|
||||
protected string $value;
|
||||
|
||||
|
@ -16,7 +16,6 @@ use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ListBackups extends ListRecords
|
||||
{
|
||||
|
@ -246,10 +246,7 @@ class EditFiles extends Page
|
||||
return $this->fileRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $parameters
|
||||
*/
|
||||
public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null): string
|
||||
public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null, bool $shouldGuessMissingParameters = false): string
|
||||
{
|
||||
return parent::getUrl($parameters, $isAbsolute, $panel, $tenant) . '/';
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ use App\Models\Server;
|
||||
use App\Repositories\Daemon\DaemonFileRepository;
|
||||
use App\Filament\Components\Tables\Columns\BytesColumn;
|
||||
use App\Filament\Components\Tables\Columns\DateTimeColumn;
|
||||
use App\Traits\Filament\CanCustomizeHeaderActions;
|
||||
use App\Traits\Filament\CanCustomizeHeaderWidgets;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Actions\BulkAction;
|
||||
@ -402,7 +404,9 @@ class ListFiles extends ListRecords
|
||||
]);
|
||||
}
|
||||
|
||||
/** @return array<HeaderAction|HeaderActionGroup> */
|
||||
/** @return array<HeaderAction|HeaderActionGroup>
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getDefaultHeaderActions(): array
|
||||
{
|
||||
/** @var Server $server */
|
||||
|
@ -23,7 +23,6 @@ use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Schemas\Components\Actions;
|
||||
use Filament\Schemas\Components\Form;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Utilities\Set;
|
||||
use Filament\Notifications\Notification;
|
||||
|
@ -10,9 +10,8 @@ use Filament\Widgets\ChartWidget;
|
||||
|
||||
class ServerNetworkChart extends ChartWidget
|
||||
{
|
||||
protected static ?string $pollingInterval = '1s';
|
||||
|
||||
protected static ?string $maxHeight = '200px';
|
||||
protected ?string $pollingInterval = '1s';
|
||||
protected ?string $maxHeight = '200px';
|
||||
|
||||
public ?Server $server = null;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace App\Traits\Filament;
|
||||
|
||||
use Closure;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
trait CanModifyForm
|
||||
{
|
||||
@ -15,19 +15,19 @@ trait CanModifyForm
|
||||
static::$customFormModifications[] = $closure;
|
||||
}
|
||||
|
||||
public static function defaultForm(Form $form): Form
|
||||
public static function defaultForm(Schema $schema): Schema
|
||||
{
|
||||
return $form;
|
||||
return $schema;
|
||||
}
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
$form = static::defaultForm($form);
|
||||
$schema = static::defaultForm($schema);
|
||||
|
||||
foreach (static::$customFormModifications as $closure) {
|
||||
$form = $closure($form);
|
||||
$schema = $closure($schema);
|
||||
}
|
||||
|
||||
return $form;
|
||||
return $schema;
|
||||
}
|
||||
}
|
||||
|
98
composer.lock
generated
98
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "8453d92b549f58567eabf23803ef5f7f",
|
||||
"content-hash": "e2d98fce8ab715d199859f4ed6a088a7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
@ -936,16 +936,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.343.1",
|
||||
"version": "3.346.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "b24383b59b0fc039cecffe0bd7453ae514b22ed5"
|
||||
"reference": "d1403b5a39af7ab7af4fc538deb33013c19c8d33"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b24383b59b0fc039cecffe0bd7453ae514b22ed5",
|
||||
"reference": "b24383b59b0fc039cecffe0bd7453ae514b22ed5",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d1403b5a39af7ab7af4fc538deb33013c19c8d33",
|
||||
"reference": "d1403b5a39af7ab7af4fc538deb33013c19c8d33",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1027,9 +1027,9 @@
|
||||
"support": {
|
||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.343.1"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.346.2"
|
||||
},
|
||||
"time": "2025-04-30T18:21:17+00:00"
|
||||
"time": "2025-06-20T18:10:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "blade-ui-kit/blade-heroicons",
|
||||
@ -6836,16 +6836,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "3.0.44",
|
||||
"version": "3.0.45",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9"
|
||||
"reference": "bd81b90d5963c6b9d87de50357585375223f4dd8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/1d0b5e7e1434678411787c5a0535e68907cf82d9",
|
||||
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/bd81b90d5963c6b9d87de50357585375223f4dd8",
|
||||
"reference": "bd81b90d5963c6b9d87de50357585375223f4dd8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -6926,7 +6926,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.44"
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.45"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -6942,7 +6942,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-06-15T09:59:26+00:00"
|
||||
"time": "2025-06-22T22:54:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpdoc-parser",
|
||||
@ -7635,16 +7635,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psy/psysh",
|
||||
"version": "v0.12.8",
|
||||
"version": "v0.12.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bobthecow/psysh.git",
|
||||
"reference": "85057ceedee50c49d4f6ecaff73ee96adb3b3625"
|
||||
"reference": "1b801844becfe648985372cb4b12ad6840245ace"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/85057ceedee50c49d4f6ecaff73ee96adb3b3625",
|
||||
"reference": "85057ceedee50c49d4f6ecaff73ee96adb3b3625",
|
||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/1b801844becfe648985372cb4b12ad6840245ace",
|
||||
"reference": "1b801844becfe648985372cb4b12ad6840245ace",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -7708,9 +7708,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/bobthecow/psysh/issues",
|
||||
"source": "https://github.com/bobthecow/psysh/tree/v0.12.8"
|
||||
"source": "https://github.com/bobthecow/psysh/tree/v0.12.9"
|
||||
},
|
||||
"time": "2025-03-16T03:05:19+00:00"
|
||||
"time": "2025-06-23T02:35:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ralouphie/getallheaders",
|
||||
@ -8676,16 +8676,16 @@
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-data",
|
||||
"version": "4.15.2",
|
||||
"version": "4.16.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/laravel-data.git",
|
||||
"reference": "50f5abe716ff1ad9a3e96dcfdeb4ad00f014bf8d"
|
||||
"reference": "5ec820642ccfec47cd481cfc638d6148684f9655"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/laravel-data/zipball/50f5abe716ff1ad9a3e96dcfdeb4ad00f014bf8d",
|
||||
"reference": "50f5abe716ff1ad9a3e96dcfdeb4ad00f014bf8d",
|
||||
"url": "https://api.github.com/repos/spatie/laravel-data/zipball/5ec820642ccfec47cd481cfc638d6148684f9655",
|
||||
"reference": "5ec820642ccfec47cd481cfc638d6148684f9655",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -8747,7 +8747,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/spatie/laravel-data/issues",
|
||||
"source": "https://github.com/spatie/laravel-data/tree/4.15.2"
|
||||
"source": "https://github.com/spatie/laravel-data/tree/4.16.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -8755,7 +8755,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-06-12T09:42:08+00:00"
|
||||
"time": "2025-06-20T12:20:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-fractal",
|
||||
@ -13186,16 +13186,16 @@
|
||||
},
|
||||
{
|
||||
"name": "larastan/larastan",
|
||||
"version": "v3.4.2",
|
||||
"version": "v3.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/larastan/larastan.git",
|
||||
"reference": "36706736a0c51d3337478fab9c919d78d2e03404"
|
||||
"reference": "e8ccd73008487ba91da9877b373f8c447743f1ce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/larastan/larastan/zipball/36706736a0c51d3337478fab9c919d78d2e03404",
|
||||
"reference": "36706736a0c51d3337478fab9c919d78d2e03404",
|
||||
"url": "https://api.github.com/repos/larastan/larastan/zipball/e8ccd73008487ba91da9877b373f8c447743f1ce",
|
||||
"reference": "e8ccd73008487ba91da9877b373f8c447743f1ce",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -13263,7 +13263,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/larastan/larastan/issues",
|
||||
"source": "https://github.com/larastan/larastan/tree/v3.4.2"
|
||||
"source": "https://github.com/larastan/larastan/tree/v3.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -13271,7 +13271,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-06-10T09:34:58+00:00"
|
||||
"time": "2025-06-19T22:41:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/pail",
|
||||
@ -13420,16 +13420,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/sail",
|
||||
"version": "v1.42.0",
|
||||
"version": "v1.43.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sail.git",
|
||||
"reference": "2edaaf77f3c07a4099965bb3d7dfee16e801c0f6"
|
||||
"reference": "3e7d899232a8c5e3ea4fc6dee7525ad583887e72"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/2edaaf77f3c07a4099965bb3d7dfee16e801c0f6",
|
||||
"reference": "2edaaf77f3c07a4099965bb3d7dfee16e801c0f6",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/3e7d899232a8c5e3ea4fc6dee7525ad583887e72",
|
||||
"reference": "3e7d899232a8c5e3ea4fc6dee7525ad583887e72",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -13479,7 +13479,7 @@
|
||||
"issues": "https://github.com/laravel/sail/issues",
|
||||
"source": "https://github.com/laravel/sail"
|
||||
},
|
||||
"time": "2025-04-29T14:26:46+00:00"
|
||||
"time": "2025-05-19T13:19:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mockery/mockery",
|
||||
@ -14238,16 +14238,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.1.13",
|
||||
"version": "2.1.17",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9"
|
||||
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
|
||||
"reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053",
|
||||
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -14292,7 +14292,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-04-27T12:28:25+00:00"
|
||||
"time": "2025-05-21T20:55:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@ -15670,16 +15670,16 @@
|
||||
},
|
||||
{
|
||||
"name": "spatie/backtrace",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/backtrace.git",
|
||||
"reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2"
|
||||
"reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/backtrace/zipball/9807de6b8fecfaa5b3d10650985f0348b02862b2",
|
||||
"reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2",
|
||||
"url": "https://api.github.com/repos/spatie/backtrace/zipball/cd37a49fce7137359ac30ecc44ef3e16404cccbe",
|
||||
"reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -15717,7 +15717,7 @@
|
||||
"spatie"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/spatie/backtrace/tree/1.7.2"
|
||||
"source": "https://github.com/spatie/backtrace/tree/1.7.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -15729,7 +15729,7 @@
|
||||
"type": "other"
|
||||
}
|
||||
],
|
||||
"time": "2025-04-28T14:55:53+00:00"
|
||||
"time": "2025-05-08T15:41:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/error-solutions",
|
||||
@ -16212,9 +16212,7 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {
|
||||
"larastan/larastan": 20
|
||||
},
|
||||
"stability-flags": {},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user