implement device search!
This commit is contained in:
29
Netdisco/views/ajax/device.tt
Normal file
29
Netdisco/views/ajax/device.tt
Normal file
@@ -0,0 +1,29 @@
|
||||
<table class="bordered-table condensed-table zebra-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Contact</th>
|
||||
<th>Location</th>
|
||||
<th>System Name</th>
|
||||
<th>Model</th>
|
||||
<th>OS Version</th>
|
||||
<th>Management IP</th>
|
||||
<th>Serial</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr>
|
||||
<td><a href="/device?q=[% row.ip %]">[% row.dns.remove(settings.domain_suffix) %]</a></td>
|
||||
<td>[% row.contact %]</td>
|
||||
<td>[% row.location %]</td>
|
||||
<td>[% row.name %]</td>
|
||||
<!-- <td>[% row.description.substr(0, 100) %][% ' …' IF row.description.length > 100 %]</td> -->
|
||||
<td>[% row.model %]</td>
|
||||
<td>[% row.os_ver %]</td>
|
||||
<td>[% row.ip %]</td>
|
||||
<td>[% row.serial %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -2,20 +2,20 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Port</th>
|
||||
<th>Description</th>
|
||||
<th>Vlan</th>
|
||||
<th>Port</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr>
|
||||
<td>[% row.name %]</td>
|
||||
<td>[% row.descr %]</td>
|
||||
<td>[% row.vlan %]</td>
|
||||
<td><a href="/device?q=[% row.ip %]&port=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
|
||||
[% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %]
|
||||
</td>
|
||||
</td>
|
||||
<td>[% row.descr %]</td>
|
||||
<td>[% row.vlan %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
|
||||
62
Netdisco/views/inc/search/device.tt
Normal file
62
Netdisco/views/inc/search/device.tt
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
<p><em>Device Search Options</em></p>
|
||||
<div class="clearfix">
|
||||
<input class="span3" placeholder="System Name"
|
||||
type="text" id="name" name="name"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="System Name"/>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input class="span3" placeholder="Location"
|
||||
type="text" id="location" name="location"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="Location"/>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input class="span3" placeholder="DNS"
|
||||
type="text" id="dns" name="dns"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="DNS"/>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input class="span3" placeholder="IP Address"
|
||||
type="text" id="ip" name="ip"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="IP Address"/>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input class="span3" placeholder="Description"
|
||||
type="text" id="description" name="description"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="Description"/>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<select class="span3" size="[% vars.model_list.size > 5 ? 5 : vars.model_list.size %]"
|
||||
multiple="on" id="model" name="model"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="Model"/>
|
||||
[% FOREACH opt IN vars.model_list %]
|
||||
<option>[% opt %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<select class="span3" size="[% vars.os_ver_list.size > 5 ? 5 : vars.os_ver_list.size %]"
|
||||
multiple="on" id="os_ver" name="os_ver"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="OS Release"/>
|
||||
[% FOREACH opt IN vars.os_ver_list %]
|
||||
<option>[% opt %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<select class="span3" size="[% vars.vendor_list.size > 5 ? 5 : vars.vendor_list.size %]"
|
||||
multiple="on" id="vendor" name="vendor"
|
||||
rel="twipsy" data-placement="right" data-offset="5" title="Vendor"/>
|
||||
[% FOREACH opt IN vars.vendor_list %]
|
||||
<option>[% opt %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</div>
|
||||
<div class="clearfix input-prepend">
|
||||
<label class="add-on">
|
||||
<input type="checkbox" id="matchall" name="matchall"[% ' checked="checked"' IF params.matchall %]/>
|
||||
</label>
|
||||
<label for="matchall">
|
||||
<span class="nd_searchcheckbox uneditable-input">Match All Options</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("a[rel=twipsy]").twipsy({live: true});
|
||||
$("[rel=twipsy]").twipsy({live: true});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user