diff options
author | heper <heper@users.noreply.github.com> | 2015-09-23 17:58:11 +0200 |
---|---|---|
committer | heper <heper@users.noreply.github.com> | 2015-09-23 17:58:11 +0200 |
commit | 1d24ef45e5b77609d585f1a8e4f503e16ef7e867 (patch) | |
tree | 4dbf392c1c25bc47c5a079c8b13c2fcbc33aadf4 /src/usr/local | |
parent | 27fc3a13e445f89003c23d43779a605f0172d030 (diff) | |
download | pfsense-1d24ef45e5b77609d585f1a8e4f503e16ef7e867.zip pfsense-1d24ef45e5b77609d585f1a8e4f503e16ef7e867.tar.gz |
dhcp_lease_counter for master
https://redmine.pfsense.org/issues/5186
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/status_dhcp_leases.php | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/usr/local/www/status_dhcp_leases.php b/src/usr/local/www/status_dhcp_leases.php index c961eca..4008144 100644 --- a/src/usr/local/www/status_dhcp_leases.php +++ b/src/usr/local/www/status_dhcp_leases.php @@ -358,6 +358,7 @@ if (count($pools) > 0) { </thead> <tbody> <?php +$dhcp_leases_subnet_counter = array(); //array to sum up # of leases / subnet foreach ($leases as $data): if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) continue; @@ -371,13 +372,18 @@ foreach ($leases as $data): $lip = ip2ulong($data['ip']); if ($data['act'] != "static") { + $dlsc=0; foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { if (!is_array($dhcpifconf['range'])) continue; if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) { $data['if'] = $dhcpif; + $dhcp_leases_subnet_counter[$dlsc][0] = $dhcpifconf['range']['from']; + $dhcp_leases_subnet_counter[$dlsc][1] = $dhcpifconf['range']['to']; + $dhcp_leases_subnet_counter[$dlsc][2] = $dhcp_leases_subnet_counter[$dlsc][2]+1; break; } + $dlsc++; } } @@ -437,11 +443,33 @@ foreach ($leases as $data): </table> </div> </div> - +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Leases in use')?></h2></div> + <div class="panel-body"> + <table class="table"> + <thead> + <tr> + <th><?=gettext("Pool Start")?></th> + <th><?=gettext("Pool End")?></th> + <th><?=gettext("# of leases in use")?></th> + </tr> + </thead> + <tbody> +<? foreach ($dhcp_leases_subnet_counter as $listcounters):?> + <tr> + <td><?=$listcounters[0]?></td> + <td><?=$listcounters[1]?></td> + <td><?=$listcounters[2]?></td> + </tr> +<? endforeach; ?> + </tbody> + </table> + </div> +</div> <?php if ($_GET['all']): ?> <a class="btn btn-default" href="status_dhcp_leases.php?all=0"><?=gettext("Show active and static leases only")?></a> <?php else: ?> <a class="btn btn-default" href="status_dhcp_leases.php?all=1"><?=gettext("Show all configured leases")?></a> <?php endif; -include("foot.inc");
\ No newline at end of file +include("foot.inc"); |