From 7edc1dcd0286bf9b5371db21d4b20be0d6cb2bdf Mon Sep 17 00:00:00 2001 From: Xinecraft Date: Sun, 22 Dec 2024 13:34:07 +0530 Subject: [PATCH] Server Intel bug fixes --- app/Http/Controllers/Admin/GraphController.php | 5 +++-- app/Http/Controllers/Admin/ServerIntelController.php | 5 +++++ .../js/Pages/Admin/CommandQueue/IndexCommandQueue.vue | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/GraphController.php b/app/Http/Controllers/Admin/GraphController.php index 9b7d6e4d9..8bc54054f 100644 --- a/app/Http/Controllers/Admin/GraphController.php +++ b/app/Http/Controllers/Admin/GraphController.php @@ -186,8 +186,9 @@ public function getNetworkTrendsMonthVsMonth() $averagePlayerPingChangePercent = (($averagePlayerPingCurrentMonth - $averagePlayerPingPreviousMonth) / ($averagePlayerPingPreviousMonth == 0 ? 1 : $averagePlayerPingPreviousMonth)) * 100; // Peek Online Players. - $peekOnlinePlayersPreviousMonth = MinecraftServerLiveInfo::getOnlinePlayersCount(null, $previousMonth->startOfMonth(), $previousMonth->endOfMonth()) ?? 0; - $peekOnlinePlayersCurrentMonth = MinecraftServerLiveInfo::getOnlinePlayersCount(null, $currentMonth->startOfMonth(), $currentMonth->endOfMonth()) ?? 0; + $serverIds = Server::where('type', '!=', ServerType::Bungee())->pluck('id'); + $peekOnlinePlayersPreviousMonth = MinecraftServerLiveInfo::getOnlinePlayersCount($serverIds, $previousMonth->startOfMonth(), $previousMonth->endOfMonth()) ?? 0; + $peekOnlinePlayersCurrentMonth = MinecraftServerLiveInfo::getOnlinePlayersCount($serverIds, $currentMonth->startOfMonth(), $currentMonth->endOfMonth()) ?? 0; $peekOnlinePlayersChangePercent = (($peekOnlinePlayersCurrentMonth - $peekOnlinePlayersPreviousMonth) / ($peekOnlinePlayersPreviousMonth == 0 ? 1 : $peekOnlinePlayersPreviousMonth)) * 100; return [ diff --git a/app/Http/Controllers/Admin/ServerIntelController.php b/app/Http/Controllers/Admin/ServerIntelController.php index 38ab3636d..8031b657c 100644 --- a/app/Http/Controllers/Admin/ServerIntelController.php +++ b/app/Http/Controllers/Admin/ServerIntelController.php @@ -41,6 +41,11 @@ public function overview(Request $request) ->get()->pluck('name', 'id'); $selectedServers = $request->query('servers') ?? null; // list of selected server ids + if ($selectedServers) { + $selectedServers = Server::where('type', '!=', ServerType::Bungee())->whereIn('id', $selectedServers)->pluck('id'); + } else { + $selectedServers = Server::where('type', '!=', ServerType::Bungee())->pluck('id'); + } /** * Start: LAST 7 DAYS STATS diff --git a/resources/default/js/Pages/Admin/CommandQueue/IndexCommandQueue.vue b/resources/default/js/Pages/Admin/CommandQueue/IndexCommandQueue.vue index af3e44862..f09341398 100644 --- a/resources/default/js/Pages/Admin/CommandQueue/IndexCommandQueue.vue +++ b/resources/default/js/Pages/Admin/CommandQueue/IndexCommandQueue.vue @@ -285,9 +285,12 @@ const showDetails = (commandQueue) => {

{{ __("Command ID") }}

-

+

{{ selectedCommandQueue.command_id }}

+

+ {{ __("none") }} +