Skip to content

Instantly share code, notes, and snippets.

@xuanyu-h
Created November 3, 2017 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuanyu-h/9a1edc921a265fbcf2f31f9fa8a47dc7 to your computer and use it in GitHub Desktop.
Save xuanyu-h/9a1edc921a265fbcf2f31f9fa8a47dc7 to your computer and use it in GitHub Desktop.
deployment
$(function(){
var refresh_id;
var scrollToBottom = function(){
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
}
var refreshDeploymentTrace = function(){
var deployment_id = $('.deployment-show-page').data('id')
var trace_ele = $('.deployment-trace')
$.getJSON('/deployments/' + deployment_id + '.json', function(data){
trace_ele.html(data.trace_html)
scrollToBottom()
if(data.result_state == "success" || data.result_state == "fail") {
clearInterval(refresh_id)
}
});
}
if($('.deployment-show-page').length > 0){
refresh_id = setInterval(refreshDeploymentTrace, 5000)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment