Skip to content

Commit 6cf4ce4

Browse files
committed
Merge branch 'hasanbasri1993-master' into master
2 parents ee113b1 + 9b7989e commit 6cf4ce4

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# docker run -d -p 8000:8000 alseambusher/crontab-ui
2-
FROM alpine:3.10
2+
FROM alpine:3.13.5
33

44
ENV CRON_PATH /etc/crontabs
55

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VER=0.3.13
1+
VER=0.3.15
22

33
release:
44
sed -i '' "s/version\": \".*/version\": \"$(VER)\",/" package.json

crontab.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ exports.crontab_db_file = path.join(exports.db_folder, 'crontab.db');
1111

1212
var db = new Datastore({ filename: exports.crontab_db_file});
1313
var cronPath = "/tmp";
14-
1514
if(process.env.CRON_PATH !== undefined) {
1615
console.log(`Path to crond files set using env variables ${process.env.CRON_PATH}`);
1716
cronPath = process.env.CRON_PATH;
@@ -24,6 +23,8 @@ db.loadDatabase(function (err) {
2423
var exec = require('child_process').exec;
2524
var fs = require('fs');
2625
var cron_parser = require("cron-parser");
26+
var cronstrue = require('cronstrue/i18n');
27+
var humanCronLocate = process.env.HUMANCRON ?? "en"
2728

2829

2930
crontab = function(name, command, schedule, stopped, logging, mailing){
@@ -71,6 +72,7 @@ exports.crontabs = function(callback){
7172
docs[i].next = "Next Reboot";
7273
else
7374
try {
75+
docs[i].human = cronstrue.toString(docs[i].schedule, { locale: humanCronLocate });
7476
docs[i].next = cron_parser.parseExpression(docs[i].schedule).next().toString();
7577
} catch(err) {
7678
console.error(err);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crontab-ui",
3-
"version": "0.3.14",
3+
"version": "0.3.15",
44
"description": "Easy and safe way to manage your crontab file",
55
"main": "index.js",
66
"scripts": {
@@ -11,6 +11,7 @@
1111
"body-parser": "latest",
1212
"connect-busboy": "latest",
1313
"cron-parser": "latest",
14+
"cronstrue": "latest",
1415
"ejs": "latest",
1516
"express": "latest",
1617
"express-basic-auth": "^1.2.0",

views/index.ejs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,14 @@
8282
<% } %>
8383
</td>
8484
<td><%= crontab.command %></td>
85-
<td><span style="cursor:pointer" data-toggle="tooltip" data-placement="bottom" title="<%= crontab.next %>"><%= crontab.schedule %></span></td>
85+
<td>
86+
<span style="cursor:pointer" data-toggle="tooltip" data-placement="bottom" title="<%= crontab.next %>">
87+
<%= crontab.schedule %>
88+
</span>
89+
<a class="btn" data-toggle="tooltip" data-placement="right" title="<%= crontab.human %>">
90+
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
91+
</a>
92+
</td>
8693
<td style="width:20%" title="<%= crontab.timestamp %>"><%= moment(new Date(crontab.timestamp)).fromNow() %></td>
8794
<td>
8895

0 commit comments

Comments
 (0)