Fixed height and width in icon, group and staticgraph

Former-commit-id: 03a8147ba5a8897acf91aa9265fb62e7fab7e517
This commit is contained in:
Daniel Maya 2019-04-23 16:53:18 +02:00
parent 5e3f3500c4
commit c910c94c7f
3 changed files with 32 additions and 21 deletions

View File

@ -249,6 +249,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.
@ -268,13 +270,16 @@ 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];
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
$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,13 +120,16 @@ 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];
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
$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,13 +179,16 @@ 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];
// Default value. Will be replaced by a dynamic image size
// calculation after the phase 3.
$data['width'] = 70;
$data['height'] = 70;
$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.