Skip to content

Commit

Permalink
fix bug: status undefined when open web
Browse files Browse the repository at this point in the history
  • Loading branch information
xxnet committed May 13, 2015
1 parent 59bb1bb commit ccb0f49
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions goagent/3.1.49/web_ui/deploy.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,51 +164,47 @@ <h2>部署XX-Net至GAE</h2>
url: 'http://127.0.0.1:8084/deploy?cmd=get_log',
dataType: 'JSON',
success: function(result) {
if ( window.status == 'init' || window.status == 'finished' ) {
if ( window.status == 'running' ) {
if ( result['status'] == 'init' ) {
window.timer.stop();
$('.alert').html('当前状态: 空闲');
$('.alert').html('当前状态: XX-Net被重置。');

changeButtonStatus('start');
} else if ( result['status'] == 'running' ) {
window.status = 'running';
$('.alert').html('当前状态: 正在部署...');

updateLog(result['log']);
changeButtonStatus('cancel');
} else if ( result['status'] == 'finished' ) {
window.timer.stop();
window.status = 'finished';
$('.alert').html('当前状态: 部署完成');
$('.alert').html('当前状态: 部署完成。 <br>请在<a href="http://127.0.0.1:8085/?module=goagent&menu=config">配置页面</a>中设置AppID, 方会生效。');

updateLog(result['log']);
changeButtonStatus('start');
} else {
window.timer.stop();
$('.alert').html('当前状态: 发生异常。<br>异常信息:' + result['status']);
updateLog(result['log']);
}
} else if ( window.status == 'running' ) {
} else { // window.status == 'init' || window.status == 'finished' || undefined
if ( result['status'] == 'init' ) {
window.timer.stop();
$('.alert').html('当前状态: XX-Net被重置。');

changeButtonStatus('start');
$('.alert').html('当前状态: 空闲');
} else if ( result['status'] == 'running' ) {
window.status = 'running';
$('.alert').html('当前状态: 正在部署...');

updateLog(result['log']);
changeButtonStatus('cancel');
} else if ( result['status'] == 'finished' ) {
window.timer.stop();
window.status = 'finished';
$('.alert').html('当前状态: 部署完成。 <br>请在<a href="http://127.0.0.1:8085/?module=goagent&menu=config">配置页面</a>中设置AppID, 方会生效。');
$('.alert').html('当前状态: 部署完成');

updateLog(result['log']);
changeButtonStatus('start');
} else {
window.timer.stop();
$('.alert').html('当前状态: 发生异常。<br>异常信息:' + result['status']);
updateLog(result['log']);
}
} else {
window.timer.stop();
$('.alert').html('当前状态:' + window.status + ', 异常。<br>异常信息:' + result['status']);
updateLog(result['log']);
}
if(window.isAutoScrollLog == true){
$('#log').scrollTop($('#log')[0].scrollHeight);
Expand Down

0 comments on commit ccb0f49

Please sign in to comment.