mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Updates helper for mutliple types
This commit is contained in:
parent
07b5080bac
commit
26e14bc8e1
@ -234,6 +234,13 @@ def utilization_graph(utilization, warning_threshold=75, danger_threshold=90):
|
||||
"""
|
||||
Display a horizontal bar graph indicating a percentage of utilization.
|
||||
"""
|
||||
if isinstance(utilization, int):
|
||||
return {
|
||||
'utilization': utilization,
|
||||
'warning_threshold': warning_threshold,
|
||||
'danger_threshold': danger_threshold,
|
||||
}
|
||||
|
||||
return {
|
||||
'utilization': utilization[0],
|
||||
'warning_threshold': warning_threshold,
|
||||
|
Loading…
Reference in New Issue
Block a user