[#54] jobqueue_refresh config for number of seconds betwen queue refresh
This commit is contained in:
		| @@ -14,6 +14,7 @@ | ||||
|   * [#77] Log user access  | ||||
|   * Try to help users more easily get a default login | ||||
|   * Support upgrade from Netdisco version 0.x | ||||
|   * [#54] jobqueue_refresh config for number of seconds betwen queue refresh | ||||
|  | ||||
|   [BUG FIXES] | ||||
|  | ||||
|   | ||||
| @@ -223,6 +223,12 @@ Value: List of Modules. Default: Empty List. | ||||
| List of additional L<App::Netdisco::Web::Plugin> names to load. See also the | ||||
| C<web_plugins> setting. | ||||
|  | ||||
| =head3 C<jobqueue_refresh> | ||||
|  | ||||
| Value: Integer Number. Default: 5. | ||||
|  | ||||
| Number of seconds between reloads of the Job Queue panel in the web interface. | ||||
|  | ||||
| =head3 C<safe_password_store> | ||||
|  | ||||
| Value: Boolean. Default: true. | ||||
|   | ||||
| @@ -72,6 +72,7 @@ web_plugins: | ||||
|   - Device::Neighbors | ||||
|   - Device::Addresses | ||||
| extra_web_plugins: [] | ||||
| jobqueue_refresh: 5 | ||||
| safe_password_store: true | ||||
|  | ||||
| # ------------- | ||||
|   | ||||
| @@ -3,7 +3,9 @@ | ||||
|   var path = 'admin'; | ||||
|  | ||||
|   // keep track of timers so we can kill them | ||||
|   var nd_timers = new Array(); | ||||
|   var nd_timers  = new Array(); | ||||
|   var timermax   = [% settings.jobqueue_refresh || 5 | html %]; | ||||
|   var timercache = timermax - 1; | ||||
|  | ||||
|   // this is called by do_search to support local code | ||||
|   // which might need to act on the newly inserted content | ||||
| @@ -14,19 +16,28 @@ | ||||
|     if (tab == 'jobqueue' | ||||
|         && $('#nd_countdown-control-icon').hasClass('icon-play')) { | ||||
|  | ||||
|         $('#nd_countdown').text('5'); | ||||
|         nd_timers.push(setTimeout(function() { $('#nd_countdown').text('4') }, 1000 )); | ||||
|         nd_timers.push(setTimeout(function() { $('#nd_countdown').text('3') }, 2000 )); | ||||
|         nd_timers.push(setTimeout(function() { $('#nd_countdown').text('2') }, 3000 )); | ||||
|         nd_timers.push(setTimeout(function() { $('#nd_countdown').text('1') }, 4000 )); | ||||
|         $('#nd_countdown').text(timermax); | ||||
|  | ||||
|         // add new timers | ||||
|         for (var i = timercache; i > 0; i--) { | ||||
|           nd_timers.push(setTimeout(function() { | ||||
|             $('#nd_countdown').text(timercache); | ||||
|             timercache = timercache - 1; | ||||
|           }, ((timermax * 1000) - (i * 1000)) )); | ||||
|         } | ||||
|  | ||||
|         nd_timers.push(setTimeout(function() { | ||||
|           // clear any running timers | ||||
|           for (var i = 0; i < nd_timers.length; i++) { | ||||
|               clearTimeout(nd_timers[i]); | ||||
|           } | ||||
|           // reload the tab content | ||||
|  | ||||
|           // reset the timer cache | ||||
|           timercache = timermax - 1; | ||||
|  | ||||
|           // reload the tab content in... | ||||
|           $('#' + tab + '_form').trigger('submit'); | ||||
|         }, 5000)); | ||||
|         }, (timermax * 1000))); | ||||
|     } | ||||
|  | ||||
|     // activate typeahead on the topo boxes | ||||
|   | ||||
		Reference in New Issue
	
	Block a user