{{ truncation_message }}
+diff --git a/assets/less/cds-rdm/administration/harvester-reports.less b/assets/less/cds-rdm/administration/harvester-reports.less index 12a16ecb..b6d3ee1f 100644 --- a/assets/less/cds-rdm/administration/harvester-reports.less +++ b/assets/less/cds-rdm/administration/harvester-reports.less @@ -53,4 +53,58 @@ color: #999; margin-top: 0.2em; } -} \ No newline at end of file +} + +.harvester-report-actions { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-end; + gap: 0.5em; + width: 100%; + box-sizing: border-box; + padding-right: 0.25rem; + + > .ui.button { + flex: 0 0 auto; + margin: 0 !important; + } +} + +.ui.grid .column.harvester-report-actions-col { + padding-right: 1.25rem; +} + +.harvester-run-report-meta { + margin-top: 0.15rem !important; +} + +.harvester-run-log-grid { + margin-top: 1rem; +} + +.harvester-run-success-message { + white-space: normal; + text-align: left; +} + +// Job run report: wrap long lines; scroll region height (matches admin log-table intent) +.harvester-run-log-report { + width: 100%; + + .harvester-run-log-table.log-table { + max-height: calc(100vh - 11rem); + overflow-x: hidden; + } + + .harvester-run-log-segment { + overflow-x: hidden; + } + + .log-line .log-message { + white-space: pre-wrap; + overflow-wrap: anywhere; + word-break: break-word; + } +} diff --git a/site/cds_rdm/administration/harvester_reports.py b/site/cds_rdm/administration/harvester_reports.py index e78a25fd..3d775274 100644 --- a/site/cds_rdm/administration/harvester_reports.py +++ b/site/cds_rdm/administration/harvester_reports.py @@ -6,11 +6,10 @@ # under the terms of the GPL-2.0 License; see LICENSE file for more details. """Harvester Reports administration views.""" - import json from functools import partial -from flask import current_app +from flask import current_app, request from invenio_administration.views.base import AdminResourceListView from invenio_i18n import lazy_gettext as _ from invenio_jobs.models import Job, Run @@ -106,8 +105,13 @@ def get_context(self, **kwargs): job_id = self._get_inspire_job_id() if job_id: runs = self._fetch_recent_runs(job_id, limit=20) + requested_run_id = request.args.get("run_id") + default_run = next( + (run for run in runs if run["id"] == requested_run_id), + runs[0] if runs else None, + ) context["harvester_runs"] = json.dumps(runs) - context["default_run"] = json.dumps(runs[0]) if runs else None + context["default_run"] = json.dumps(default_run) if default_run else None else: context["harvester_runs"] = json.dumps([]) context["default_run"] = None diff --git a/site/cds_rdm/assets/semantic-ui/js/cds_rdm/administration/harvesterReports/DownloadButton.js b/site/cds_rdm/assets/semantic-ui/js/cds_rdm/administration/harvesterReports/DownloadButton.js index 8ca4c67a..0b981fbd 100644 --- a/site/cds_rdm/assets/semantic-ui/js/cds_rdm/administration/harvesterReports/DownloadButton.js +++ b/site/cds_rdm/assets/semantic-ui/js/cds_rdm/administration/harvesterReports/DownloadButton.js @@ -5,39 +5,39 @@ // under the terms of the GPL-2.0 License; see LICENSE file for more details. import React from "react"; -import { withState } from "react-searchkit"; import { Button, Icon } from "semantic-ui-react"; import { i18next } from "@translations/invenio_administration/i18next"; -import { extractRunIdFromQuery } from "./utils"; -const DownloadButtonComponent = ({ currentQueryState }) => { - const domContainer = document.getElementById("invenio-search-config"); - const runs = JSON.parse(domContainer?.dataset.harvesterRuns || "[]"); - - const runId = extractRunIdFromQuery( - currentQueryState.queryString || "", - runs - ); - - const handleDownload = () => { - if (!runId) return; - const params = new URLSearchParams({ run_id: runId }); - window.location.href = `/harvester-reports/download?${params.toString()}`; - }; - - return ( +export const DownloadButton = ({ runId }) => ( +
{{ started_at }}
+ {% if run.started_at and run.finished_at %} ++ {{ ((run.finished_at - run.started_at).total_seconds() // 60) | int }} {{ _("mins") }} +
+ {% endif %} + {% else %} +{{ _("Not yet started") }}
+ {% endif %} + {% if run.message and status not in ("FAILED", "PARTIAL_SUCCESS") %} + + {% endif %} +{{ _("No log lines in this view.") }}
+ {% endif %} +@@ -44,23 +42,23 @@
- Download all record.publish audit logs from this harvest run + Download the structured job logs for this harvest run
- View detailed audit reports for all harvester runs + Open Harvester Reports with this run selected