|
|
@@ -122,7 +122,7 @@ $(function() {
|
|
122
|
122
|
// html
|
|
123
|
123
|
tableData['key'+row.id] = row;
|
|
124
|
124
|
var html = '<p id="'+ row.id +'" >'+
|
|
125
|
|
- '<button class="btn btn-primary btn-xs job_operate" _type="job_trigger" type="button">'+ I18n.jobinfo_opt_run +'</button> '+
|
|
|
125
|
+ '<button class="btn btn-primary btn-xs job_trigger" type="button">'+ I18n.jobinfo_opt_run +'</button> '+
|
|
126
|
126
|
pause_resume +
|
|
127
|
127
|
'<button class="btn btn-primary btn-xs" type="job_del" type="button" onclick="javascript:window.open(\'' + logUrl + '\')" >'+ I18n.jobinfo_opt_log +'</button><br> '+
|
|
128
|
128
|
'<button class="btn btn-warning btn-xs update" type="button">'+ I18n.system_opt_edit +'</button> '+
|
|
|
@@ -195,9 +195,6 @@ $(function() {
|
|
195
|
195
|
typeName = I18n.system_opt_del ;
|
|
196
|
196
|
url = base_url + "/jobinfo/remove";
|
|
197
|
197
|
needFresh = true;
|
|
198
|
|
- } else if ("job_trigger" == type) {
|
|
199
|
|
- typeName = I18n.jobinfo_opt_run ;
|
|
200
|
|
- url = base_url + "/jobinfo/trigger";
|
|
201
|
198
|
} else {
|
|
202
|
199
|
return;
|
|
203
|
200
|
}
|
|
|
@@ -246,6 +243,50 @@ $(function() {
|
|
246
|
243
|
});
|
|
247
|
244
|
});
|
|
248
|
245
|
|
|
|
246
|
+ // job trigger
|
|
|
247
|
+ $("#job_list").on('click', '.job_trigger',function() {
|
|
|
248
|
+ var id = $(this).parent('p').attr("id");
|
|
|
249
|
+ var row = tableData['key'+id];
|
|
|
250
|
+
|
|
|
251
|
+ $("#jobTriggerModal .form input[name='id']").val( row.id );
|
|
|
252
|
+ $("#jobTriggerModal .form textarea[name='executorParam']").val( row.executorParam );
|
|
|
253
|
+
|
|
|
254
|
+ $('#jobTriggerModal').modal({backdrop: false, keyboard: false}).modal('show');
|
|
|
255
|
+ });
|
|
|
256
|
+ $("#jobTriggerModal .ok").on('click',function() {
|
|
|
257
|
+ $.ajax({
|
|
|
258
|
+ type : 'POST',
|
|
|
259
|
+ url : base_url + "/jobinfo/trigger",
|
|
|
260
|
+ data : {
|
|
|
261
|
+ "id" : $("#jobTriggerModal .form input[name='id']").val(),
|
|
|
262
|
+ "executorParam" : $("#jobTriggerModal .textarea[name='executorParam']").val()
|
|
|
263
|
+ },
|
|
|
264
|
+ dataType : "json",
|
|
|
265
|
+ success : function(data){
|
|
|
266
|
+ if (data.code == 200) {
|
|
|
267
|
+ $('#jobTriggerModal').modal('hide');
|
|
|
268
|
+
|
|
|
269
|
+ layer.open({
|
|
|
270
|
+ title: I18n.system_tips,
|
|
|
271
|
+ btn: [ I18n.system_ok ],
|
|
|
272
|
+ content: I18n.jobinfo_opt_run + I18n.system_success ,
|
|
|
273
|
+ icon: '1'
|
|
|
274
|
+ });
|
|
|
275
|
+ } else {
|
|
|
276
|
+ layer.open({
|
|
|
277
|
+ title: I18n.system_tips,
|
|
|
278
|
+ btn: [ I18n.system_ok ],
|
|
|
279
|
+ content: (data.msg || I18n.jobinfo_opt_run + I18n.system_fail ),
|
|
|
280
|
+ icon: '2'
|
|
|
281
|
+ });
|
|
|
282
|
+ }
|
|
|
283
|
+ }
|
|
|
284
|
+ });
|
|
|
285
|
+ });
|
|
|
286
|
+ $("#jobTriggerModal").on('hide.bs.modal', function () {
|
|
|
287
|
+ $("#jobTriggerModal .form")[0].reset();
|
|
|
288
|
+ });
|
|
|
289
|
+
|
|
249
|
290
|
// add
|
|
250
|
291
|
$(".add").click(function(){
|
|
251
|
292
|
$('#addModal').modal({backdrop: false, keyboard: false}).modal('show');
|