Skip to content

feat(monitor): add monitor data export - #13875

Open
CNCoreSteb wants to merge 1 commit into
1Panel-dev:dev-v2from
CNCoreSteb:feat/monitor-export
Open

CNCoreSteb wants to merge 1 commit into
1Panel-dev:dev-v2from
CNCoreSteb:feat/monitor-export

Conversation

@CNCoreSteb

Copy link
Copy Markdown

What this PR does / why we need it?

Users currently cannot extract monitor data from the panel. This PR adds an export tab next to the monitor settings, allowing users to export selected metrics and time ranges to CSV, JSON or XLSX files — entirely in the browser, reusing the existing monitor APIs with no new backend endpoints.

Depends on #13874 (monitor search treats an empty io/network value as "all devices"; the "each device" export option relies on it).

Summary of your change

  • New "Export" tab between Monitor and Settings, with time-range picker, metric multi-select (CPU/memory/load/disk IO/network/GPU), device/interface/GPU selectors and format selection.
  • "Each device" exports every device row in one query; a separate "Combined total" option exports the stored all aggregate rows.
  • CSV: UTF-8 BOM, proper escaping, formula-injection sanitization; multiple metrics are packed into a ZIP (deflate via CompressionStream when available).
  • JSON: single structured file, one flat object per row, consistent fields.
  • XLSX: zero-dependency minimal writer, one worksheet per metric, real Excel date cells, row-limit truncation with a user-facing warning.
  • Localized strings for all 12 supported languages; warnings for empty datasets and option-loading failures.
  • loadGPUMonitor now uses the 60s monitor timeout and supports node routing headers.
  • Shared downloadBlob helper in utils/file.ts (delayed object-URL revocation).

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

- new export tab between monitor and settings with time range, metric,
  device/interface/gpu selection and format choice
- files are generated in the browser from existing monitor apis; no new
  backend endpoints
- csv with utf-8 bom, escaping and formula sanitization; multiple metrics
  are zipped; xlsx uses one worksheet per metric with real date cells and
  row-limit warnings; json emits flat row objects
- share downloadBlob in utils/file with delayed url revocation
- use the 60s monitor timeout and node header for gpu queries
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.

1 participant