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