Monitorex.Exports
(monitorex v0.6.0)
Copy Markdown
Export utilities for Monitorex — generates CSV and JSON from page data.
Used by the dashboard export buttons to download current view as a file.
Summary
Functions
Builds a filename for an exported page. Format: monitorex{page}{timestamp}.{ext}
Sanitizes a filename for safe filesystem use. Replaces non-alphanumeric characters (except . - _) with underscores.
Generates CSV string from a list of maps (rows) and column definitions.
Generates pretty-printed JSON from a list of maps or structs.
Functions
Builds a filename for an exported page. Format: monitorex{page}{timestamp}.{ext}
Sanitizes a filename for safe filesystem use. Replaces non-alphanumeric characters (except . - _) with underscores.
Generates CSV string from a list of maps (rows) and column definitions.
Columns define both order and which keys to include. Handles commas, quotes, and newlines in cell values.
Generates pretty-printed JSON from a list of maps or structs.
When fields is provided, only those keys are included (same as CSV export).
Structs are converted to plain maps before encoding.