diff --git a/src/app/server/[server]/historical-data/page.tsx b/src/app/server/[server]/short-term/page.tsx similarity index 97% rename from src/app/server/[server]/historical-data/page.tsx rename to src/app/server/[server]/short-term/page.tsx index 515a071..38b1d5e 100644 --- a/src/app/server/[server]/historical-data/page.tsx +++ b/src/app/server/[server]/short-term/page.tsx @@ -14,7 +14,6 @@ import { IconDisplayClient } from "@/components/IconDisplay"; import { banner } from "@/banner"; import Link from "next/link"; import TabServer from "@/components/misc/TabServer"; -import { ChartComponent } from "@/components/Chart"; import { NewChart } from "@/components/NewChart"; type Props = { diff --git a/src/components/Chart.tsx b/src/components/Chart.tsx deleted file mode 100644 index abffcbd..0000000 --- a/src/components/Chart.tsx +++ /dev/null @@ -1,104 +0,0 @@ -"use client"; -import { TrendingUp } from "lucide-react"; -import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts"; - -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from "@/components/ui/card"; -import { - ChartConfig, - ChartContainer, - ChartTooltip, - ChartTooltipContent, -} from "@/components/ui/chart"; -import { useState } from "react"; -import { useEffectOnce } from "@/lib/useEffectOnce"; - -const chartConfig = { - player_count: { - label: "Player Count ", - color: "hsl(var(--chart-1))", - }, - favorites: { - label: "Favorites", - color: "hsl(var(--chart-2))", - }, -} satisfies ChartConfig; - -export function ChartComponent({ - chart, - server, -}: { - chart: string; - server: string; -}) { - const [data, setData] = useState([]); - - useEffectOnce(() => { - fetch("/api/history/getShortTermData", { - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - scopes: ["player_count", "favorites", "time"], - server: server, - }), - method: "POST", - }).then((c) => - c.json().then((b) => { - setData(b.data.slice(-30)); - }) - ); - }); - - return ( - - - - {chart == "player_count" ? "Joins" : "Favorites"} for {server} - - Information from the last day - - - - - - { - const date = new Date(value); - return date.toLocaleTimeString("en-US", { - timeStyle: "short", - }); - }} - /> - } /> - - - - - - - - ); -} diff --git a/src/components/misc/TabServer.tsx b/src/components/misc/TabServer.tsx index 853274e..19d50cd 100644 --- a/src/components/misc/TabServer.tsx +++ b/src/components/misc/TabServer.tsx @@ -22,14 +22,14 @@ export default function TabServer({ setTab(tac); setTabLoading(true); if (tac == "historical") - window.location.replace(`/server/${server}/historical-data`); + window.location.replace(`/server/${server}/short-term`); if (tac == "general") window.location.replace(`/server/${server}`); }} className="w-[300px]" > General Information - Historical Data + Short Term diff --git a/src/version.tsx b/src/version.tsx index c046b56..7dcf441 100644 --- a/src/version.tsx +++ b/src/version.tsx @@ -20,12 +20,15 @@ export const Changelog = () => (
- Version b-0.4 (July 24th 2024): + Version b-0.4 (July 25th 2024):