mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Store browser height and width in session using ajax call
Modify html/includes/print-graphrow.inc.php to make use of the new Session variable
This commit is contained in:
9
html/ajax_setresolution.php
Normal file
9
html/ajax_setresolution.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
session_start();
|
||||
if(isset($_REQUEST['width']) AND isset($_REQUEST['height'])) {
|
||||
$_SESSION['screen_width'] = $_REQUEST['width'];
|
||||
$_SESSION['screen_height'] = $_REQUEST['height'];
|
||||
}
|
||||
|
||||
echo $_SESSION['screen_width'];
|
||||
?>
|
@ -37,6 +37,17 @@ else {
|
||||
);
|
||||
}//end if
|
||||
|
||||
if($_SESSION['screen_width'])
|
||||
{
|
||||
$graph_array['width'] = $_SESSION['screen_width']/5.5;
|
||||
}
|
||||
|
||||
if($_SESSION['screen_height'])
|
||||
{
|
||||
$graph_array['height'] = $_SESSION['screen_height']/6;
|
||||
}
|
||||
|
||||
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
|
||||
$graph_data = array();
|
||||
|
@ -155,3 +155,7 @@ $(document).on("click", '.collapse-neighbors', function(event)
|
||||
continued.toggle();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$.post('ajax_setresolution.php', { width: $(window).width() , height:$(window).height() }, function(json) {
|
||||
},'json');
|
||||
});
|
||||
|
Reference in New Issue
Block a user