mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
Merge branch 'master' of https://github.com/geordish/librenms into issue-3183
This commit is contained in:
@@ -953,6 +953,14 @@ function list_oxidized() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty($device['group'])) {
|
||||
foreach ($config['oxidized']['group']['os'] as $host_group) {
|
||||
if ($host_group['match'] === $device['os']) {
|
||||
$device['group'] = $host_group['group'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($device['group'])) {
|
||||
foreach ($config['oxidized']['group']['location'] as $host_group) {
|
||||
if (preg_match($host_group['regex'].'i', $device['location'])) {
|
||||
|
||||
@@ -103,7 +103,7 @@ else {
|
||||
$params = array('user' => $_SESSION['user_id'], 'lastpoll' => array($lastpoll_seconds), 'count' => array($interface_count), 'filter' => ($widget_settings['interface_filter']?:(int)1));
|
||||
if (is_admin() || is_read()) {
|
||||
$query = '
|
||||
SELECT *, p.ifInOctets_rate + p.ifOutOctets_rate as total
|
||||
SELECT p.*, devices.*, p.ifInOctets_rate + p.ifOutOctets_rate as total
|
||||
FROM ports as p
|
||||
INNER JOIN devices ON p.device_id = devices.device_id
|
||||
AND unix_timestamp() - p.poll_time <= :lastpoll
|
||||
@@ -115,7 +115,7 @@ else {
|
||||
}
|
||||
else {
|
||||
$query = '
|
||||
SELECT ports.*, devices.hostname, ports.ifInOctets_rate + ports.ifOutOctets_rate as total
|
||||
SELECT ports.*, devices.*, ports.ifInOctets_rate + ports.ifOutOctets_rate as total
|
||||
FROM ports
|
||||
INNER JOIN devices ON ports.device_id = devices.device_id
|
||||
LEFT JOIN ports_perms ON ports.port_id = ports_perms.port_id
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
if(is_admin() !== false) {
|
||||
if (is_numeric($vars['port'])) {
|
||||
$port = dbFetchRow('SELECT * FROM `ports` AS P, `devices` AS D WHERE `port_id` = ? AND D.device_id = P.device_id', array($vars['port']));
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="modal fade bs-example-modal-sm" id="create-bill" tabindex="-1" role="dialog" aria-labelledby="Create" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="Create">Add Traffic Bill</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post" role="form" action="bills/" class="form-horizontal alerts-form">
|
||||
<input type="hidden" name="addbill" value="yes" />
|
||||
|
||||
<?php
|
||||
if (is_array($port)) {
|
||||
$portalias = (empty($port['ifAlias']) ? '' : ' - '.$port['ifAlias'].'');
|
||||
?>
|
||||
<div class="well">
|
||||
<input type="hidden" name="port" value="<?php echo $port['port_id'] ?>" />
|
||||
<p>
|
||||
<?php echo generate_device_link($port) ?>
|
||||
<i class="fa fa-random"></i>
|
||||
<?php echo generate_port_link($port, $port['ifName'] . $portalias) ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
$bill_data['bill_name'] = $port['port_descr_descr'];
|
||||
$bill_data['bill_ref'] = $port['port_descr_circuit'];
|
||||
$bill_data['bill_notes'] = $port['port_descr_speed'];
|
||||
}
|
||||
|
||||
$bill_data['bill_type'] = 'cdr';
|
||||
$quota = array('select_gb' => ' selected');
|
||||
$cdr = array('select_mbps' => ' selected');
|
||||
include 'pages/bill/addoreditbill.inc.php';
|
||||
?>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-4">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> Add Bill</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
@@ -70,7 +70,7 @@ echo "
|
||||
<span class='box-desc'>$desc</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class='box-desc'>".date('r',$service['service_changed'])."</span>
|
||||
<span class='box-desc'>$checked</span>
|
||||
</td>
|
||||
</tr>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user