diff options
Diffstat (limited to 'web/status.php')
-rw-r--r-- | web/status.php | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/web/status.php b/web/status.php index ab57a1e..69e8afc 100644 --- a/web/status.php +++ b/web/status.php @@ -49,7 +49,7 @@ if ($status[3] != 0) { $percentage = ceil($status[2]/$status[3]*100); $bres = "Your build is currently running". - " and is ".$percentage."% complete"; + " and is <span id=\"percent\">".$percentage."</span>% complete"; $inprogress = true; } else { $bres = "Task has not yet been processed"; @@ -113,15 +113,31 @@ href="css/ui-lightness/jquery-ui-1.8.14.custom.css"> <script type="text/javascript" src="/js/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="/js/jquery-ui-1.8.14.js"></script> - <?php - if ($inprogress) { - echo '<script> - $(document).ready(function() { - $("#progressbar").progressbar({ value: '.$percentage.' }); - }); - </script>'; - } - ?> + <?php if ($inprogress) { ?> + <script> + var UUID = "<?php echo $buildID; ?>"; + + $(document).ready(function() { + $("#progressbar").progressbar({ value: <?php echo $percentage; ?> }); + }); + + function bar_update() { + $.getJSON('ajax.php?uuid='+UUID, function(data) { + if(data.status == 1) { + percent = Math.floor((data.num/data.den)*100); + $("#progressbar").progressbar({ value: percent }); + $("#percent").html(percent); + } else { + window.location.reload(); + } + }); + setTimeout("bar_update();", 3000); + } + + bar_update(); + </script> + <?php } ?> + </head> <body> <div id="container"> |