v1.0.0
alseambusher 8 years ago
commit e6eaa22408

@ -1,3 +1,4 @@
/*jshint esversion: 6 */
/*********** MessageBox ****************/ /*********** MessageBox ****************/
// simply show info. Only close button // simply show info. Only close button
function infoMessageBox(message, title){ function infoMessageBox(message, title){
@ -84,7 +85,6 @@ function editJob(_id){
} }
schedule = job.schedule; schedule = job.schedule;
job_command = job.command; job_command = job.command;
console.log(job.logging)
if (job.logging && job.logging != "false") if (job.logging && job.logging != "false")
$("#job-logging").prop("checked", true); $("#job-logging").prop("checked", true);
job_string(); job_string();
@ -95,13 +95,13 @@ function editJob(_id){
// TODO good old boring validations // TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: _id, logging: $("#job-logging").prop("checked")}, function(){ $.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: _id, logging: $("#job-logging").prop("checked")}, function(){
location.reload(); location.reload();
}) });
}); });
} }
function newJob(){ function newJob(){
schedule = "" schedule = "";
job_command = "" job_command = "";
$("#job-minute").val("*"); $("#job-minute").val("*");
$("#job-hour").val("*"); $("#job-hour").val("*");
$("#job-day").val("*"); $("#job-day").val("*");
@ -117,7 +117,7 @@ function newJob(){
// TODO good old boring validations // TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1, logging: $("#job-logging").prop("checked")}, function(){ $.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1, logging: $("#job-logging").prop("checked")}, function(){
location.reload(); location.reload();
}) });
}); });
} }

@ -13,7 +13,7 @@
$(function () { $(function () {
// initialize tooltips // initialize tooltips
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"") %>'); crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"").replace(/\'/g,"\\\'") %>');
routes = JSON.parse('<%- routes %>'); routes = JSON.parse('<%- routes %>');
$("#env_vars").val(`<%- env %>`); $("#env_vars").val(`<%- env %>`);
}) })
@ -89,7 +89,6 @@
<a class="btn btn-info" onclick="startJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> Start</a> <a class="btn btn-info" onclick="startJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> Start</a>
<% } %> <% } %>
<a class="btn btn-danger" onclick="deleteJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a> <a class="btn btn-danger" onclick="deleteJob('<%= crontab._id %>')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
</td> </td>
</tr> </tr>
<% }); %> <% }); %>

@ -11,7 +11,7 @@
$(function () { $(function () {
// initialize tooltips // initialize tooltips
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
crontabs = JSON.parse('<%- crontabs.replace(/\\\"/g,"\\\\\"") %>'); crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"").replace(/\'/g,"\\\'") %>');
routes = JSON.parse('<%- routes %>'); routes = JSON.parse('<%- routes %>');
}) })
</script> </script>

Loading…
Cancel
Save