1. fixed commands with quotes bug

2. Changed Startup macro from @startup to @reboot
pull/1/head
Suresh Alse 2015-06-13 22:10:37 +05:30
parent 848bf44f3a
commit 41ca8a72c7
6 changed files with 11 additions and 7 deletions

View File

@ -3,6 +3,8 @@ Crontab UI
Editing the plain text crontab is error prone for managing jobs, e.g., adding jobs, deleting jobs, or pausing jobs. A small mistake can easily bring down all the jobs and might cost you a lot of time. With Crontab UI, it is very easy to manage crontab. Here are the key features of Crontab UI. Editing the plain text crontab is error prone for managing jobs, e.g., adding jobs, deleting jobs, or pausing jobs. A small mistake can easily bring down all the jobs and might cost you a lot of time. With Crontab UI, it is very easy to manage crontab. Here are the key features of Crontab UI.
![flow](http://alseambusher.github.io/files/flow.gif)
1. Easy setup 1. Easy setup
2. Easy and safe adding, deleting or pausing jobs. Easy to maintain hundreds of jobs. 2. Easy and safe adding, deleting or pausing jobs. Easy to maintain hundreds of jobs.
3. Backups 3. Backups

View File

@ -71,5 +71,9 @@ exports.backup = function(){
exports.restore = function(db_name){ exports.restore = function(db_name){
fs.createReadStream( __dirname + '/crontabs/' + db_name).pipe(fs.createWriteStream( __dirname + '/crontabs/crontab.db')); fs.createReadStream( __dirname + '/crontabs/' + db_name).pipe(fs.createWriteStream( __dirname + '/crontabs/crontab.db'));
db.loadDatabase(); db.loadDatabase(); // reload the database
}
exports.import = function(){
//TODO
} }

View File

@ -63,7 +63,7 @@ function editJob(_id){
if(job){ if(job){
$("#job").modal("show"); $("#job").modal("show");
$("#job-name").val(job.name); $("#job-name").val(job.name);
$("#job-command").val(job.command.replace("\"","\\\"")); $("#job-command").val(job.command);
// if macro not used // if macro not used
if(job.schedule.indexOf("@") != 0){ if(job.schedule.indexOf("@") != 0){
var components = job.schedule.split(" "); var components = job.schedule.split(" ");

View File

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

View File

@ -45,7 +45,7 @@
<label>Command</label> <label>Command</label>
<input type='text' class='form-control' id='job-command' onkeyup="job_command = $(this).val(); job_string();"/><br /> <input type='text' class='form-control' id='job-command' onkeyup="job_command = $(this).val(); job_string();"/><br />
<label>Quick Schedule</label><br /> <label>Quick Schedule</label><br />
<a class="btn btn-primary" onclick="schedule = '@startup'; job_string();">Startup</a> <a class="btn btn-primary" onclick="schedule = '@reboot'; job_string();">Startup</a>
<a class="btn btn-primary" onclick="schedule = '@hourly'; job_string();">Hourly</a> <a class="btn btn-primary" onclick="schedule = '@hourly'; job_string();">Hourly</a>
<a class="btn btn-primary" onclick="schedule = '@daily'; job_string();">Daily</a> <a class="btn btn-primary" onclick="schedule = '@daily'; job_string();">Daily</a>
<a class="btn btn-primary" onclick="schedule = '@monthly'; job_string();">Monthly</a> <a class="btn btn-primary" onclick="schedule = '@monthly'; job_string();">Monthly</a>

View File

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