Created
November 3, 2017 07:06
-
-
Save xuanyu-h/9a1edc921a265fbcf2f31f9fa8a47dc7 to your computer and use it in GitHub Desktop.
deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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