feat: add game server monitoring support

- Added a new `/games` route in `monitorRoute.js` to fetch all supported games.
- Implemented `getAllGames` method in `monitorController.js` using the `gamedig` library.
- Introduced `useFetchMonitorGames` hook in `monitorHooks.js` to fetch game data in the frontend.
- Updated `UptimeCreate` page to support game server monitoring:
  - Added a new monitor type `"game"`.
  - Dynamically fetches and displays game options using the new `/games` API.
- Removed hardcoded `GAMES` object and replaced it with dynamic fetching from the backend.
- Updated `NetworkService.js` with a new `getMonitorGames` method for API calls.

This update introduces game server monitoring functionality, allowing users to monitor game servers dynamically.
This commit is contained in:
Burak Arslan committed 2025-08-03 13:19:55 +03:00
1 parent b53650a50f
commit 281cbbc30f
6 files changed
+67 -3455

No files matched your search

@@ -15,6 +15,7 @@ import {
import sslChecker from "ssl-checker";
import { fetchMonitorCertificate } from "./controllerUtils.js";
import BaseController from "./baseController.js";
import { games } from "gamedig";
const SERVICE_NAME = "monitorController";
class MonitorController extends BaseController {
@@ -441,6 +442,17 @@ class MonitorController extends BaseController {
SERVICE_NAME,
"exportMonitorsToCSV"
);
getAllGames = this.asyncHandler(
async (req, res) => {
return res.success({
msg: "OK",
data: games,
});
},
SERVICE_NAME,
"getAllGames"
);
}
export default MonitorController;