Skip to content

Commit 7faeacd

Browse files
author
dushixiang
committed
修改服务监控默认选中为 12 小时。
1 parent f0cff6a commit 7faeacd

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

web/src/portal/components/monitor/MonitorCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const MonitorCard = ({monitor, displayMode}: {
1818
}) => {
1919
// 为每个监控卡片查询历史数据
2020
const {data: historyData} = useQuery<GetMetricsResponse>({
21-
queryKey: ['monitorHistory', monitor.id, '1h'],
21+
queryKey: ['monitorHistory', monitor.id, '12h'], // 对应后端 60 秒步长
2222
queryFn: async () => {
2323
const response = await getMonitorHistory(monitor.id, {range: '1h'});
2424
return response.data;

web/src/portal/components/monitor/ResponseTimeChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface ResponseTimeChartProps {
2424
*/
2525
export const ResponseTimeChart = ({monitorId, monitorStats}: ResponseTimeChartProps) => {
2626
const [selectedAgent, setSelectedAgent] = useState<string>('all');
27-
const [timeRange, setTimeRange] = useState<string>('1h');
27+
const [timeRange, setTimeRange] = useState<string>('12h'); // 对应后端 60 秒步长
2828
const [customRange, setCustomRange] = useState<{ start: number; end: number } | null>(null);
2929
const isMobile = useIsMobile();
3030
const customStart = timeRange === 'custom' ? customRange?.start : undefined;

web/src/portal/constants/time.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export const SERVER_TIME_RANGE_OPTIONS: TimeRangeOption[] = [
1515

1616
// 监控详情页时间范围选项
1717
export const MONITOR_TIME_RANGE_OPTIONS: TimeRangeOption[] = [
18-
{label: '1小时', value: '1h'},
19-
{label: '3小时', value: '3h'},
20-
{label: '6小时', value: '6h'},
2118
{label: '12小时', value: '12h'},
2219
{label: '1天', value: '1d'},
2320
{label: '3天', value: '3d'},

0 commit comments

Comments
 (0)