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 45 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
74 changes: 74 additions & 0 deletions app/Filament/App/Pages/Console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

namespace App\Filament\App\Pages;

use Filament\Actions\Action;
use Filament\Facades\Filament;
use Filament\Pages\Page;

class Console extends Page
{
protected static ?string $navigationIcon = 'tabler-brand-tabler';

protected static string $view = 'filament.app.pages.console';

public array $history = [];
public int $historyIndex = 0;
public string $input = '';

protected function getViewData(): array
{
return [
'server' => Filament::getTenant(),
'user' => auth()->user(),
];
}

protected function getHeaderActions(): array
{
return [
Action::make('start')
->color('primary')
->action(fn () => $this->dispatch('setServerState', state: 'start')),

Action::make('restart')
->color('gray')
->action(fn () => $this->dispatch('setServerState', state: 'restart')),

Action::make('stop')
->color('danger')
->action(fn () => $this->dispatch('setServerState', state: 'stop')),
];
}

public function up()
{
$this->historyIndex = min($this->historyIndex + 1, count($this->history) - 1);

// e.currentTarget.value = history![newIndex] || '';
//
// // By default up arrow will also bring the cursor to the start of the line, so we'll preventDefault to keep it at the end.
// e.preventDefault();
}

public function down()
{
$this->historyIndex = max($this->historyIndex - 1, -1);

// e.currentTarget.value = history![newIndex] || '';
}

public function enter()
{
$this->dispatch('sendServerCommand', command: $this->input);

$this->input = '';

// setHistory((prevHistory) => [command, ...prevHistory!].slice(0, 32));
// setHistoryIndex(-1);
//
// instance && instance.send('send command', command);
// e.currentTarget.value = '';
}

}
51 changes: 51 additions & 0 deletions app/Filament/App/Pages/Dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Filament\App\Pages;

use Filament\Facades\Filament;
use Filament\Pages\Page;
use Illuminate\Contracts\Support\Htmlable;

class Dashboard extends Page
{
protected static string $routePath = '/';

protected static ?int $navigationSort = -2;

protected static string $view = 'filament-panels::pages.dashboard';

public static function getNavigationLabel(): string
{
return 'Dashboard';
}

public static function getNavigationIcon(): string|Htmlable|null
{
return 'tabler-home';
}

public static function getRoutePath(): string
{
return static::$routePath;
}

public function getWidgets(): array
{
return Filament::getWidgets();
}

public function getVisibleWidgets(): array
{
return $this->filterVisibleWidgets($this->getWidgets());
}

public function getColumns(): int|string|array
{
return 2;
}

public function getTitle(): string|Htmlable
{
return 'Welcome, '. auth()->user()->username;
}
}
25 changes: 25 additions & 0 deletions app/Filament/App/Resources/ActivityResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Filament\App\Resources;

use App\Filament\App\Resources\ActivityResource\Pages;
use App\Models\ActivityLog;
use Filament\Resources\Resource;

class ActivityResource extends Resource
{
protected static ?string $model = ActivityLog::class;

protected static ?string $navigationIcon = 'tabler-stack';

protected static ?string $tenantOwnershipRelationshipName = 'actor';

protected static ?string $tenantRelationshipName = 'activity';

public static function getPages(): array
{
return [
'index' => Pages\ListActivities::route('/'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace App\Filament\App\Resources\ActivityResource\Pages;

use App\Filament\App\Resources\ActivityResource;
use App\Models\ActivityLog;
use App\Models\User;
use Filament\Resources\Pages\ListRecords;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class ListActivities extends ListRecords
{
protected static string $resource = ActivityResource::class;

public function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('event')
->formatStateUsing(fn ($state, ActivityLog $activityLog) => __('activity.'.str($activityLog->event)->replace(':', '.'), $activityLog->properties?->toArray() ?? []))
->description(fn ($state) => $state),
TextColumn::make('user')
->state(fn (ActivityLog $activityLog) => $activityLog->actor instanceof User ? $activityLog->actor->username : 'System')
->url(fn (ActivityLog $activityLog): string => $activityLog->actor instanceof User ? route('filament.admin.resources.users.edit', ['record' => $activityLog->actor]) : ''),
TextColumn::make('timestamp')
->sortable()
->formatStateUsing(fn ($state) => $state->diffForHumans()),
]);
}
}
23 changes: 23 additions & 0 deletions app/Filament/App/Resources/BackupResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App\Filament\App\Resources;

use App\Filament\App\Resources\BackupResource\Pages;
use App\Models\Backup;
use Filament\Resources\Resource;

class BackupResource extends Resource
{
protected static ?string $model = Backup::class;

protected static bool $canCreateAnother = false;

protected static ?string $navigationIcon = 'tabler-download';

public static function getPages(): array
{
return [
'index' => Pages\ListBackups::route('/'),
];
}
}
Loading
Loading