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.
![flow](http://alseambusher.github.io/files/flow.gif)
1. Easy setup
2. Easy and safe adding, deleting or pausing jobs. Easy to maintain hundreds of jobs.
3. Backups

View File

@ -71,5 +71,9 @@ exports.backup = function(){
exports.restore = function(db_name){
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){
$("#job").modal("show");
$("#job-name").val(job.name);
$("#job-command").val(job.command.replace("\"","\\\""));
$("#job-command").val(job.command);
// if macro not used
if(job.schedule.indexOf("@") != 0){
var components = job.schedule.split(" ");

View File

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

View File

@ -45,7 +45,7 @@
<label>Command</label>
<input type='text' class='form-control' id='job-command' onkeyup="job_command = $(this).val(); job_string();"/><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 = '@daily'; job_string();">Daily</a>
<a class="btn btn-primary" onclick="schedule = '@monthly'; job_string();">Monthly</a>

View File

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