mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Merge pull request #2589 from laf/issue-2580
Added option to disable lazy loading of images
This commit is contained in:
		@@ -177,6 +177,11 @@ $config['web_mouseover']      = TRUE;
 | 
			
		||||
```
 | 
			
		||||
You can disable the mouseover popover for mini graphs by setting this to FALSE.
 | 
			
		||||
 | 
			
		||||
```php
 | 
			
		||||
$config['enable_lazy_load'] = true;
 | 
			
		||||
```
 | 
			
		||||
You can disable image lazy loading by setting this to false.
 | 
			
		||||
 | 
			
		||||
```php
 | 
			
		||||
$config['show_overview_tab'] = TRUE;
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
@@ -461,6 +461,7 @@ function generate_graph_tag($args) {
 | 
			
		||||
}//end generate_graph_tag()
 | 
			
		||||
 | 
			
		||||
function generate_lazy_graph_tag($args) {
 | 
			
		||||
    global $config;
 | 
			
		||||
    $urlargs = array();
 | 
			
		||||
    $w = 0;
 | 
			
		||||
    $h = 0;
 | 
			
		||||
@@ -476,7 +477,12 @@ function generate_lazy_graph_tag($args) {
 | 
			
		||||
        $urlargs[] = $key."=".urlencode($arg);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ($config['enable_lazy_load'] === true) {
 | 
			
		||||
        return '<img class="lazy graphs" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&',$urlargs).'" border="0" />';
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        return '<img class="graphs" width="'.$w.'" height="'.$h.'" src="graph.php?' . implode('&',$urlargs).'" border="0" />';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}//end generate_lazy_graph_tag()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -165,8 +165,14 @@ else {
 | 
			
		||||
  <script src="js/jquery.bootgrid.min.js"></script>
 | 
			
		||||
  <script src="js/handlebars.min.js"></script>
 | 
			
		||||
  <script src="js/pace.min.js"></script>
 | 
			
		||||
    <?php
 | 
			
		||||
        if ($config['enable_lazy_load'] === true) {
 | 
			
		||||
    ?>
 | 
			
		||||
  <script src="js/jquery.lazyload.min.js"></script>
 | 
			
		||||
  <script src="js/lazyload.js"></script>
 | 
			
		||||
    <?php
 | 
			
		||||
        }
 | 
			
		||||
    ?>
 | 
			
		||||
  <script src="js/librenms.js"></script>
 | 
			
		||||
  <script type="text/javascript">
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -127,6 +127,7 @@ $config['page_title_prefix'] = '';
 | 
			
		||||
$config['page_title_suffix'] = $config['project_name'];
 | 
			
		||||
$config['timestamp_format']  = 'd-m-Y H:i:s';
 | 
			
		||||
$config['page_gen']          = 0;
 | 
			
		||||
$config['enable_lazy_load']  = true;
 | 
			
		||||
// display MySqL & PHP stats in footer?
 | 
			
		||||
$config['login_message'] = 'Unauthorised access or use shall render the user liable to criminal and/or civil prosecution.';
 | 
			
		||||
$config['public_status'] = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user