Skip to content

Commit 2b5c514

Browse files
committed
feat: 更新小时范围选项,支持最近 72 小时的数据查看
1 parent a229028 commit 2b5c514

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default function DashboardPage() {
144144
const [customDraftEnd, setCustomDraftEnd] = useState(rangeInit.end);
145145
const [customError, setCustomError] = useState<string | null>(null);
146146
const customPickerRef = useRef<HTMLDivElement | null>(null);
147-
const [hourRange, setHourRange] = useState<"all" | "12h" | "24h">("all");
147+
const [hourRange, setHourRange] = useState<"all" | "24h" | "72h">("all");
148148
const [modelOptions, setModelOptions] = useState<string[]>([]);
149149
const [routeOptions, setRouteOptions] = useState<string[]>([]);
150150
const [filterModelInput, setFilterModelInput] = useState("");
@@ -639,7 +639,7 @@ export default function DashboardPage() {
639639
const hourlySeries = useMemo(() => {
640640
if (!overviewData?.byHour) return [] as UsageSeriesPoint[];
641641
if (hourRange === "all") return overviewData.byHour;
642-
const hours = hourRange === "12h" ? 12 : 24;
642+
const hours = hourRange === "24h" ? 24 : 72;
643643
return buildHourlySeries(overviewData.byHour, hours);
644644
}, [hourRange, overviewData?.byHour]);
645645

@@ -649,10 +649,10 @@ export default function DashboardPage() {
649649
}
650650
}, [fullscreenChart]);
651651

652-
const hourRangeOptions: { key: "all" | "12h" | "24h"; label: string }[] = [
652+
const hourRangeOptions: { key: "all" | "24h" | "72h"; label: string }[] = [
653653
{ key: "all", label: "全部" },
654-
{ key: "12h", label: "最近 12 小时" },
655-
{ key: "24h", label: "最近 24 小时" }
654+
{ key: "24h", label: "最近 24 小时" },
655+
{ key: "72h", label: "最近 72 小时" }
656656
];
657657

658658
const priceModelOptions = useMemo(() => {

0 commit comments

Comments
 (0)