Merge branch 'visual-console-refactor' of https://brutus.artica.lan:8081/artica/pandorafms into visual-console-refactor

Former-commit-id: 7a79252ca00ae8b9c695b4799a365c440b63d574
This commit is contained in:
Alejandro Gallardo Escobar 2019-04-23 17:29:59 +02:00
commit c0b324b25a
3 changed files with 32 additions and 21 deletions

View File

@ -259,6 +259,8 @@ final class Group extends Item
$status = AGENT_STATUS_WARNING;
} else if ($countStatus['unknown'] > 0) {
$status = AGENT_STATUS_UNKNOWN;
} else {
$status = AGENT_STATUS_NORMAL;
}
} else {
// Get the status img src.
@ -278,14 +280,17 @@ final class Group extends Item
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
// TODO: This will be the default behaviour after we finish the
// builder. Don't delete this code.
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
// $data['width'] = $sizeImage[0];
// $data['height'] = $sizeImage[1];
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
$data['width'] = $sizeImage[0];
$data['height'] = $sizeImage[1];
} else {
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
}
}
$data['html'] = '<img src="'.$data['statusImageSrc'].'">';
}

View File

@ -120,14 +120,17 @@ final class Icon extends Item
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
// TODO: This will be the default behaviour after we finish the
// builder. Don't delete this code.
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
// $data['width'] = $sizeImage[0];
// $data['height'] = $sizeImage[1];
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
$data['width'] = $sizeImage[0];
$data['height'] = $sizeImage[1];
} else {
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
}
}
return $data;
}

View File

@ -179,14 +179,17 @@ final class StaticGraph extends Item
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
// TODO: This will be the default behaviour after we finish the
// builder. Don't delete this code.
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
// $data['width'] = $sizeImage[0];
// $data['height'] = $sizeImage[1];
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
$data['width'] = $sizeImage[0];
$data['height'] = $sizeImage[1];
} else {
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
}
}
// Get last value.
$showLastValueTooltip = static::extractShowLastValueTooltip($data);