2018-01-21 19:07:43 +01:00
|
|
|
function queryStatus(appendix, secret)
|
|
|
|
{
|
|
|
|
jQuery.ajax({
|
2019-12-28 22:42:25 +01:00
|
|
|
url: '/api/extendedgitgraph::status?secret='+secret,
|
2018-01-21 19:07:43 +01:00
|
|
|
success: function(result)
|
|
|
|
{
|
2019-12-28 23:52:19 +01:00
|
|
|
let ajaxOutput = $('#egg_ajaxOutput');
|
2018-01-21 19:07:43 +01:00
|
|
|
ajaxOutput.val(result + '\r\n' + appendix);
|
|
|
|
ajaxOutput.scrollTop(ajaxOutput[0].scrollHeight);
|
|
|
|
},
|
|
|
|
async: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function startAjaxRefresh(secret)
|
|
|
|
{
|
2019-12-28 22:42:25 +01:00
|
|
|
$('#egg_ajaxOutput').val("Started.");
|
2018-01-21 19:07:43 +01:00
|
|
|
val = setInterval(function(){ queryStatus('', secret); }, 500);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
2019-12-28 22:42:25 +01:00
|
|
|
url: '/api/extendedgitgraph::refresh?secret='+secret,
|
2018-01-21 19:07:43 +01:00
|
|
|
success: function(result)
|
|
|
|
{
|
|
|
|
clearInterval(val);
|
|
|
|
queryStatus('Finished.', secret);
|
|
|
|
},
|
|
|
|
error: function( jqXHR, textStatus, errorThrown)
|
|
|
|
{
|
|
|
|
clearInterval(val);
|
|
|
|
queryStatus('AN ERROR OCCURED:' + '\r\n' + textStatus, secret);
|
|
|
|
},
|
|
|
|
async: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function startAjaxRedraw(secret)
|
|
|
|
{
|
2019-12-28 22:42:25 +01:00
|
|
|
$('#egg_ajaxOutput').val("Started.");
|
2018-01-21 19:07:43 +01:00
|
|
|
val = setInterval(function(){ queryStatus('', secret); }, 500);
|
|
|
|
|
|
|
|
jQuery.ajax({
|
2019-12-28 22:42:25 +01:00
|
|
|
url: '/api/extendedgitgraph::redraw?secret='+secret,
|
2018-01-21 19:07:43 +01:00
|
|
|
success: function(result)
|
|
|
|
{
|
|
|
|
clearInterval(val);
|
|
|
|
queryStatus('Finished.', secret);
|
|
|
|
},
|
|
|
|
error: function( jqXHR, textStatus, errorThrown)
|
|
|
|
{
|
|
|
|
clearInterval(val);
|
|
|
|
queryStatus('AN ERROR OCCURED:' + '\r\n' + textStatus, secret);
|
|
|
|
},
|
|
|
|
async: true
|
|
|
|
});
|
2018-01-27 00:28:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function startAjaxReplace(target, url)
|
|
|
|
{
|
|
|
|
$(target).html("Waiting ...");
|
|
|
|
jQuery.ajax({
|
|
|
|
url: url,
|
|
|
|
success: function(result)
|
|
|
|
{
|
|
|
|
$(target).html(result);
|
|
|
|
},
|
|
|
|
error: function( jqXHR, textStatus, errorThrown)
|
|
|
|
{
|
|
|
|
$(target).html('AN ERROR OCCURED:' + '<br/>' + textStatus);
|
|
|
|
},
|
|
|
|
async: true
|
|
|
|
});
|
2018-01-21 19:07:43 +01:00
|
|
|
}
|