atlas overview: show availability percent with 3 decimals
This commit is contained in:
parent
b200dba5b9
commit
87fbba0d3e
@ -340,6 +340,7 @@ def stat_panel(
|
|||||||
grid,
|
grid,
|
||||||
*,
|
*,
|
||||||
unit="none",
|
unit="none",
|
||||||
|
decimals=None,
|
||||||
thresholds=None,
|
thresholds=None,
|
||||||
text_mode="value",
|
text_mode="value",
|
||||||
legend=None,
|
legend=None,
|
||||||
@ -364,6 +365,8 @@ def stat_panel(
|
|||||||
}
|
}
|
||||||
if value_suffix:
|
if value_suffix:
|
||||||
defaults["custom"]["valueSuffix"] = value_suffix
|
defaults["custom"]["valueSuffix"] = value_suffix
|
||||||
|
if decimals is not None:
|
||||||
|
defaults["decimals"] = decimals
|
||||||
panel = {
|
panel = {
|
||||||
"id": panel_id,
|
"id": panel_id,
|
||||||
"type": "stat",
|
"type": "stat",
|
||||||
@ -639,6 +642,8 @@ def build_overview():
|
|||||||
"kind": "stat",
|
"kind": "stat",
|
||||||
"thresholds": UPTIME_PERCENT_THRESHOLDS,
|
"thresholds": UPTIME_PERCENT_THRESHOLDS,
|
||||||
"value_suffix": "%",
|
"value_suffix": "%",
|
||||||
|
"unit": "percentunit",
|
||||||
|
"decimals": 3,
|
||||||
"text_mode": "value",
|
"text_mode": "value",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -693,12 +698,14 @@ def build_overview():
|
|||||||
item["expr"],
|
item["expr"],
|
||||||
grid,
|
grid,
|
||||||
thresholds=item.get("thresholds"),
|
thresholds=item.get("thresholds"),
|
||||||
legend=None,
|
legend=None,
|
||||||
links=item.get("links"),
|
links=item.get("links"),
|
||||||
text_mode=item.get("text_mode", "value"),
|
text_mode=item.get("text_mode", "value"),
|
||||||
value_suffix=item.get("value_suffix"),
|
value_suffix=item.get("value_suffix"),
|
||||||
)
|
unit=item.get("unit", "none"),
|
||||||
)
|
decimals=item.get("decimals"),
|
||||||
|
)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
panels.append(
|
panels.append(
|
||||||
gauge_panel(
|
gauge_panel(
|
||||||
|
|||||||
@ -257,11 +257,12 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"unit": "none",
|
"unit": "percentunit",
|
||||||
"custom": {
|
"custom": {
|
||||||
"displayMode": "auto",
|
"displayMode": "auto",
|
||||||
"valueSuffix": "%"
|
"valueSuffix": "%"
|
||||||
}
|
},
|
||||||
|
"decimals": 3
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
@ -266,11 +266,12 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"unit": "none",
|
"unit": "percentunit",
|
||||||
"custom": {
|
"custom": {
|
||||||
"displayMode": "auto",
|
"displayMode": "auto",
|
||||||
"valueSuffix": "%"
|
"valueSuffix": "%"
|
||||||
}
|
},
|
||||||
|
"decimals": 3
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user