From 723fba84f351eac54905679f1b0785c6f8bf58a4 Mon Sep 17 00:00:00 2001 From: Henri Remonen Date: Mon, 10 Jun 2024 09:41:16 +0300 Subject: [PATCH] fix: updater graylog link logic --- src/client/pages/Admin/tabs/Updater/UpdaterView.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/pages/Admin/tabs/Updater/UpdaterView.jsx b/src/client/pages/Admin/tabs/Updater/UpdaterView.jsx index f52a52b27..e5ab9f4bc 100644 --- a/src/client/pages/Admin/tabs/Updater/UpdaterView.jsx +++ b/src/client/pages/Admin/tabs/Updater/UpdaterView.jsx @@ -25,9 +25,14 @@ import ExternalLink from '../../../../components/common/ExternalLink' const createGraylogLink = updaterStatus => { const baseUrl = GRAYLOG_URL - const start = updaterStatus.startedAt - const end = updaterStatus.finishedAt || new Date() - return `${baseUrl}/search?q=app%3A+norppa-updater&rangetype=absolute&from=${start}&to=${end}` + + // Graylog uses relative time ranges in seconds + const startDate = new Date(updaterStatus.startedAt).toISOString() + const endDate = updaterStatus.finishedAt ? new Date(updaterStatus.finishedAt).toISOString() : new Date().toISOString() + + return `${baseUrl}/search?q=app%3A+norppa-updater&rangetype=absolute&from=${encodeURIComponent( + startDate + )}&to=${encodeURIComponent(endDate)}` } const StatusChip = ({ status }) => {