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
2025-10-11 18:48:08 +02:00
2025-10-11 17:26:33 +01:00
2025-10-11 18:36:06 +02:00

Grafana Battery Visualisation

I hate writing documentation, and since I will have ADHD brain, I will forget how to do this.

npm install
npm run build
cp -r dist /var/lib/grafana/plugins/andydixon-battery-panel

in /etc/grafana/grsfana.ini add andydixon-battery-panel to allow_loading_unsigned_plugins

S
Description
Grafana battery visualisation
Readme GPL-3.0
276 KiB
Languages
TypeScript 87%
JavaScript 9.5%
Dockerfile 2.8%
Shell 0.7%