diff --git a/Plan/react/dashboard/src/App.js b/Plan/react/dashboard/src/App.js index 9e99527f1..66107f0eb 100644 --- a/Plan/react/dashboard/src/App.js +++ b/Plan/react/dashboard/src/App.js @@ -40,6 +40,7 @@ const NetworkServers = React.lazy(() => import("./views/network/NetworkServers") const NetworkSessions = React.lazy(() => import("./views/network/NetworkSessions")); const NetworkJoinAddresses = React.lazy(() => import("./views/network/NetworkJoinAddresses")); const NetworkGeolocations = React.lazy(() => import("./views/network/NetworkGeolocations")); +const NetworkPlayerbaseOverview = React.lazy(() => import("./views/network/NetworkPlayerbaseOverview")); const PlayersPage = React.lazy(() => import("./views/layout/PlayersPage")); const AllPlayers = React.lazy(() => import("./views/players/AllPlayers")); @@ -123,6 +124,7 @@ function App() { }/> }/> }/> + }/> }/> }/> }/> diff --git a/Plan/react/dashboard/src/components/cards/server/graphs/CurrentPlayerbaseCard.js b/Plan/react/dashboard/src/components/cards/server/graphs/CurrentPlayerbaseCard.js index bfb80c113..897805e18 100644 --- a/Plan/react/dashboard/src/components/cards/server/graphs/CurrentPlayerbaseCard.js +++ b/Plan/react/dashboard/src/components/cards/server/graphs/CurrentPlayerbaseCard.js @@ -1,5 +1,4 @@ import React from "react"; -import {useParams} from "react-router-dom"; import {useDataRequest} from "../../../../hooks/dataFetchHook"; import {fetchPlayerbaseDevelopmentGraph} from "../../../../service/serverService"; import {ErrorViewCard} from "../../../../views/ErrorView"; @@ -10,9 +9,8 @@ import {faUsers} from "@fortawesome/free-solid-svg-icons"; import {CardLoader} from "../../../navigation/Loader"; import GroupVisualizer from "../../../graphs/GroupVisualizer"; -const CurrentPlayerbaseCard = () => { +const CurrentPlayerbaseCard = ({identifier}) => { const {t} = useTranslation(); - const {identifier} = useParams(); const {data, loadingError} = useDataRequest(fetchPlayerbaseDevelopmentGraph, [identifier]); diff --git a/Plan/react/dashboard/src/components/cards/server/graphs/PlayerbaseDevelopmentCard.js b/Plan/react/dashboard/src/components/cards/server/graphs/PlayerbaseDevelopmentCard.js index edf74022b..9f114ca02 100644 --- a/Plan/react/dashboard/src/components/cards/server/graphs/PlayerbaseDevelopmentCard.js +++ b/Plan/react/dashboard/src/components/cards/server/graphs/PlayerbaseDevelopmentCard.js @@ -1,5 +1,4 @@ import {useTranslation} from "react-i18next"; -import {useParams} from "react-router-dom"; import {useDataRequest} from "../../../../hooks/dataFetchHook"; import {fetchPlayerbaseDevelopmentGraph} from "../../../../service/serverService"; import {ErrorViewCard} from "../../../../views/ErrorView"; @@ -10,9 +9,8 @@ import React from "react"; import PlayerbaseGraph from "../../../graphs/PlayerbaseGraph"; import {CardLoader} from "../../../navigation/Loader"; -const PlayerbaseDevelopmentCard = () => { +const PlayerbaseDevelopmentCard = ({identifier}) => { const {t} = useTranslation(); - const {identifier} = useParams(); const {data, loadingError} = useDataRequest( fetchPlayerbaseDevelopmentGraph, diff --git a/Plan/react/dashboard/src/service/networkService.js b/Plan/react/dashboard/src/service/networkService.js index 6fcefb720..6545b721d 100644 --- a/Plan/react/dashboard/src/service/networkService.js +++ b/Plan/react/dashboard/src/service/networkService.js @@ -20,6 +20,11 @@ export const fetchNetworkSessionsOverview = async (timestamp) => { return doGetRequest(url); } +export const fetchNetworkPlayerbaseOverview = async (timestamp) => { + const url = `/v1/network/playerbaseOverview?timestamp=${timestamp}`; + return doGetRequest(url); +} + export const fetchNetworkPingTable = async (timestamp) => { const url = `/v1/network/pingTable?timestamp=${timestamp}`; return doGetRequest(url); diff --git a/Plan/react/dashboard/src/views/network/NetworkGeolocations.js b/Plan/react/dashboard/src/views/network/NetworkGeolocations.js index 29a9b9a46..0b6bb884a 100644 --- a/Plan/react/dashboard/src/views/network/NetworkGeolocations.js +++ b/Plan/react/dashboard/src/views/network/NetworkGeolocations.js @@ -9,7 +9,7 @@ const NetworkGeolocations = () => { const {data: pingData, loadingError: pingLoadingError} = useDataRequest(fetchNetworkPingTable, []); return ( - diff --git a/Plan/react/dashboard/src/views/network/NetworkPlayerbaseOverview.js b/Plan/react/dashboard/src/views/network/NetworkPlayerbaseOverview.js new file mode 100644 index 000000000..e76fd104f --- /dev/null +++ b/Plan/react/dashboard/src/views/network/NetworkPlayerbaseOverview.js @@ -0,0 +1,42 @@ +import {Col, Row} from "react-bootstrap-v5"; +import React from "react"; +import PlayerbaseDevelopmentCard from "../../components/cards/server/graphs/PlayerbaseDevelopmentCard"; +import CurrentPlayerbaseCard from "../../components/cards/server/graphs/CurrentPlayerbaseCard"; +import {useDataRequest} from "../../hooks/dataFetchHook"; +import {ErrorViewCard} from "../ErrorView"; +import PlayerbaseTrendsCard from "../../components/cards/server/tables/PlayerbaseTrendsCard"; +import PlayerbaseInsightsCard from "../../components/cards/server/insights/PlayerbaseInsightsCard"; +import LoadIn from "../../components/animation/LoadIn"; +import {fetchNetworkPlayerbaseOverview} from "../../service/networkService"; + +const NetworkPlayerbaseOverview = () => { + const {data, loadingError} = useDataRequest(fetchNetworkPlayerbaseOverview, []); + + return ( + +
+ + + + + + + + + + {loadingError && } + {!loadingError && <> + + + + + + + } + +
+
+ ) +} + +export default NetworkPlayerbaseOverview; \ No newline at end of file diff --git a/Plan/react/dashboard/src/views/server/PlayerbaseOverview.js b/Plan/react/dashboard/src/views/server/PlayerbaseOverview.js index 75c7b3ebb..6d5729c2f 100644 --- a/Plan/react/dashboard/src/views/server/PlayerbaseOverview.js +++ b/Plan/react/dashboard/src/views/server/PlayerbaseOverview.js @@ -20,10 +20,10 @@ const PlayerbaseOverview = () => {
- + - +