Fixed height and width in icon, group and staticgraph
Former-commit-id: 03a8147ba5a8897acf91aa9265fb62e7fab7e517
This commit is contained in:
parent
5e3f3500c4
commit
c910c94c7f
|
@ -249,6 +249,8 @@ final class Group extends Item
|
||||||
$status = AGENT_STATUS_WARNING;
|
$status = AGENT_STATUS_WARNING;
|
||||||
} else if ($countStatus['unknown'] > 0) {
|
} else if ($countStatus['unknown'] > 0) {
|
||||||
$status = AGENT_STATUS_UNKNOWN;
|
$status = AGENT_STATUS_UNKNOWN;
|
||||||
|
} else {
|
||||||
|
$status = AGENT_STATUS_NORMAL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Get the status img src.
|
// Get the status img src.
|
||||||
|
@ -268,13 +270,16 @@ final class Group extends Item
|
||||||
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
||||||
// TODO: This will be the default behaviour after we finish the
|
// TODO: This will be the default behaviour after we finish the
|
||||||
// builder. Don't delete this code.
|
// builder. Don't delete this code.
|
||||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||||
// $data['width'] = $sizeImage[0];
|
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
|
||||||
// $data['height'] = $sizeImage[1];
|
$data['width'] = $sizeImage[0];
|
||||||
// Default value. Will be replaced by a dynamic image size
|
$data['height'] = $sizeImage[1];
|
||||||
// calculation after the phase 3.
|
} else {
|
||||||
$data['width'] = 70;
|
// Default value. Will be replaced by a dynamic image size
|
||||||
$data['height'] = 70;
|
// calculation after the phase 3.
|
||||||
|
$data['width'] = 70;
|
||||||
|
$data['height'] = 70;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['html'] = '<img src="'.$data['statusImageSrc'].'">';
|
$data['html'] = '<img src="'.$data['statusImageSrc'].'">';
|
||||||
|
|
|
@ -120,13 +120,16 @@ final class Icon extends Item
|
||||||
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
||||||
// TODO: This will be the default behaviour after we finish the
|
// TODO: This will be the default behaviour after we finish the
|
||||||
// builder. Don't delete this code.
|
// builder. Don't delete this code.
|
||||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||||
// $data['width'] = $sizeImage[0];
|
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
|
||||||
// $data['height'] = $sizeImage[1];
|
$data['width'] = $sizeImage[0];
|
||||||
// Default value. Will be replaced by a dynamic image size
|
$data['height'] = $sizeImage[1];
|
||||||
// calculation after the phase 3.
|
} else {
|
||||||
$data['width'] = 70;
|
// Default value. Will be replaced by a dynamic image size
|
||||||
$data['height'] = 70;
|
// calculation after the phase 3.
|
||||||
|
$data['width'] = 70;
|
||||||
|
$data['height'] = 70;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
@ -179,13 +179,16 @@ final class StaticGraph extends Item
|
||||||
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
if ((int) $data['width'] === 0 || (int) $data['height'] === 0) {
|
||||||
// TODO: This will be the default behaviour after we finish the
|
// TODO: This will be the default behaviour after we finish the
|
||||||
// builder. Don't delete this code.
|
// builder. Don't delete this code.
|
||||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||||
// $data['width'] = $sizeImage[0];
|
if ($sizeImage[0] < 70 || $sizeImage[1] < 70) {
|
||||||
// $data['height'] = $sizeImage[1];
|
$data['width'] = $sizeImage[0];
|
||||||
// Default value. Will be replaced by a dynamic image size
|
$data['height'] = $sizeImage[1];
|
||||||
// calculation after the phase 3.
|
} else {
|
||||||
$data['width'] = 70;
|
// Default value. Will be replaced by a dynamic image size
|
||||||
$data['height'] = 70;
|
// calculation after the phase 3.
|
||||||
|
$data['width'] = 70;
|
||||||
|
$data['height'] = 70;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get last value.
|
// Get last value.
|
||||||
|
|
Loading…
Reference in New Issue