pschilly / filament-dcs-server-stats
This package is a series of widgets, pages and panels for Filament PHP and is loaded as a plugin. It interfaces with the DCS Server Bot API by Special-K to obtain statistics gathered from managed Digital Combat Simulator (DCS) servers.
Fund package maintenance!
pschilly
Requires
- php: ^8.2
- codeat3/blade-phosphor-icons: ^2.3
- codeat3/blade-rpg-awesome-icons: ^1.6
- filament/filament: ^4.0
- livewire/livewire: *
- pschilly/dcs-server-bot-api: ^0.3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- pestphp/pest-plugin-livewire: ^3.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
README
This package is a series of widgets and pages for Filament PHP and is loaded as a plugin. It interfaces with the DCS Server Bot by Special-K via the Laravel Package DCS Server Bot API to obtain statistics gathered from managed Digital Combat Simulator (DCS) servers.
Installation
You can install the package via composer:
composer require pschilly/filament-dcs-server-stats
Important
If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
@source '../../../../vendor/pschilly/filament-dcs-server-stats/resources/**/*.blade.php';
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-dcs-server-stats-views"
Usage
Enable the plugin on your panel of choice:
$panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ])
Configuration
By default, this plugin assumes you want everything and has everything turned on. So if you pass no variables at all - that is what you will get.
Referencing below, change what suits you best - I would also encourage you to use some sort of DB based config system to make this a more user friendly experience but I will leave that up to you.
Server Selector
The server selector is enabled by default, however, if you wish to disable it you may do so as follows:
use Pschilly\FilamentDcsServerStats\Pages as DCSServerBotPages; $panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ->serverSelector(false) ]);
Pages
By default, all pages will be registered. If you wish to disable some of them, pass an array of pages as follows:
use Pschilly\FilamentDcsServerStats\Pages as DCSServerBotPages; $panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ->pages([ DCSServerBotPages\Leaderboard::class, DCSServerBotPages\PlayerStats::class, DCSServerBotPages\Squadrons::class, // Requires that you have the `squadrons` feature enabled within the DCS Server Bot DCSServerBotPages\Servers::class, ]); ])
Dashboard & Dashboard Widgets
By default, the Dashboard for the Filament Panel that you have enabled the plugin on will be overwritten by the included one with all widgets available. If you wish to change this, configure as follows:
use Pschilly\FilamentDcsServerStats\Widgets as DCSServerBotDashboardWidgets; $panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ->dashboard(false) // Will disable the included dashboard - note, the following will also not funciton if you do so. ->dashboardWidgets([ DCSServerBotDashboardWidgets\ServerStatistics::class, DCSServerBotDashboardWidgets\DailyPlayersChart::class, DCSServerBotDashboardWidgets\TopPilots::class, DCSServerBotDashboardWidgets\TopSquadrons::class, // Requires that you have the `squadrons` and `credits` features enabled within the DCS Server Bot ]); ])
Note
The order that you put the widgets in the array will dictate the order that they appear on the page.
Leaderboard Columns
By default, the Leaderboard will show all columns - if you want to change this behaviour, configure as follows:
Note
No matter what you provide, the bare minimum displayed will be: Ranking, Callsign & Kills so as to not entirely break the page.
$panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ->leaderboardColumns([ 'deaths', 'kdr', 'credits', 'playtime' ]); ])
Note
The order that you put the columns in the array will dictate the order that they appear on the page.
Player Stats Widgets
By default, the Player Stats page will show all widgets - if you want to change this behaviour, configure as follows:
use Pschilly\FilamentDcsServerStats\Widgets\PlayerStats as DCSServerBotPlayerStatsWidgets; $panel ->plugins([ \Pschilly\FilamentDcsServerStats\FilamentDcsServerStatsPlugin::make() ->playerStatsWidgets([ DCSServerBotPlayerStatsWidgets\CombatChart::class, DCSServerBotPlayerStatsWidgets\ModuleChart::class, DCSServerBotPlayerStatsWidgets\PveChart::class, DCSServerBotPlayerStatsWidgets\PvpChart::class, DCSServerBotPlayerStatsWidgets\SortieChart::class ]); ])
Note
The order that you put the widgets in the array will dictate the order that they appear on the page.
Squadrons & Servers
At present, there are no configuration values for these pages. What you see is what you get.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.