mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00
wip
This commit is contained in:
parent
942ea99718
commit
b98ecd252c
@ -9,6 +9,7 @@ use App\Filament\Server\Pages\Console;
|
||||
use App\Models\Server;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Support\Enums\TextSize;
|
||||
use Filament\Tables\Columns\ColumnGroup;
|
||||
use Filament\Tables\Columns\Layout\Stack;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@ -33,6 +34,7 @@ class ListServers extends ListRecords
|
||||
->label('')
|
||||
->default('unknown')
|
||||
->wrap()
|
||||
->size(TextSize::Medium)
|
||||
->badge()
|
||||
->alignCenter()
|
||||
->tooltip(fn (Server $server) => $server->formatResource('uptime', type: ServerResourceType::Time))
|
||||
@ -43,11 +45,12 @@ class ListServers extends ListRecords
|
||||
$viewTwo = [
|
||||
TextColumn::make('name')
|
||||
->label('')
|
||||
->size('md')
|
||||
->size(TextSize::Medium)
|
||||
->searchable(),
|
||||
TextColumn::make('iNeedAName')
|
||||
->label('')
|
||||
->badge()
|
||||
->size(TextSize::Medium)
|
||||
->copyable(request()->isSecure())
|
||||
->copyMessage(fn (Server $server, string $state) => 'Copied ' . $server->allocation->address)
|
||||
->state(fn (Server $server) => $server->allocation->address),
|
||||
@ -56,18 +59,21 @@ class ListServers extends ListRecords
|
||||
$viewThree = [
|
||||
TextColumn::make('cpuUsage')
|
||||
->label('')
|
||||
->size(TextSize::Medium)
|
||||
->icon('tabler-cpu')
|
||||
->tooltip(fn (Server $server) => 'Usage Limit: ' . $server->formatResource('cpu', limit: true, type: ServerResourceType::Percentage, precision: 0))
|
||||
->state(fn (Server $server) => $server->formatResource('cpu_absolute', type: ServerResourceType::Percentage))
|
||||
->color(fn (Server $server) => $this->getResourceColor($server, 'cpu')),
|
||||
TextColumn::make('memoryUsage')
|
||||
->label('')
|
||||
->size(TextSize::Medium)
|
||||
->icon('tabler-memory')
|
||||
->tooltip(fn (Server $server) => 'Usage Limit: ' . $server->formatResource('memory', limit: true))
|
||||
->state(fn (Server $server) => $server->formatResource('memory_bytes'))
|
||||
->color(fn (Server $server) => $this->getResourceColor($server, 'memory')),
|
||||
TextColumn::make('diskUsage')
|
||||
->label('')
|
||||
->size(TextSize::Medium)
|
||||
->icon('tabler-device-floppy')
|
||||
->tooltip(fn (Server $server) => 'Usage Limit: ' . $server->formatResource('disk', limit: true))
|
||||
->state(fn (Server $server) => $server->formatResource('disk_bytes'))
|
||||
|
@ -15,8 +15,8 @@ use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Form;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@ -27,7 +27,10 @@ class Startup extends ServerFormPage
|
||||
|
||||
protected static ?int $navigationSort = 9;
|
||||
|
||||
public function form(Form|Schema $schema): Schema
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
/** @var Server $server */
|
||||
$server = Filament::getTenant();
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use App\Filament\Pages\Auth\Login;
|
||||
use App\Filament\Pages\Auth\EditProfile;
|
||||
use App\Filament\Pages\Auth\Login;
|
||||
use App\Http\Middleware\LanguageMiddleware;
|
||||
use App\Http\Middleware\RequireTwoFactorAuthentication;
|
||||
use Filament\Actions\Action;
|
||||
@ -30,7 +30,7 @@ class AdminPanelProvider extends PanelProvider
|
||||
->id('admin')
|
||||
->path('admin')
|
||||
->homeUrl('/')
|
||||
//->spa()
|
||||
->spa()
|
||||
->databaseNotifications()
|
||||
->breadcrumbs(false)
|
||||
->brandName(config('app.name', 'Pelican'))
|
||||
@ -40,11 +40,10 @@ class AdminPanelProvider extends PanelProvider
|
||||
->topNavigation(config('panel.filament.top-navigation', false))
|
||||
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
||||
->login(Login::class)
|
||||
->profile(EditProfile::class, false)
|
||||
->passwordReset()
|
||||
->userMenuItems([
|
||||
'profile' => Action::make('toProfile')
|
||||
->label(fn () => trans('filament-panels::/auth/pages/edit-profile.label'))
|
||||
->url(fn () => EditProfile::getUrl(panel: 'app')),
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username),
|
||||
Action::make('exitAdmin')
|
||||
->label(fn () => trans('profile.exit_admin'))
|
||||
->url('/')
|
||||
|
@ -27,7 +27,7 @@ class AppPanelProvider extends PanelProvider
|
||||
{
|
||||
return $panel
|
||||
->id('app')
|
||||
//->spa()
|
||||
->spa()
|
||||
->databaseNotifications()
|
||||
->breadcrumbs(false)
|
||||
->brandName(config('app.name', 'Pelican'))
|
||||
@ -41,6 +41,7 @@ class AppPanelProvider extends PanelProvider
|
||||
->login(Login::class)
|
||||
->passwordReset()
|
||||
->userMenuItems([
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username),
|
||||
Action::make('toAdmin')
|
||||
->label('Admin')
|
||||
->url('/admin')
|
||||
|
@ -3,9 +3,9 @@
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
|
||||
use App\Filament\Pages\Auth\EditProfile;
|
||||
use App\Filament\Pages\Auth\Login;
|
||||
use App\Filament\Admin\Resources\ServerResource\Pages\EditServer;
|
||||
use App\Filament\Pages\Auth\EditProfile;
|
||||
use App\Http\Middleware\Activity\ServerSubject;
|
||||
use App\Http\Middleware\LanguageMiddleware;
|
||||
use App\Http\Middleware\RequireTwoFactorAuthentication;
|
||||
@ -34,7 +34,7 @@ class ServerPanelProvider extends PanelProvider
|
||||
->id('server')
|
||||
->path('server')
|
||||
->homeUrl('/')
|
||||
//->spa()
|
||||
->spa()
|
||||
->databaseNotifications()
|
||||
->tenant(Server::class)
|
||||
->brandName(config('app.name', 'Pelican'))
|
||||
@ -44,11 +44,10 @@ class ServerPanelProvider extends PanelProvider
|
||||
->topNavigation(config('panel.filament.top-navigation', false))
|
||||
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
||||
->login(Login::class)
|
||||
->profile(EditProfile::class, false)
|
||||
->passwordReset()
|
||||
->userMenuItems([
|
||||
'profile' => Action::make('toProfile')
|
||||
->label(fn () => trans('filament-panels::/auth/pages/edit-profile.label'))
|
||||
->url(fn () => EditProfile::getUrl(panel: 'app')),
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username),
|
||||
Action::make('toServerList')
|
||||
->label('Server List')
|
||||
->icon('tabler-brand-docker')
|
||||
|
Loading…
x
Reference in New Issue
Block a user