mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
add filament dashboard
This commit is contained in:
@@ -30,7 +30,7 @@ class LatestTorrents extends BaseWidget
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
Tables\Columns\TextColumn::make('name')->limit(40),
|
||||
Tables\Columns\TextColumn::make('name')->limit(30),
|
||||
Tables\Columns\TextColumn::make('user.username'),
|
||||
Tables\Columns\TextColumn::make('size')->formatStateUsing(fn ($state) => mksize($state)),
|
||||
Tables\Columns\TextColumn::make('added')->dateTime(),
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Custom\Widgets\StatTable;
|
||||
use App\Repositories\DashboardRepository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class SystemInfo extends StatTable
|
||||
{
|
||||
protected static ?int $sort = 1000;
|
||||
|
||||
protected function getHeader(): string
|
||||
{
|
||||
return nexus_trans('dashboard.system_info.page_title');
|
||||
}
|
||||
|
||||
protected function getTableRows(): array
|
||||
{
|
||||
$dashboardRep = new DashboardRepository();
|
||||
|
||||
return $dashboardRep->getSystemInfo();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Custom\Widgets\StatTable;
|
||||
use App\Repositories\DashboardRepository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class TorrentStat extends StatTable
|
||||
{
|
||||
protected static ?int $sort = 102;
|
||||
|
||||
protected function getHeader(): string
|
||||
{
|
||||
return nexus_trans('dashboard.torrent.page_title');
|
||||
}
|
||||
|
||||
protected function getTableRows(): array
|
||||
{
|
||||
$dashboardRep = new DashboardRepository();
|
||||
|
||||
return $dashboardRep->statTorrents();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Custom\Widgets\StatTable;
|
||||
use App\Repositories\DashboardRepository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class UserClassStat extends StatTable
|
||||
{
|
||||
protected static ?int $sort = 101;
|
||||
|
||||
protected function getHeader(): string
|
||||
{
|
||||
return nexus_trans('dashboard.user_class.page_title');
|
||||
}
|
||||
|
||||
protected function getTableRows(): array
|
||||
{
|
||||
$dashboardRep = new DashboardRepository();
|
||||
|
||||
return $dashboardRep->statUserClass();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Custom\Widgets\StatTable;
|
||||
use App\Repositories\DashboardRepository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class UserStat extends StatTable
|
||||
{
|
||||
protected static ?int $sort = 100;
|
||||
|
||||
protected function getHeader(): string
|
||||
{
|
||||
return nexus_trans('dashboard.user.page_title');
|
||||
}
|
||||
|
||||
protected function getTableRows(): array
|
||||
{
|
||||
$dashboardRep = new DashboardRepository();
|
||||
|
||||
return $dashboardRep->statUsers();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user