...
|
...
|
@@ -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,11 +153,18 @@ |
|
|
|
|
|
$('.build-btn').click(function(){
|
|
|
var env = $(this).parents('.panel').data('env');
|
|
|
$.post('/projects/build/{{project._id}}', {env: env}, function(ret){
|
|
|
if(ret.code == 200) {
|
|
|
tables[env].ajax.reload();
|
|
|
}
|
|
|
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);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|