From 60670d30a804b157fe03e27f75d21f8b94af41f8 Mon Sep 17 00:00:00 2001 From: igor04091968 Date: Fri, 29 May 2026 08:23:27 +0300 Subject: [PATCH] fix(grafana): avoid empty financial readiness stat --- .../files/1c-financial-reporting.json | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/clickhouse-1c/grafana/provisioning/dashboards/files/1c-financial-reporting.json b/clickhouse-1c/grafana/provisioning/dashboards/files/1c-financial-reporting.json index d95baaa..8990daf 100644 --- a/clickhouse-1c/grafana/provisioning/dashboards/files/1c-financial-reporting.json +++ b/clickhouse-1c/grafana/provisioning/dashboards/files/1c-financial-reporting.json @@ -51,35 +51,33 @@ "mode": "absolute", "steps": [ { - "color": "red", + "color": "orange", "value": null }, - { - "color": "orange", - "value": 1 - }, { "color": "green", - "value": 2 + "value": 1 } ] }, "mappings": [ { + "type": "value", "options": { - "empty": { - "text": "EMPTY" + "0": { + "text": "proxy_only", + "color": "orange", + "index": 0 }, - "ledger_ready": { - "text": "LEDGER READY" - }, - "proxy_only": { - "text": "PROXY ONLY" + "1": { + "text": "ledger_ready", + "color": "green", + "index": 1 } - }, - "type": "value" + } } - ] + ], + "displayName": "Статус" }, "overrides": [] }, @@ -102,7 +100,8 @@ "fields": "", "values": false }, - "textMode": "auto" + "textMode": "value", + "noValue": "proxy_only" }, "targets": [ { @@ -114,7 +113,7 @@ "format": 1, "pluginVersion": "11.2.2", "queryType": "table", - "rawSql": "SELECT readiness_status AS value FROM analytics_1c.v_financial_reporting_readiness", + "rawSql": "SELECT value FROM (SELECT if(readiness_status = 'ledger_ready', 1, 0) AS value, 1 AS priority FROM analytics_1c.v_financial_reporting_readiness UNION ALL SELECT 0 AS value, 2 AS priority) ORDER BY priority LIMIT 1", "refId": "A" } ],