fix(dashboardAPI): show string fields in stat panels (reduceOptions.fields)

Grafana Stat/Gauge panels default the Fields option to "Numeric Fields"
(reduceOptions.fields == ""), so string-valued fields (mode, state,
movementState, direction, flowSource, predictionQuality, running) are excluded
and the panel renders "No data" even though the Flux query (last()) returns the
string correctly.

Set reduceOptions.fields = "/.*/" ("All fields") on every stat panel bound to a
string field across machine, machineGroup, pumpingStation, valve,
valveGroupControl, and monster templates. lastNotNull calc was already correct.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
znetsixe
2026-05-27 21:09:24 +02:00
parent 5d651b59ef
commit 8bfc67c610
6 changed files with 18 additions and 9 deletions

View File

@@ -88,7 +88,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "none"
@@ -137,7 +138,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "none"
@@ -793,7 +795,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "area"

View File

@@ -61,7 +61,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "none"

View File

@@ -22,6 +22,7 @@
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
"id": 2,
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
"targets": [
{
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"running\" or r._field==\"pulse\"))\n |> last()",

View File

@@ -61,7 +61,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "none"
@@ -168,7 +169,8 @@
"reduceOptions": {
"calcs": [
"lastNotNull"
]
],
"fields": "/.*/"
},
"colorMode": "value",
"graphMode": "none"

View File

@@ -22,6 +22,7 @@
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
"id": 2,
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
"targets": [
{
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"state\" or r._field==\"mode\" or r._field==\"percentageOpen\"))\n |> last()",

View File

@@ -22,6 +22,7 @@
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
"id": 2,
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
"targets": [
{
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"mode\" or r._field==\"maxDeltaP\"))\n |> last()",