Skip to content

Commit

Permalink
fix: updater graylog link logic
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Jun 10, 2024
1 parent a01c504 commit 723fba8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/client/pages/Admin/tabs/Updater/UpdaterView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 723fba8

Please sign in to comment.