Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Client UI translate to Filament (from React) #416

Draft
wants to merge 160 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
db67946
Add new panel
lancepioch Jun 9, 2024
46c5d5b
Add some basic resource pages
lancepioch Jun 9, 2024
5afd194
Wip
lancepioch Jun 9, 2024
3b9fbc0
Wip terminal
lancepioch Jun 16, 2024
d86428a
Wip
lancepioch Jun 17, 2024
281c580
Add new panel
lancepioch Jun 9, 2024
a976a17
Add some basic resource pages
lancepioch Jun 9, 2024
d4e3721
Wip
lancepioch Jun 9, 2024
2f9ae32
[Sub-Users] Add Invite
notAreYouScared Jun 19, 2024
ab96feb
[Sub-Users] Fix Creation
notAreYouScared Jun 19, 2024
4e9eb34
[Cron] Add basics
notAreYouScared Jun 19, 2024
7fb3785
Merge branch 'issue/353' of github.com:pelican-dev/panel into issue/353
lancepioch Jul 5, 2024
4ec2fbc
Add basic auth and messages
lancepioch Jul 5, 2024
321fcd8
Add basic buttons
lancepioch Jul 5, 2024
ce45884
Merge branch 'main' into issue/353
notAreYouScared Jul 7, 2024
511dc34
WIP on issue/353
notAreYouScared Jul 7, 2024
b191a6c
WIP on issue/353
notAreYouScared Jul 7, 2024
10c1228
Add Database page
notAreYouScared Jul 7, 2024
a9497d3
Update Database Page
notAreYouScared Jul 7, 2024
675d405
Start of Backup Page
notAreYouScared Jul 7, 2024
cdced0b
Composer Update
notAreYouScared Jul 21, 2024
1bf0054
Changes
notAreYouScared Jul 21, 2024
033b298
Send input
lancepioch Jul 25, 2024
60151d5
Remove this includes
lancepioch Jul 25, 2024
2823e45
Better offline handling
lancepioch Jul 25, 2024
f993b55
Merge branch 'issue/353' of github.com:pelican-dev/panel into issue/353
lancepioch Jul 25, 2024
080f066
Consolidate top nav config
lancepioch Jul 25, 2024
704a1f8
Update Backups Page
notAreYouScared Jul 28, 2024
1612189
Update Backups
notAreYouScared Jul 29, 2024
959fa8d
Change name
notAreYouScared Jul 29, 2024
e6e3ce0
Add Assign All, Layout Fixes.
notAreYouScared Aug 4, 2024
5157c97
Merge branch 'main' into issue/353
notAreYouScared Aug 4, 2024
1636164
conflict
notAreYouScared Aug 4, 2024
6b857d7
update schedule pages
Boy132 Aug 5, 2024
d7dd067
fix phpstan
Boy132 Aug 5, 2024
572991a
update pint.json
Boy132 Aug 5, 2024
1a94c2a
add cron presets to schedule
Boy132 Aug 5, 2024
8c94c37
fix tests
Boy132 Aug 5, 2024
2d57a2e
fix task creation
Boy132 Aug 5, 2024
b23c9cf
schedules: disable task creation if limit is reached & disable backup…
Boy132 Aug 5, 2024
d80094a
update activity pages
Boy132 Aug 5, 2024
92a6c2c
update resources
notAreYouScared Aug 6, 2024
f7a2c7c
Update Edit User
notAreYouScared Aug 6, 2024
c67a2e9
.... Sure it works.
notAreYouScared Aug 6, 2024
7e6fc67
user: update canAccessPanel & canAccessTenant
Boy132 Aug 6, 2024
a8f8ddb
add helper to convert bytes into readable format
Boy132 Aug 8, 2024
11aac03
very basic file explorer
Boy132 Aug 9, 2024
5a9bf95
files: fix some stuff & remove dummy data
Boy132 Aug 9, 2024
e77de55
files: better error handling
Boy132 Aug 9, 2024
a39169d
files: basic file editor
Boy132 Aug 9, 2024
1da9b0d
files: add some actions
Boy132 Aug 9, 2024
818b1f3
File manager updates
notAreYouScared Aug 9, 2024
45f6811
files: fix paths
Boy132 Aug 9, 2024
70f82bc
Merge branch 'main' into issue/353
notAreYouScared Aug 10, 2024
962a0b9
Revery Composer Upgrade, Fixes SQLite
notAreYouScared Aug 10, 2024
4a7ef0e
fix: Pint (#517)
Poseidon281 Aug 11, 2024
a655f01
Update File Editing
notAreYouScared Aug 11, 2024
f76a05c
add enum for editor langs
Boy132 Aug 11, 2024
6691d51
files: add upload & pull actions
Boy132 Aug 11, 2024
0d7cc3e
fix build
Boy132 Aug 11, 2024
ca13ee3
files: handle images
Boy132 Aug 11, 2024
fa27d92
Update to Filament v3.2.98
notAreYouScared Aug 12, 2024
b1ba37e
files: add remaining actions
Boy132 Aug 12, 2024
652fa0c
use `authorize` instead of `hidden`
Boy132 Aug 12, 2024
8e4d10b
fix canAccessTenant
Boy132 Aug 12, 2024
3001e87
update date columns
Boy132 Aug 12, 2024
4059129
files: testing & fixes
Boy132 Aug 12, 2024
87fc00d
Fix File Names
notAreYouScared Aug 12, 2024
1cfb6db
Combine Pull/Upload
notAreYouScared Aug 12, 2024
abd525c
Fix BulkDelete
notAreYouScared Aug 12, 2024
dcf234a
Uncontained tabs
notAreYouScared Aug 12, 2024
d6cf3ac
Hide Lang Selection, Move Actions
notAreYouScared Aug 12, 2024
6f65fc9
Update Monaco, more custom
notAreYouScared Aug 12, 2024
500f083
Add livewire config
notAreYouScared Aug 12, 2024
eb3ed74
files: fix record url
Boy132 Aug 13, 2024
bf9b91e
basic setup for settings & startup page
Boy132 Aug 13, 2024
419e248
make abstract class for simple app pages
Boy132 Aug 13, 2024
aebe25e
Basic Startup Page
notAreYouScared Aug 13, 2024
9dae9ed
Update nav sort
notAreYouScared Aug 13, 2024
413b3a3
small cleanup
Boy132 Aug 14, 2024
8f24a21
startup: fix shouldHideComponent & getSelectOptionsFromRules
Boy132 Aug 14, 2024
30404ff
startup: fix non editable fields & set default value
Boy132 Aug 14, 2024
1e0bb00
startup: add todo for save button
Boy132 Aug 14, 2024
e0ee02b
Save Variables after update & off click
notAreYouScared Aug 14, 2024
42b8a22
Notifications are cool
notAreYouScared Aug 14, 2024
e10eb6a
Add rule validation
notAreYouScared Aug 14, 2024
967a4ff
Sort variables by sortid
notAreYouScared Aug 14, 2024
64205c1
pint
notAreYouScared Aug 14, 2024
038eca8
Settings Page + Startup Changes
notAreYouScared Aug 14, 2024
e91a6b3
settings: cleanup
Boy132 Aug 15, 2024
de3ddd5
refactor: use server model for ServerFormPage (formerly known as Simp…
Boy132 Aug 16, 2024
35f77b4
Use Repeater for variables
notAreYouScared Aug 16, 2024
329b3d8
Add Network, Remove breadcrumbs
notAreYouScared Aug 16, 2024
ac450b0
Add paginated to file explorer
notAreYouScared Aug 16, 2024
91d1952
Fix updating variables
notAreYouScared Aug 16, 2024
5237c24
Add link to go to new client area
notAreYouScared Aug 17, 2024
36de986
Merge branch 'main' into issue/353
Boy132 Aug 20, 2024
493e0f8
fix after merge
Boy132 Aug 20, 2024
888e26a
Add graphs to console page
notAreYouScared Aug 25, 2024
b185d2d
Merge branch 'main' into issue/353
Boy132 Sep 21, 2024
d1f7418
fix pint & phpstan
Boy132 Sep 21, 2024
5323ca0
fix authorizeAccess for EditFiles and Startup page
Boy132 Sep 22, 2024
22cd18d
Fix rules on startup page
notAreYouScared Sep 22, 2024
95c501a
Update console size
notAreYouScared Oct 2, 2024
8f18a45
Fix node name
notAreYouScared Oct 2, 2024
b07bbfe
add "global search" to files list
Boy132 Oct 7, 2024
09dcffa
remove debug dummy data
Boy132 Oct 7, 2024
a05bfd3
Merge branch 'main' into issue/353
Boy132 Oct 7, 2024
6b760e6
update view action on ListServers
Boy132 Oct 7, 2024
f9f67a7
enable SPA mode for app panel
Boy132 Oct 7, 2024
bdf581e
remove colors from app panel
Boy132 Oct 7, 2024
4c70292
update global search ui a bit
Boy132 Oct 7, 2024
616a7be
add own page for global search
Boy132 Oct 8, 2024
7339509
fix File getRows
Boy132 Oct 8, 2024
3505754
remove "path" from SearchFiles (for now)
Boy132 Oct 8, 2024
87483d0
fix caching for searched files
Boy132 Oct 8, 2024
43b4e13
add title and breadcrumbs to global search page
Boy132 Oct 8, 2024
78335fd
Merge branch 'main' into issue/353
Boy132 Oct 17, 2024
35e616e
make cpu & memory charts on console page working
Boy132 Oct 18, 2024
6377c77
fix phpstan
Boy132 Oct 18, 2024
4c8b288
add missing import
Boy132 Oct 18, 2024
444fa7b
cleanup console views & widgets
Boy132 Oct 18, 2024
a314fd8
add overview stats to console
Boy132 Oct 18, 2024
bec2702
don't be so lazy, console!
Boy132 Oct 18, 2024
e9eb90c
make history working
Boy132 Oct 18, 2024
cdb9f30
decode data to get array
Boy132 Oct 19, 2024
cbcfc8a
add missing On
Boy132 Oct 19, 2024
e812f93
fix json_decode
Boy132 Oct 19, 2024
17d2609
change polling to 1 sec
Boy132 Oct 19, 2024
9e7ada1
hide "0" cpu/ memory
Boy132 Oct 19, 2024
7289c00
add data to network chart
Boy132 Oct 19, 2024
dab5a5c
Remove data labels
notAreYouScared Oct 19, 2024
97fcd31
fix data on network chart
Boy132 Oct 19, 2024
b042daf
Merge remote-tracking branch 'upstream/issue/353' into issue/353
Boy132 Oct 19, 2024
36b39ff
fix data on network chart (2nd try)
Boy132 Oct 19, 2024
ebfb033
WIP Network Stats
notAreYouScared Oct 19, 2024
a9b369f
Remove test
notAreYouScared Oct 19, 2024
e7dca74
Change MaxWidth
notAreYouScared Oct 19, 2024
c1f95ee
Merge branch 'main' into issue/353
Boy132 Oct 21, 2024
ec1bd08
run pint
Boy132 Oct 21, 2024
fa21c78
fix phpstan
Boy132 Oct 21, 2024
d1f61f5
Fix storeStats cast
RMartinOscar Oct 29, 2024
52789f8
make $data a string
Boy132 Oct 29, 2024
ee39315
update visible check for "admin" menu item
Boy132 Oct 29, 2024
7a8f67e
remove account widget
Boy132 Oct 29, 2024
399ea45
rebrand "Dashboard" to "Server List"
Boy132 Oct 29, 2024
11bb03b
fix canAccessPanel
Boy132 Oct 29, 2024
a708218
Merge branch 'main' into issue/353
Boy132 Oct 29, 2024
c6522e0
separate server list into own panel
Boy132 Nov 6, 2024
efa0d98
change path to avoid conflicts with old client area (and remove sideb…
Boy132 Nov 6, 2024
4dd4968
display correct icon and color on server list entries
Boy132 Nov 6, 2024
2a5cd74
show total memory if server is offline
Boy132 Nov 6, 2024
7f2f5cb
replace custom server list page with ListRecords page
Boy132 Nov 8, 2024
ff73480
Merge branch 'main' into issue/353
Boy132 Nov 8, 2024
2b1366b
fix tests
Boy132 Nov 8, 2024
fcc590b
fix namespace
Boy132 Nov 8, 2024
f77230b
remove "open" button and make whole column clickable
Boy132 Nov 8, 2024
6e318c8
Update EditProfile
notAreYouScared Nov 12, 2024
91c9d0b
run pint
Boy132 Nov 13, 2024
cc926cb
fix access to server list
Boy132 Nov 13, 2024
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
98 changes: 98 additions & 0 deletions app/Enums/EditorLanguages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum EditorLanguages: string implements HasLabel
{
case plaintext = 'plaintext';
case abap = 'abap';
case apex = 'apex';
case azcali = 'azcali';
case bat = 'bat';
case bicep = 'bicep';
case cameligo = 'cameligo';
case coljure = 'coljure';
case coffeescript = 'coffeescript';
case c = 'c';
case cpp = 'cpp';
case csharp = 'csharp';
case csp = 'csp';
case css = 'css';
case cypher = 'cypher';
case dart = 'dart';
case dockerfile = 'dockerfile';
case ecl = 'ecl';
case elixir = 'elixir';
case flow9 = 'flow9';
case fsharp = 'fsharp';
case go = 'go';
case graphql = 'graphql';
case handlebars = 'handlebars';
case hcl = 'hcl';
case html = 'html';
case ini = 'ini';
case java = 'java';
case javascript = 'javascript';
case julia = 'julia';
case kotlin = 'kotlin';
case less = 'less';
case lexon = 'lexon';
case lua = 'lua';
case liquid = 'liquid';
case m3 = 'm3';
case markdown = 'markdown';
case mdx = 'mdx';
case mips = 'mips';
case msdax = 'msdax';
case mysql = 'mysql';
case objectivec = 'objective-c';
case pascal = 'pascal';
case pascaligo = 'pascaligo';
case perl = 'perl';
case pgsql = 'pgsql';
case php = 'php';
case pla = 'pla';
case postiats = 'postiats';
case powerquery = 'powerquery';
case powershell = 'powershell';
case proto = 'proto';
case pug = 'pug';
case python = 'python';
case qsharp = 'qsharp';
case r = 'r';
case razor = 'razor';
case redis = 'redis';
case redshift = 'redshift';
case restructuredtext = 'restructuredtext';
case ruby = 'ruby';
case rust = 'rust';
case sb = 'sb';
case scala = 'scala';
case scheme = 'scheme';
case scss = 'scss';
case shell = 'shell';
case sol = 'sol';
case aes = 'aes';
case sparql = 'sparql';
case sql = 'sql';
case st = 'st';
case swift = 'swift';
case systemverilog = 'systemverilog';
case verilog = 'verilog';
case tcl = 'tcl';
case twig = 'twig';
case typescript = 'typescript';
case typespec = 'typespec';
case vb = 'vb';
case wgsl = 'wgsl';
case xml = 'xml';
case yaml = 'yaml';
case json = 'json';

public function getLabel(): ?string
{
return $this->name;
}
}
28 changes: 28 additions & 0 deletions app/Filament/App/Resources/ServerResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Filament\App\Resources;

use App\Filament\App\Resources\ServerResource\Pages;
use App\Models\Server;
use Filament\Resources\Resource;

class ServerResource extends Resource
{
protected static ?string $model = Server::class;

protected static ?string $slug = '/';

protected static bool $shouldRegisterNavigation = false;

public static function canAccess(): bool
{
return true;
}

public static function getPages(): array
{
return [
'index' => Pages\ListServers::route('/'),
];
}
}
99 changes: 99 additions & 0 deletions app/Filament/App/Resources/ServerResource/Pages/ListServers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?php

namespace App\Filament\App\Resources\ServerResource\Pages;

use App\Filament\App\Resources\ServerResource;
use App\Filament\Server\Pages\Console;
use App\Models\Server;
use App\Tables\Columns\ServerEntryColumn;
use Carbon\CarbonInterface;
use Filament\Resources\Pages\ListRecords;
use Filament\Tables\Columns\Layout\Stack;
use Filament\Tables\Table;
use Illuminate\Support\Number;

class ListServers extends ListRecords
{
protected static string $resource = ServerResource::class;

public function table(Table $table): Table
{
return $table
->paginated(false)
->query(fn () => auth()->user()->can('viewList server') ? Server::query() : auth()->user()->accessibleServers())
->columns([
Stack::make([
ServerEntryColumn::make('server_entry')
->searchable(['name']),
]),
])
->contentGrid([
'default' => 1,
'xl' => 2,
])
->recordUrl(fn (Server $server) => Console::getUrl(panel: 'server', tenant: $server))
->emptyStateIcon('tabler-brand-docker')
->emptyStateDescription('')
->emptyStateHeading('You don\'t have access to any servers!');
}

// @phpstan-ignore-next-line
private function uptime(Server $server): string
{
$uptime = collect(cache()->get("servers.{$server->id}.uptime"))->last() ?? 0;

if ($uptime === 0) {
return 'Offline';
}

return now()->subMillis($uptime)->diffForHumans(syntax: CarbonInterface::DIFF_ABSOLUTE, short: true, parts: 2);
}

// @phpstan-ignore-next-line
private function cpu(Server $server): string
{
$cpu = Number::format(collect(cache()->get("servers.{$server->id}.cpu_absolute"))->last() ?? 0, maxPrecision: 2, locale: auth()->user()->language) . '%';
$max = Number::format($server->cpu, locale: auth()->user()->language) . '%';

return $cpu . ($server->cpu > 0 ? ' Of ' . $max : '');
}

// @phpstan-ignore-next-line
private function memory(Server $server): string
{
$latestMemoryUsed = collect(cache()->get("servers.{$server->id}.memory_bytes"))->last() ?? 0;
$totalMemory = collect(cache()->get("servers.{$server->id}.memory_limit_bytes"))->last() ?? 0;

$used = config('panel.use_binary_prefix')
? Number::format($latestMemoryUsed / 1024 / 1024 / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($latestMemoryUsed / 1000 / 1000 / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB';

if ($totalMemory === 0) {
$total = config('panel.use_binary_prefix')
? Number::format($server->memory / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($server->memory / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB';
} else {
$total = config('panel.use_binary_prefix')
? Number::format($totalMemory / 1024 / 1024 / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($totalMemory / 1000 / 1000 / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB';
}

return $used . ($server->memory > 0 ? ' Of ' . $total : '');
}

// @phpstan-ignore-next-line
private function disk(Server $server): string
{
$usedDisk = collect(cache()->get("servers.{$server->id}.disk_bytes"))->last() ?? 0;

$used = config('panel.use_binary_prefix')
? Number::format($usedDisk / 1024 / 1024 / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($usedDisk / 1000 / 1000 / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB';

$total = config('panel.use_binary_prefix')
? Number::format($server->disk / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($server->disk / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB';

return $used . ($server->disk > 0 ? ' Of ' . $total : '');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function form(Form $form): Form
Select::make('node_id')
->searchable()
->preload()
->unique()
->helperText('This setting only defaults to this database host when adding a database to a server on the selected node.')
->label('Linked Node')
->relationship('node', 'name'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function form(Form $form): Form
Select::make('node_id')
->searchable()
->preload()
->unique()
->helperText('This setting only defaults to this database host when adding a database to a server on the selected node.')
->label('Linked Node')
->relationship('node', 'name'),
Expand Down
14 changes: 5 additions & 9 deletions app/Filament/Resources/ServerResource/Pages/EditServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,23 +510,19 @@ public function form(Form $form): Form
->label('Startup Command')
->required()
->columnSpan(6)
->rows(function ($state) {
return str($state)->explode("\n")->reduce(
fn (int $carry, $line) => $carry + floor(strlen($line) / 125),
0
);
}),
->autosize(),

Textarea::make('defaultStartup')
->hintAction(CopyAction::make())
->label('Default Startup Command')
->disabled()
->autosize()
->columnSpan(6)
->formatStateUsing(function ($state, Get $get) {
$egg = Egg::query()->find($get('egg_id'));

return $egg->startup;
})
->columnSpan(6),
}),

Repeater::make('server_variables')
->relationship('serverVariables', function (Builder $query) {
Expand Down Expand Up @@ -799,7 +795,7 @@ protected function getHeaderActions(): array
->action(function (Server $server, ServerDeletionService $service) {
$service->handle($server);

return redirect(ListServers::getUrl());
return redirect(ListServers::getUrl(panel: 'admin'));
})
->authorize(fn (Server $server) => auth()->user()->can('delete server', $server)),
Actions\Action::make('console')
Expand Down
5 changes: 3 additions & 2 deletions app/Filament/Resources/ServerResource/Pages/ListServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Filament\Resources\ServerResource\Pages;

use App\Filament\Server\Pages\Console;
use App\Filament\Resources\ServerResource;
use App\Models\Server;
use Filament\Actions;
Expand Down Expand Up @@ -82,8 +83,8 @@ public function table(Table $table): Table
->actions([
Action::make('View')
->icon('tabler-terminal')
->url(fn (Server $server) => "/server/$server->uuid_short")
->authorize(fn () => auth()->user()->can('view server')),
->url(fn (Server $server) => Console::getUrl(panel: 'server', tenant: $server))
->authorize(fn (Server $server) => auth()->user()->canAccessTenant($server)),
EditAction::make(),
])
->emptyStateIcon('tabler-brand-docker')
Expand Down
23 changes: 21 additions & 2 deletions app/Filament/Resources/UserResource/Pages/EditProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Filament\Forms\Components\TextInput;
use Filament\Forms\Get;
use Filament\Notifications\Notification;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
Expand All @@ -47,6 +48,11 @@ public function boot(ToggleTwoFactorService $toggleTwoFactorService): void
$this->toggleTwoFactorService = $toggleTwoFactorService;
}

public function getMaxWidth(): MaxWidth|string
{
return MaxWidth::SevenExtraLarge;
}

protected function getForms(): array
{
return [
Expand Down Expand Up @@ -185,7 +191,7 @@ protected function getForms(): array
->content(fn () => new HtmlString("
<div style='width: 300px; background-color: rgb(24, 24, 27);'>$image</div>
"))
->helperText('Setup Key: '. $secret),
->helperText('Setup Key: ' . $secret),
TextInput::make('2facode')
->label('Code')
->requiredWith('2fapassword')
Expand Down Expand Up @@ -289,7 +295,7 @@ protected function handleRecordUpdate(Model $record, array $data): Model

if ($token = $data['2facode'] ?? null) {
$tokens = $this->toggleTwoFactorService->handle($record, $token, true);
cache()->set("users.$record->id.2fa.tokens", implode("\n", $tokens), now()->addSeconds(15));
cache(["users.$record->id.2fa.tokens" => implode("\n", $tokens)], now()->addSeconds(15));

$this->redirectRoute('filament.admin.auth.profile', ['tab' => '-2fa-tab']);
}
Expand Down Expand Up @@ -317,4 +323,17 @@ public function exception(Exception $e, Closure $stopPropagation): void
$stopPropagation();
}
}

protected function getFormActions(): array
{
return [];
}

protected function getHeaderActions(): array
{
return [
$this->getSaveFormAction()->formId('form'),
];

}
}
Loading
Loading