Commit Graph
2 Commits
Author SHA1 Message Date
Andy DixonandCopilot 947d9075b0 Add time remaining field, fix field pickers, auto-revert orientation, battery icon
Field pickers:
- Replaced addFieldNamePicker with addTextInput for all field
  selectors (charge, load, state, time remaining). The FieldNamePicker
  component was silently failing to render in some Grafana versions.
  Text inputs are universally supported and let users type the exact
  field name from their data source.

Time remaining:
- New 'Enable time remaining' toggle + field name in Field Mapping
- Reads the last value from the configured field (expects minutes)
- Displays as a styled card with clock icon and human-readable
  duration (e.g. '2h 15m', '45 min', '< 1 min')

Auto-revert horizontal orientation:
- When orientation is set to horizontal but the panel width is < 300px,
  automatically switches to vertical so the battery + side content
  still fit. The preference is stored, so it reverts back when the
  panel is resized larger.

Icon:
- Replaced generic Grafana scaffold logo with a battery SVG icon
  that shows in the visualisation picker and panel header.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-24 13:32:53 +01:00
Andy Dixon 548b7c89b6 Initial Version 2025-10-11 18:36:06 +02:00