Merge pull request #2510 from Alucardfh/useMoreWidthRebased

Use more width rebased
This commit is contained in:
Neil Lathwood
2015-11-30 20:41:17 +00:00
10 changed files with 174 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ $image = getImage($device);
echo '
<tr bgcolor="'.$device_colour.'" class="alert '.$class.'">
<td width="40" align=center valign=middle style="padding: 21px;">'.$image.'</td>
<td width="40" align=center valign=middle style="padding: 21px;"><span class="device_icon">'.$image.'</span></td>
<td valign=middle style="padding: 0 15px;"><span style="font-size: 20px;">'.generate_device_link($device).'</span>
<br />'.generate_link($device['location'], array('page' => 'devices', 'location' => $device['location'])).'</td>
<td>';

View File

@@ -476,7 +476,7 @@ function generate_lazy_graph_tag($args) {
$urlargs[] = $key."=".urlencode($arg);
}
return '<img class="lazy" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
return '<img class="lazy graphs" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
}//end generate_lazy_graph_tag()

View File

@@ -37,6 +37,22 @@ else {
);
}//end if
if($_SESSION['screen_width']) {
if($_SESSION['screen_width'] < 1024 && $_SESSION['screen_width'] > 700) {
$graph_array['width'] = round(($_SESSION['screen_width'] - 90 )/2,0);
}
else {
if($_SESSION['screen_width'] > 1024) {
$graph_array['width'] = round(($_SESSION['screen_width'] - 90 )/count($periods)+1,0);
}
else {
$graph_array['width'] = $_SESSION['screen_width'] - 70;
}
}
}
$graph_array['height'] = round($graph_array['width'] /2.15);
$graph_array['to'] = $config['time']['now'];
$graph_data = array();