mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Add device groups in overview tab (#11796)
* Added Device Groups panel on Overview tab * spaces and commas fix * added color in group name * spaces and commas fix2 * fix3 * fix attempt 4 * change text color to preexisting class * change text color to preexisting class v2 * rename title * capitalize * rename title again * title, title... again
This commit is contained in:
		
							
								
								
									
										25
									
								
								includes/html/dev-groups-overview-data.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								includes/html/dev-groups-overview-data.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$device_groups="";
 | 
			
		||||
foreach (dbFetchRows("select dg.id, dg.name from devices d, device_group_device g, device_groups dg where dg.id=g.device_group_id and g.device_id=d.device_id and d.hostname=? order by dg.name", array($device['hostname'])) as $groups) {
 | 
			
		||||
    $device_groups .= (empty($device_groups) ? "" : str_repeat("  ", 4)) . '<a class="list-device" href="/devices/group=' . $groups['id'] . '" target="_blank">' . $groups['name'] . '</a>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if (!empty($device_groups)) {
 | 
			
		||||
    echo "<div class='row'>
 | 
			
		||||
        <div class='col-md-12'>
 | 
			
		||||
          <div class='panel panel-default panel-condensed device-overview'>
 | 
			
		||||
            <div class='panel-heading'>";
 | 
			
		||||
 | 
			
		||||
    echo '<i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> <a class="list-device" href="/device-groups">Device Group Membership</a>';
 | 
			
		||||
    echo '</div><div class="panel-body">';
 | 
			
		||||
 | 
			
		||||
    echo '<div class="row">
 | 
			
		||||
        <div class="col-sm-12">' . $device_groups . '</div>
 | 
			
		||||
      </div>';
 | 
			
		||||
 | 
			
		||||
    echo "</div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>";
 | 
			
		||||
}
 | 
			
		||||
@@ -13,6 +13,7 @@ echo('
 | 
			
		||||
    <div class="col-md-6">
 | 
			
		||||
');
 | 
			
		||||
require 'includes/html/dev-overview-data.inc.php';
 | 
			
		||||
require 'includes/html/dev-groups-overview-data.inc.php';
 | 
			
		||||
require 'overview/puppet_agent.inc.php';
 | 
			
		||||
require 'overview/tracepath.inc.php';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user