...
|
...
|
@@ -118,13 +118,13 @@ |
|
|
html += data + '</span>';
|
|
|
return html;
|
|
|
},
|
|
|
targets: 1
|
|
|
targets: 2
|
|
|
}, {
|
|
|
render: function(data, type, row){
|
|
|
var disabled = row.state !== 'success';
|
|
|
return '<button '+(disabled? 'disabled' : '')+' class="btn btn-success btn-xs deploy-btn" data-id="'+data+'" data-build='+row.buildTime+'>分发</button>';
|
|
|
},
|
|
|
targets: 3
|
|
|
targets: 4
|
|
|
}]
|
|
|
});
|
|
|
|
...
|
...
|
@@ -153,13 +153,20 @@ |
|
|
|
|
|
$('.build-btn').click(function(){
|
|
|
var env = $(this).parents('.panel').data('env');
|
|
|
$.post('/projects/build/{{project._id}}', {env: env}, function(ret){
|
|
|
var i = layer.prompt({
|
|
|
title: '请输入需要构建的分支,默认为 {{deploy.branchName}}'
|
|
|
}, function(branch){
|
|
|
branch = branch || '{{deploy.branchName}}';
|
|
|
$.post('/projects/build/{{project._id}}', {env: env, branch: branch}, function(ret){
|
|
|
if(ret.code == 200) {
|
|
|
tables[env].ajax.reload();
|
|
|
layer.close(i);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
$('.rollback-btn').click(function(){
|
|
|
layer.prompt({
|
...
|
...
|
|