Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
zizdlp committed Aug 13, 2024
1 parent 2051e7d commit d49460d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_ut
import { headers } from "next/headers";
import { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import AreaChart from "@/components/charts/AreaChart";
import AreaVisitorChart from "@/components/charts/AreaVisitorChart";
import AreaUserChart from "@/components/charts/AreaUserChart";
import { FetchError } from "@/fetchs/util";
import { logger } from "@/utils/logger";
Expand Down Expand Up @@ -123,7 +123,10 @@ export default async function AdminOverviewPage({
return (
<>
<div className="xl:col-span-3 md:col-span-2 col-span-1">
<AreaChart title={t("DailyVisitors")} label={t("NewVisitor")} />
<AreaVisitorChart
title={t("DailyVisitors")}
label={t("NewVisitor")}
/>
</div>
<div className="col-span-1 md:col-span-2">
<AreaUserChart
Expand Down
14 changes: 6 additions & 8 deletions zbook_frontend/src/components/charts/AreaUserChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ import { useEffect, useState } from "react";
import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth";
import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util";

interface WebTrafficProps {
allow_login: boolean;
allow_registration: boolean;
allow_invitation: boolean;
}

export default function AreaUserChart({
allow_login,
allow_registration,
allow_invitation,
}: WebTrafficProps) {
}: {
allow_login: boolean;
allow_registration: boolean;
allow_invitation: boolean;
}) {
const { theme } = useTheme();
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const [newUserCounts, setNewUserCounts] = useState<number[]>([]);
Expand All @@ -45,7 +43,7 @@ export default function AreaUserChart({
(_, i) => {
const date = new Date();
date.setDate(today.getDate() - i);
return date.toISOString().split("T")[0]; // 获取 YYYY-MM-DD 格式的日期
return date.toISOString().split("T")[0]; // YYYY-MM-DD format
}
).reverse();
setDates(generatedDates);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useEffect, useState } from "react";
import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth";
import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util";

export default function AreaChart({
export default function AreaVisitorChart({
title,
label,
}: {
Expand Down
1 change: 0 additions & 1 deletion zbook_frontend/src/components/charts/DonutChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default function DonuChart({
agentCounts.bot ?? 0,
agentCounts.unknown ?? 0,
];
console.log("series:", series);
return (
<div className="w-full h-[400px] bg-gray-50 dark:bg-slate-800/50 dark:shadow-lg rounded-md p-4 md:p-6 border-[0.01rem] border-slate-300 dark:border-0">
<div className="flex justify-between items-start w-full">
Expand Down

0 comments on commit d49460d

Please sign in to comment.