mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Fixed StaticGraph
Former-commit-id: 512635353ed672969ca4d13859ce073370115a7b
This commit is contained in:
parent
161bf4c079
commit
806310d8d1
pandora_console/include/rest-api/models/VisualConsole
@ -720,6 +720,11 @@ class Item extends Model
|
||||
throw new \InvalidArgumentException('invalid agent Id');
|
||||
}
|
||||
|
||||
// Staticgraph don't need to have an agent.
|
||||
if ($agentId === 0) {
|
||||
return $agentData;
|
||||
}
|
||||
|
||||
if (\is_metaconsole() && $metaconsoleId === null) {
|
||||
throw new \InvalidArgumentException('missing metaconsole node Id');
|
||||
}
|
||||
@ -776,6 +781,11 @@ class Item extends Model
|
||||
throw new \InvalidArgumentException('invalid module Id');
|
||||
}
|
||||
|
||||
// Staticgraph don't need to have a module.
|
||||
if ($moduleId === 0) {
|
||||
return $moduleData;
|
||||
}
|
||||
|
||||
// We should add the metaconsole Id if we can.
|
||||
$metaconsoleId = static::extractMetaconsoleId($itemData);
|
||||
|
||||
|
@ -190,7 +190,7 @@ final class StaticGraph extends Item
|
||||
}
|
||||
|
||||
// Get last value.
|
||||
if (isset($data['show_last_value']) && $data['show_last_value'] !== 2) {
|
||||
if (isset($data['show_last_value']) && $data['show_last_value'] !== 2 && $moduleId !== 0) {
|
||||
$imgTitle = '';
|
||||
|
||||
$unit_text = \trim(\io_safe_output(\modules_get_unit($moduleId)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user