fix: Update default hoursBack value to 24 in fetchResourceList options

This commit is contained in:
Nawaz Dhandala
2026-03-18 20:53:31 +00:00
parent 7cc6e81fe6
commit a2c8022442
2 changed files with 19 additions and 3 deletions

View File

@@ -413,10 +413,26 @@ const DashboardLogsViewer: FunctionComponent<ComponentProps> = (
}
try {
// When live polling, recompute the time range so the query window
// slides forward to "now" and new logs become visible.
let query: Query<Log> = filterOptions;
if (skipLoadingState && isLiveEnabled && timeRange.range !== TimeRange.CUSTOM) {
const freshRange: InBetween<Date> =
RangeStartAndEndDateTimeUtil.getStartAndEndDate(timeRange);
query = {
...filterOptions,
time: new InBetween<Date>(
freshRange.startValue,
freshRange.endValue,
),
};
}
const listResult: ListResult<Log> =
await AnalyticsModelAPI.getList<Log>({
modelType: Log,
query: filterOptions,
query: query,
limit: pageSize,
skip: (page - 1) * pageSize,
select: select,
@@ -452,7 +468,7 @@ const DashboardLogsViewer: FunctionComponent<ComponentProps> = (
}
}
},
[filterOptions, page, pageSize, select, sortField, sortOrder],
[filterOptions, isLiveEnabled, page, pageSize, select, sortField, sortOrder, timeRange],
);
// --- Fetch histogram ---

View File

@@ -37,7 +37,7 @@ export default class KubernetesResourceUtils {
namespaceAttribute = "resource.k8s.namespace.name",
additionalAttributes = [],
filterAttributes = {},
hoursBack = 1,
hoursBack = 24,
} = options;
const endDate: Date = OneUptimeDate.getCurrentDate();