fix: resolve remaining .total and .data references after response format migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ee9383d301
commit
07e6c5671d
|
|
@ -187,8 +187,8 @@ export default function SessionReplayPage() {
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
const sessions = sessionsData?? [];
|
const sessions = sessionsData ?? [];
|
||||||
const total = sessionsData?.total ?? 0;
|
const total = sessions.length;
|
||||||
|
|
||||||
// Fetch session events when a session is selected
|
// Fetch session events when a session is selected
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -894,7 +894,7 @@ export default function AlertRuleDetailPage() {
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-sm text-muted-foreground">{t('alertRules.detail.totalEvents')}</span>
|
<span className="text-sm text-muted-foreground">{t('alertRules.detail.totalEvents')}</span>
|
||||||
<span className="text-sm font-medium tabular-nums">
|
<span className="text-sm font-medium tabular-nums">
|
||||||
{eventsData?.total ?? alertEvents.length}
|
{alertEvents.length}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ export default function MetricsPage() {
|
||||||
queryFn: () => apiClient<MetricsOverviewResponse>('/api/v1/monitor/metrics/overview'),
|
queryFn: () => apiClient<MetricsOverviewResponse>('/api/v1/monitor/metrics/overview'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const overview = overviewData?.data;
|
const overview = overviewData;
|
||||||
|
|
||||||
const { data: serversData, isLoading: serversLoading, error } = useQuery({
|
const { data: serversData, isLoading: serversLoading, error } = useQuery({
|
||||||
queryKey: queryKeys.metrics.servers(),
|
queryKey: queryKeys.metrics.servers(),
|
||||||
|
|
|
||||||
|
|
@ -472,17 +472,17 @@ export default function StandingOrderDetailPage() {
|
||||||
enabled: !!id,
|
enabled: !!id,
|
||||||
});
|
});
|
||||||
|
|
||||||
const executions = executionsData?? [];
|
const executions = executionsData ?? [];
|
||||||
const totalExecutions = executionsData?.total ?? 0;
|
const totalExecutions = executions.length;
|
||||||
const totalPages = Math.ceil(totalExecutions / PAGE_SIZE);
|
const totalPages = Math.ceil(totalExecutions / PAGE_SIZE);
|
||||||
|
|
||||||
// Compute stats from executions data
|
// Compute stats from executions data
|
||||||
const stats: StandingOrderStats = (() => {
|
const stats: StandingOrderStats = (() => {
|
||||||
if (!executionsData) {
|
if (!executionsData || executions.length === 0) {
|
||||||
return { totalExecutions: 0, successRate: 0, avgDurationMs: 0 };
|
return { totalExecutions: 0, successRate: 0, avgDurationMs: 0 };
|
||||||
}
|
}
|
||||||
const allExecs = executionsData.data;
|
const allExecs = executions;
|
||||||
const total = executionsData.total;
|
const total = executions.length;
|
||||||
const completed = allExecs.filter((e) => e.status === 'completed').length;
|
const completed = allExecs.filter((e) => e.status === 'completed').length;
|
||||||
const rate = total > 0 ? (completed / total) * 100 : 0;
|
const rate = total > 0 ? (completed / total) * 100 : 0;
|
||||||
const durations = allExecs.filter((e) => e.durationMs != null).map((e) => e.durationMs!);
|
const durations = allExecs.filter((e) => e.durationMs != null).map((e) => e.durationMs!);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue