Improve job daemon to update dashboard

This commit is contained in:
Eike Foken
2011-09-15 20:17:35 +02:00
parent 766f8c95f9
commit c6c7e3c629
5 changed files with 64 additions and 10 deletions

View File

@@ -13,7 +13,11 @@ function getNotifications() {
* Looks for finished jobs.
*/
function jobDaemon() {
$.get(SITE_URL + 'ajax/check_jobs');
$.getJSON(SITE_URL + 'ajax/check_jobs', function(data) {
$.each(data, function(key, value) {
$('#' + key).find('strong').html(value);
});
});
}
/**
@@ -128,6 +132,7 @@ $(document).ready(function() {
$('#notifications').hide();
getNotifications();
setInterval('getNotifications()', '5000');
jobDaemon();
setInterval('jobDaemon()', JOBS_CHECK_INTERVAL * 1000);
/*