This commit is contained in:
Bozhidar 2024-05-15 14:21:12 +03:00
parent bbbd857ca6
commit b666366a22
6 changed files with 271 additions and 7 deletions

View file

@ -0,0 +1,236 @@
<?php
namespace App\Filament\Pages;
use Filament\Pages\Page;
class Settings extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-cog';
protected static string $view = 'filament.pages.settings';
protected static ?string $navigationGroup = 'Server Management';
protected static ?int $navigationSort = 4;
protected function getViewData(): array
{
$links = [
'Security'=>[
'title'=>'Security',
'icon'=>'heroicon-o-lock-closed',
'links' =>[
[
'title'=>'Users',
'icon'=>'heroicon-o-user',
'url'=> route('filament.admin.resources.users.index')
],
[
'title'=>'API Tokens',
'icon'=>'heroicon-o-key',
'url'=> route('filament.admin.resources.api-keys.index')
],
]
],
'Assistance and Troubleshooting'=>[
'title'=>'Assistance and Troubleshooting',
'icon'=>'heroicon-o-lifebuoy',
'links' =>[
[
'title'=>'Logs',
'icon'=>'heroicon-o-clipboard-list',
'url'=> ''
],
[
'title'=>'Support',
'icon'=>'heroicon-o-chat-alt',
'url'=>''
],
]
],
'Tools & Resources'=>[
'title'=>'Tools & Resources',
'icon'=>'heroicon-o-cog',
'links' =>[
[
'title'=>'File Manager',
'icon'=>'heroicon-o-folder',
'url'=> ''
],
[
'title'=>'Database Manager',
'icon'=>'heroicon-o-database',
'url'=>''
],
[
'title'=>'Task Scheduler',
'icon'=>'heroicon-o-clock',
'url'=>''
],
[
'title'=>'Cron Jobs',
'icon'=>'heroicon-o-clock',
'url'=>''
],
[
'title'=>'PHP Info',
'icon'=>'heroicon-o-information-circle',
'url'=>''
],
]
],
'General Settings'=>[
'title'=>'General Settings',
'icon'=>'heroicon-o-cog',
'links' =>[
[
'title'=>'Site Settings',
'icon'=>'heroicon-o-cog',
'url'=> ''
],
[
'title'=>'Appearance',
'icon'=>'heroicon-o-color-swatch',
'url'=>''
],
[
'title'=>'Email Settings',
'icon'=>'heroicon-o-mail',
'url'=>''
],
[
'title'=>'API Settings',
'icon'=>'heroicon-o-key',
'url'=>''
],
[
'title'=>'Backup Settings',
'icon'=>'heroicon-o-cloud-upload',
'url'=>''
],
[
'title'=>'Update Settings',
'icon'=>'heroicon-o-cloud-upload',
'url'=>''
],
]
],
'Server Management'=>[
'title'=>'Server Management',
'icon'=>'heroicon-o-server',
'links'=> [
[
'title'=>'Server Information',
'icon'=>'heroicon-o-information-circle',
'url'=> ''
],
[
'title'=>'Server Status',
'icon'=>'heroicon-o-check-circle',
'url'=>''
],
[
'title'=>'Server Resources',
'icon'=>'heroicon-o-chart-pie',
'url'=>''
],
[
'title'=>'Server Logs',
'icon'=>'heroicon-o-clipboard-list',
'url'=>''
],
[
'title'=>'Server Updates',
'icon'=>'heroicon-o-cloud-upload',
'url'=>''
],
]
],
'Statistics'=> [
'title'=>'Statistics',
'icon'=>'heroicon-o-chart-bar',
'links'=> [
[
'title'=>'Server Statistics',
'icon'=>'heroicon-o-chart-bar',
'url'=> ''
],
[
'title'=>'User Statistics',
'icon'=>'heroicon-o-chart-bar',
'url'=>''
],
]
],
'Mail'=> [
'title'=>'Mail',
'icon'=>'heroicon-o-envelope',
'links'=> [
[
'title'=>'Mail Settings',
'icon'=>'heroicon-o-cog',
'url'=> ''
],
[
'title'=>'Mail Logs',
'icon'=>'heroicon-o-clipboard-list',
'url'=>''
],
]
],
'Applications & Databases'=>[
'title'=>'Applications & Databases',
'icon'=>'heroicon-o-cube',
'links'=> [
[
'title'=>'Applications',
'icon'=>'heroicon-o-cube',
'url'=> ''
],
[
'title'=>'Databases',
'icon'=>'heroicon-o-database',
'url'=>''
],
]
],
'Phyre'=> [
'title'=>'Phyre',
'icon'=>'heroicon-o-fire',
'links'=> [
[
'title'=>'Phyre Settings',
'icon'=>'heroicon-o-cog',
'url'=> ''
],
[
'title'=>'Phyre Logs',
'icon'=>'heroicon-o-clipboard-list',
'url'=>''
],
]
],
'Phyre Apperance'=> [
'title'=>'Phyre Apperance',
'icon'=>'heroicon-o-paint-brush',
'links'=> [
[
'title'=>'Phyre Theme',
'icon'=>'heroicon-o-color-swatch',
'url'=> ''
],
[
'title'=>'Phyre Logo',
'icon'=>'heroicon-o-photograph',
'url'=>''
],
]
]
];
return [
'linkGroups' => $links
];
}
}

View file

@ -17,11 +17,10 @@ use Monarobase\CountryList\CountryList;
use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;
use Symfony\Component\Console\Input\Input;
class Settings extends BaseSettings
class General extends BaseSettings
{
protected static ?string $navigationGroup = 'Server Management';
protected static ?int $navigationSort = 4;
protected static bool $shouldRegisterNavigation = false;
public function save() : void
{

View file

@ -1,6 +1,6 @@
<?php
namespace app\Filament\Pages;
namespace App\Filament\Pages;
use Filament\Pages\Page;

View file

@ -25,7 +25,7 @@ class HostingSubscriptionResource extends Resource
{
protected static ?string $model = HostingSubscription::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationIcon = 'heroicon-o-star';
protected static ?string $navigationGroup = 'Hosting Services';

View file

@ -2,7 +2,7 @@
namespace App\Providers\Filament;
use App\Filament\Pages\Settings\Settings;
use App\Filament\Pages\Settings\General;
use App\Filament\Widgets\CustomersCount;
use App\Filament\Widgets\ServerDiskUsageStatistic;
use App\Filament\Widgets\ServerMemoryStatistic;
@ -72,7 +72,7 @@ class AdminPanelProvider extends PanelProvider
// FilamentAuthenticationLogPlugin::make(),
FilamentApexChartsPlugin::make(),
FilamentSettingsPlugin::make()->pages([
Settings::class,
General::class,
]),
])
// ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')

View file

@ -0,0 +1,29 @@
<x-filament-panels::page>
<div class="grid grid-cols-3 gap-4 gap-y-6">
@foreach($linkGroups as $group)
<div>
<div class="flex gap-2 items-center">
<x-filament::icon-button size="xl" icon="{{$group['icon']}}" />
<div class="text-primary-500 text-xl">
{{ $group['title'] }}
</div>
</div>
<div class="pl-[2.1rem] mt-2">
<ul class="">
@foreach($group['links'] as $link)
<li>
<a class="" href="#">
{{$link['title']}}
</a>
</li>
@endforeach
</ul>
</div>
</div>
@endforeach
</div>
</x-filament-panels::page>