|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /home/jackjohn/public_html/shopsite-images/en-GB/javascript/reports/ |
Upload File : |
var progress = -1;
var progress_index = 0;
var no_change_count = 0;
var status = "";
$(document).ready(function() {
$('#progressbar').progressbar({ value: 0 });
init_migration();
});
var poll_interval;
function init_migration() {
//alert("Sending ajax signal");
$.get("stathandler.cgi","ajax=init_migration", function(data) {});
poll_interval = setInterval("poll_progress();", 1000);
}
function poll_progress() {
$.get("stathandler.cgi","ajax=poll_migration_progress", function(data) {
//alert("data: "+ data);
//var new_progress = Math.round(parseFloat(data));
var data_ar = data.split('|');
var new_progress = parseFloat(data_ar[0]);
if (new_progress > progress) {
no_change_count = 0;
if (data_ar.length > 1) {
new_status = data_ar[1];
if (new_status.length > 0 && new_status != status) {
$(".left").append("done.<br>\n" + new_status);
status = new_status;
}
}
progress = new_progress;
$('#progressbar').progressbar({ value: progress });
if (progress >= 100) {
finished();
}
} else {
//no progress since last request -- did something go wrong?
$.get("stathandler.cgi","ajax=poll_migration_error", function(data) {
//alert(data);
if (data.length) {
$(".left").append(data);
clearInterval(poll_interval);
} else
no_change_count++;
});
if (no_change_count == 180) {
finished();
}
}
});
}
function finished() {
$('#progressbar').progressbar({ value: 100 });
clearInterval(poll_interval);
$("#hidden_button").css({visibility: "visible"});
$(".warning").remove();
}