From b2e5b4862d1f8419b51bb947880c776871345578 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Thu, 11 Apr 2024 00:45:20 -0400 Subject: [PATCH] Add nice new intro page --- app/Filament/Pages/Introduction.php | 21 +++ .../filament/pages/introduction.blade.php | 163 ++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/app/Filament/Pages/Introduction.php b/app/Filament/Pages/Introduction.php index d32e4ef35..b60a4530f 100644 --- a/app/Filament/Pages/Introduction.php +++ b/app/Filament/Pages/Introduction.php @@ -2,6 +2,11 @@ namespace App\Filament\Pages; +use App\Filament\Resources\NodeResource\Pages\ListNodes; +use App\Models\Egg; +use App\Models\Node; +use App\Models\Server; +use App\Models\User; use Filament\Pages\Page; class Introduction extends Page @@ -9,4 +14,20 @@ class Introduction extends Page protected static ?string $navigationIcon = 'heroicon-o-document-text'; protected static string $view = 'filament.pages.introduction'; + + protected ?string $heading = ''; + + public string $activeTab = 'nodes'; + + public function getViewData(): array + { + return [ + 'inDevelopment' => config('app.version') === 'canary', + 'eggsCount' => Egg::query()->count(), + 'nodesList' => ListNodes::getUrl(), + 'nodesCount' => Node::query()->count(), + 'serversCount' => Server::query()->count(), + 'usersCount' => User::query()->count(), + ]; + } } diff --git a/resources/views/filament/pages/introduction.blade.php b/resources/views/filament/pages/introduction.blade.php index cc6147795..eb68925ff 100644 --- a/resources/views/filament/pages/introduction.blade.php +++ b/resources/views/filament/pages/introduction.blade.php @@ -1,3 +1,166 @@ + + Panel's Resources: + + + Nodes + {{ $nodesCount }} + + + + Servers + {{ $serversCount }} + + + + Eggs + {{ $eggsCount }} + + + + Users + {{ $usersCount }} + + + + + +

You can expand the following sections:

+ + @if ($inDevelopment) + + Information for Developers + +

Thank you for trying out the development version!

+ +

+
+ If you run into any issues, please report them on GitHub. +
+
+

+ +

+ + Report Issue on GitHub + +

+ +
+ @endif + + {{-- No Nodes Created --}} + @if ($nodesCount > 0) + + Create First New Node + +

It looks like you don't have any Nodes set up yet, but don't worry because you can follow along below:

+ +

+
+ If you run into any issues, please report them on GitHub. +
+
+

+ +

+ + Create Node in Pelican + +

+ +
+ @endif + + {{-- No Nodes Active --}} + + + + Support Pelican + +

Thank you for using Pelican, this could only be achieved through the support of you, our contributors, and the rest of our supporters!

+ +


+ +

We appreciate any and all support from anybody.

+ +


+ + + Donate Directly + + +
+ + + + + Need Help? + +

Check out the documentation first! If you still need assistance then, fly onto our Discord server!

+ +


+ + + Read Documentation + + + + Get Help in Discord + + +
+ +
+