mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch 'ent-6901-Bug-en-custom-graph-de-consolas-visuales' into 'develop'
Ent 6901 bug en custom graph de consolas visuales See merge request artica/pandorafms!3750
This commit is contained in:
commit
8cd742c90c
@ -62,9 +62,15 @@ final class ModuleGraph extends Item
|
||||
$return = parent::encode($data);
|
||||
|
||||
$id_custom_graph = static::extractIdCustomGraph($data);
|
||||
if ($id_custom_graph !== null) {
|
||||
if (!empty($id_custom_graph)) {
|
||||
if (\is_metaconsole()) {
|
||||
$explode_custom_graph = explode('|', $id_custom_graph);
|
||||
$return['id_custom_graph'] = $explode_custom_graph[0];
|
||||
$return['id_metaconsole'] = $explode_custom_graph[1];
|
||||
} else {
|
||||
$return['id_custom_graph'] = $id_custom_graph;
|
||||
}
|
||||
}
|
||||
|
||||
$type_graph = static::getTypeGraph($data);
|
||||
if ($type_graph !== null) {
|
||||
@ -89,7 +95,7 @@ final class ModuleGraph extends Item
|
||||
*/
|
||||
private static function extractIdCustomGraph(array $data)
|
||||
{
|
||||
return static::parseIntOr(
|
||||
return static::notEmptyStringOr(
|
||||
static::issetInArray(
|
||||
$data,
|
||||
[
|
||||
@ -362,6 +368,7 @@ final class ModuleGraph extends Item
|
||||
'show_legend' => $showLegend,
|
||||
'return_img_base_64' => true,
|
||||
'show_title' => false,
|
||||
'server_id' => $metaconsoleId,
|
||||
];
|
||||
|
||||
$paramsCombined = [
|
||||
@ -414,6 +421,7 @@ final class ModuleGraph extends Item
|
||||
'show_legend' => $showLegend,
|
||||
'show_title' => false,
|
||||
'dashboard' => true,
|
||||
'server_id' => $metaconsoleId,
|
||||
];
|
||||
|
||||
if ($imageOnly !== false) {
|
||||
@ -452,7 +460,6 @@ final class ModuleGraph extends Item
|
||||
true,
|
||||
'RR'
|
||||
);
|
||||
}
|
||||
|
||||
$data = array_reduce(
|
||||
$data,
|
||||
@ -462,6 +469,7 @@ final class ModuleGraph extends Item
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user