mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
PerfData: Render invalid values as-is
This commit is contained in:
parent
143f3032a2
commit
4b4fd11dc6
1 changed files with 3 additions and 1 deletions
|
|
@ -548,6 +548,8 @@ class PerfData
|
|||
return PerfDataFormat::grams($value);
|
||||
case $this->isLiters():
|
||||
return PerfDataFormat::liters($value);
|
||||
case ! is_numeric($value):
|
||||
return $value;
|
||||
default:
|
||||
return number_format($value, 2);
|
||||
}
|
||||
|
|
@ -593,7 +595,7 @@ class PerfData
|
|||
*/
|
||||
public function getState(): int
|
||||
{
|
||||
if ($this->value === null) {
|
||||
if (! is_numeric($this->value)) {
|
||||
return ServiceStates::UNKNOWN;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue