implement "no devices" prompt for admin users to do first discover
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
<ul id="search_results" class="nav nav-tabs">
|
||||
<li class="active"><a id="[% task.tag %]_link" class="nd_single_tab"
|
||||
href="#[% task.tag %]_pane">[% task.label %]</a></li>
|
||||
[% IF task.tag == 'jobqueue' %]
|
||||
<span id="nd_device_name"></span>
|
||||
[% END %]
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="[% task.tag %]_pane"></div>
|
||||
|
||||
47
Netdisco/share/views/ajax/admintask/jobqueue.tt
Normal file
47
Netdisco/share/views/ajax/admintask/jobqueue.tt
Normal file
@@ -0,0 +1,47 @@
|
||||
<table class="table table-bordered table-condensed table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center_cell">Entered</th>
|
||||
<th class="center_cell">Status</th>
|
||||
<th class="center_cell">Action</th>
|
||||
<th class="center_cell">Device</th>
|
||||
<th class="center_cell">Port</th>
|
||||
<th class="center_cell">Param</th>
|
||||
<th class="center_cell">User</th>
|
||||
<th class="center_cell">Started</th>
|
||||
<th class="center_cell">Finished</th>
|
||||
<th class="center_cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr
|
||||
[% ' class="success"' IF row.status == 'done' %]
|
||||
[% ' class="error"' IF row.status == 'error' %]
|
||||
[% ' class="info"' IF row.status.search('^queued-') %]
|
||||
>
|
||||
<td class="center_cell">[% row.entered_stamp | html_entity %]</td>
|
||||
<td class="center_cell">[% row.action.ucfirst | html_entity %]</td>
|
||||
[% IF row.status.search('^queued-') %]
|
||||
<td class="center_cell">Running on "[% row.status.remove('^queued-') | html_entity %]"</td>
|
||||
[% ELSE %]
|
||||
<td class="center_cell">[% row.status.ucfirst | html_entity %]</td>
|
||||
[% END %]
|
||||
<td class="center_cell"><a class="nd_linkcell"
|
||||
href="[% device_ports %]&q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
|
||||
<td class="center_cell">[% row.port | html_entity %]</td>
|
||||
<td class="center_cell">[% row.subaction | html_entity %]</td>
|
||||
<td class="center_cell">[% row.username | html_entity %]</td>
|
||||
<td class="center_cell">[% row.started_stamp | html_entity %]</td>
|
||||
<td class="center_cell">[% row.finished_stamp | html_entity %]</td>
|
||||
<td class="center_cell">
|
||||
<form name="del" class="nd_inline_form">
|
||||
<input name="job" type="hidden" value="[% row.job | html_entity %]">
|
||||
<button class="btn" name="del" type="submit"><i class="icon-trash text-error"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -44,6 +44,19 @@
|
||||
<script type="text/javascript"> $('#nq').focus(); // set focus to navbar search </script>
|
||||
[% END %]
|
||||
</div>
|
||||
[% IF vars.nodevices %]
|
||||
<div class="hero-unit">
|
||||
<h3>Initial Discovery</h3>
|
||||
<p>You haven't discovered any devices yet.<p>
|
||||
<p>Enter a network device name or IP to queue the first discovery:</p>
|
||||
<form method="post" action="[% uri_for('/admin/discover') %]">
|
||||
<div class="form-horizontal">
|
||||
<input placeholder="Device hostname or IP" class="span4" name="device" type="text"/>
|
||||
<button type="submit" class="btn btn-info">Discover</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /container -->
|
||||
|
||||
@@ -7,6 +7,23 @@
|
||||
// but which cannot use jQuery delegation via .on()
|
||||
function inner_view_processing(tab) {
|
||||
|
||||
// reload this table every 10 seconds
|
||||
if (tab == 'jobqueue') {
|
||||
$('#nd_device_name').text('10');
|
||||
setTimeout(function() { $('#nd_device_name').text('9') }, 1000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('8') }, 2000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('7') }, 3000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('6') }, 4000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('5') }, 5000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('4') }, 6000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('3') }, 7000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('2') }, 8000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('1') }, 9000 );
|
||||
setTimeout(function() {
|
||||
$('#' + tab + '_form').trigger('submit');
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
// activate typeahead on the topo boxes
|
||||
$('.nd_topo_dev').autocomplete({
|
||||
source: '/ajax/data/deviceip/typeahead'
|
||||
|
||||
Reference in New Issue
Block a user