Skip to content

NMS-20154: PrimeVue Generate System Report page - #8735

Open
joseanesONMS wants to merge 6 commits into
developfrom
jira/NMS-20154-system-report
Open

NMS-20154: PrimeVue Generate System Report page#8735
joseanesONMS wants to merge 6 commits into
developfrom
jira/NMS-20154-system-report

Conversation

@joseanesONMS

Copy link
Copy Markdown

Replaces the legacy Generate System Report JSP form with a PrimeVue page backed by a new REST metadata endpoint.

Report generation is unchanged — it still streams from the existing SystemReportController — so this is a UI/metadata migration, not a change to what the report contains.

  • New /api/v2/system-report/plugins and /formatters expose the visible report plugins and formatters as JSON; both are admin-gated.
  • The PrimeVue page at /system-report offers plugin checkboxes with an All toggle, a report-type Select, an optional file name, and Generate; the route is admin-gated.
  • Generate posts operation=run to the existing streaming controller through a hidden iframe, and a failed generation (500, expired session, plugin error) is now surfaced instead of silently doing nothing.
  • The default report type stays text (matching the legacy form), the file name is sanitized the way the server sanitizes it, and the Support menu entry is repointed to the new page.
  • Covered by a SystemReportRestService unit test and a SystemReport.vue component test (form contract, filename sanitization, iframe-error path); full ui suite green.

…t page

Adds a read-only SystemReportRestService exposing the visible report plugins and
formatters as JSON so a PrimeVue Generate System Report page can build its form.
The systemReport bean is wired into the REST v2 context through the SOA service
registry, mirroring the legacy dispatcher wiring, and the endpoints are gated to
ROLE_ADMIN since the report bundles logs and configuration. Report generation
itself continues to stream from the existing SystemReportController.
Replaces the legacy systemReport JSP form with a PrimeVue page at /system-report:
plugin checkboxes with an All master toggle, a report-type Select, and an optional
file name. The page loads its options from /api/v2/system-report and, on Generate,
posts operation=run to the existing SystemReportController through a hidden iframe
so the browser streams the report download without navigating away. The route is
admin-gated to match the endpoint.
serviceRegistry is a root-context bean (applicationContext-soa.xml) and the CXF
/api/v2 servlet context has the root as its parent, so a direct ref resolves it —
matching the legacy dispatcher wiring. Replaces the earlier onmsgi:reference,
which had no matching OSGi service registration.
Repoints the "Generate System Report" menu item from the legacy
admin/support/systemReportList.htm JSP to the PrimeVue page at
ui/index.html#/system-report.
Adds a SystemReportRestService unit test covering the visible-only filtering and
DTO mapping for plugins and formatters. The page now shows a notice on Generate
that the report is being built and may take a while on a large system, since the
report is produced on demand (plugins run and logs/config are gathered and
compressed before the streamed download begins) and the browser cannot signal
when that download completes.
…ename

The Generate flow now detects when the hidden download frame loads an error page
(a failed download never loads it) and surfaces the failure instead of silently
doing nothing. The optional filename is sanitized to word characters the same way
the server does, and omitted when it would collapse to an empty name. The default
report format returns to the legacy 'text', plugin checkbox ids are made
whitespace-safe, the context path is derived from the URL when the menu base is
unavailable, and a non-admin deep-link no longer flashes a load error before the
route guard redirects. Also drops the dead JSON-shape fallback in the service.
@synqotik

synqotik commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@joseanesONMS A few comments before reviewing further.

Make sure to use the new Onms-XXX UI components instead of using PrimeVue directly. These just landed in develop.

Also in future, PR title should reference Vue or Vue UI, instead of PrimeVue. e.g. NMS-20145: Migrate Generate System Report page to Vue UI or similar.

Run pnpm lint from the /ui directory before pushing code (and pnpm lint:fix to auto-fix), this should catch any formatting issues, but it will also prevent direct use of PrimeVue. (I will probably make sure this happens in CI soon).

Need to fix integration and smoke tests. Will need to at least fix MenuHeaderIT.java.

I want to look closer at this. Instead of the sort of hack of loading the generated report into an iframe, perhaps we can have a REST API to generate the report and return it. Then we can use composables/useDownload() like we do in src/components/SnmpConfiguration/SnmpConfigUploadDownloadTab.vue and elsewhere.

@dino2gnt

dino2gnt commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

<support-hat>
I would be fine with ignoring this and deprecating the System Report feature entirely instead. Support doesn't use it and never has as best I can tell.
</support-hat>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants