Subnet Utilization report

This commit is contained in:
Oliver Gorwits
2014-01-01 15:21:23 +00:00
parent bebb07458f
commit cb9abc2355
9 changed files with 156 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
[% IF results.count == 0 %]
<div class="span2 alert alert-info">The aren't enough jobs to report.</div>
<div class="span3 alert alert-info">The aren't enough jobs to report.</div>
[% ELSE %]
<table class="table table-bordered table-condensed table-hover nd_floatinghead">
<thead>

View File

@@ -0,0 +1,25 @@
[% IF results.count == 0 %]
<div class="span2 alert alert-info">No matching records.</div>
[% ELSE %]
<table class="table table-bordered table-condensed table-striped nd_floatinghead">
<thead>
<tr>
<th class="nd_center-cell">Subnet</th>
<th class="nd_center-cell">Size</th>
<th class="nd_center-cell">Number of Active Nodes</th>
<th class="nd_center-cell">Percent Utilization</th>
</tr>
</thead>
</tbody>
[% FOREACH row IN results.all %]
<tr>
<td class="nd_center-cell">[% row.subnet | html_entity %]</td>
<td class="nd_center-cell">[% row.subnet_size | html_entity %]</td>
<td class="nd_center-cell">[% row.active | html_entity %]</td>
<td class="nd_center-cell">[% row.percent | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]

View File

@@ -0,0 +1,14 @@
[% USE CSV %]
[% CSV.dump([ 'Subnet' 'Size' 'Number of Active Nodes' 'Percent Utilization' ]) %]
[% FOREACH row IN results.all %]
[% mylist = [] %]
[% mylist.push(row.subnet) %]
[% mylist.push(row.subnet_size) %]
[% mylist.push(row.active) %]
[% mylist.push(row.percent) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -128,7 +128,7 @@
// on page load, load the content for the active tab
[% IF params.tab %]
[% IF params.tab == 'ipinventory' %]
[% IF params.tab == 'ipinventory' OR params.tab == 'subnets' %]
$('#[% params.tab %]_submit').click();
[% ELSE %]
$('#[% params.tab %]_form').trigger("submit");

View File

@@ -0,0 +1,28 @@
<div class="clearfix">
<input id="nd_ipinventory-subnet" class="nd_sidebar-topinput nd_colored-input"
placeholder="CIDR Prefix/Subnet" required="required"
name="subnet" value="[% params.subnet | html_entity %]" type="text" autocomplete="off"
rel="tooltip" data-placement="left" data-offset="5" data-title="Prefix/Subnet in CIDR Format"/>
</div>
<fieldset>
<legend class="nd_sidebar-legend">
<label><em><strong>Options</strong></em></label>
</legend>
<div class="clearfix">
<ul class="unstyled">
<li>
<em class="muted">Activity Period:</em><br/>
<select id="nd_mac-format" class="nd_side-select" name="age">
[% FOREACH size IN [ '7 days', '14 days', '30 days', '3 months', '1 year', '5 years' ] %]
<option[% ' selected="selected"' IF params.age == size %]>[% size %]</option>
[% END %]
</select>
</li>
</ul>
</div>
</fieldset>
<button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
<i class="icon-search icon-large pull-left nd_navbar-icon"></i> Search Subnets</button>