...
|
...
|
@@ -19,7 +19,7 @@ |
|
|
<div class="panel panel-default" data-env='{{deploy.env}}'>
|
|
|
<div class="panel-heading">
|
|
|
<div class="pull-right">
|
|
|
<a class="btn btn-info btn-rounded mr5 log-btn"><i class="fa fa-eye"></i> 查看实时日志</a>
|
|
|
<a class="btn btn-info btn-rounded mr5 log-btn"><i class="fa fa-eye"></i> 查看构建日志</a>
|
|
|
<a class="btn btn-warning btn-rounded mr5 rollback-btn"><i class="fa fa-reply"></i> 回滚</a>
|
|
|
<a class="btn btn-success btn-rounded mr20 build-btn"><i class="glyphicon glyphicon-plus"></i> 新增构建</a>
|
|
|
<a href="" class="tooltips panel-minimize"><i class="fa fa-minus"></i></a>
|
...
|
...
|
@@ -49,7 +49,7 @@ |
|
|
<div class="panel-body">
|
|
|
<div class="row">
|
|
|
{{#each targets}}
|
|
|
<div class="col-md-4" id="d-{{host}}">
|
|
|
<div class="col-md-4" id="d-{{hostFm}}">
|
|
|
<div class="panel panel-info noborder">
|
|
|
<div class="panel-heading noborder">
|
|
|
<div class="panel-btns">
|
...
|
...
|
@@ -65,6 +65,9 @@ |
|
|
<h5 class="md-title mt10">当前状态</h5>
|
|
|
<span class="label label-success deploy-log-btn" data-host="{{host}}"><i class="fa fa-spinner fa-spin fa-fw margin-bottom"></i> <b>{{#if info}}{{info.state}}{{^}}未知部署{{/if}}</b></span>
|
|
|
</div>
|
|
|
<div class="col-xs-6">
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div><!-- panel-body -->
|
|
|
</div><!-- panel -->
|
...
|
...
|
@@ -120,9 +123,11 @@ |
|
|
return '<button '+(disabled? 'disabled' : '')+' class="btn btn-success btn-xs deploy-btn" data-id="'+data+'" data-build='+row.buildTime+'>分发</button>';
|
|
|
},
|
|
|
targets: 3
|
|
|
}],
|
|
|
initComplete: function(){
|
|
|
$('.deploy-btn').click(function(){
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
$(this).on( 'draw.dt', function () {
|
|
|
$('.deploy-btn').click(function(){
|
|
|
var id = $(this).data('id');
|
|
|
var build = $(this).data('build');
|
|
|
layer.confirm('确定发布版本<code>' + build + '</code>吗?', {
|
...
|
...
|
@@ -131,8 +136,7 @@ |
|
|
doDeploy(id);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
} );
|
|
|
});
|
|
|
|
|
|
function doDeploy(build){
|
...
|
...
|
@@ -211,21 +215,22 @@ |
|
|
}
|
|
|
});
|
|
|
|
|
|
ws.on('/building/{{project._id}}/log', function(data){
|
|
|
if(tag == '') {
|
|
|
cm.replaceRange("> " + data + "\n", {line: Infinity});
|
|
|
}
|
|
|
});
|
|
|
// ws.on('/building/{{project._id}}/log', function(data){
|
|
|
// if(tag == '') {
|
|
|
// cm.replaceRange("> " + data + "\n", {line: Infinity});
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
ws.on('/deploy/{{project._id}}', function(data){
|
|
|
$('#d-' + data.host).find('b').text(data.state);
|
|
|
console.log(data);
|
|
|
$('#d-' + data.host.replace(/\./g, '-')).find('b').text(data.state);
|
|
|
});
|
|
|
|
|
|
ws.on('/deploy/{{project._id}}/log', function(data){
|
|
|
if(tag == data.host){
|
|
|
cm.replaceRange("> " +data.msg+ "\n", {line: Infinity});
|
|
|
}
|
|
|
});
|
|
|
// ws.on('/deploy/{{project._id}}/log', function(data){
|
|
|
// if(tag == data.host){
|
|
|
// cm.replaceRange("> " +data.msg+ "\n", {line: Infinity});
|
|
|
// }
|
|
|
// });
|
|
|
});
|
|
|
ws.on('error', function(){
|
|
|
console.log('connect fail');
|
...
|
...
|
|