cleanup
parent
9816efae44
commit
78f133a075
4
app.js
4
app.js
|
@ -2,6 +2,7 @@ var express = require('express');
|
||||||
var app = express();
|
var app = express();
|
||||||
var crontab = require("./crontab");
|
var crontab = require("./crontab");
|
||||||
var restore = require("./restore");
|
var restore = require("./restore");
|
||||||
|
var moment = require('moment');
|
||||||
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var mime = require('mime');
|
var mime = require('mime');
|
||||||
|
@ -38,7 +39,8 @@ app.get(routes.root, function(req, res) {
|
||||||
routes : JSON.stringify(routes),
|
routes : JSON.stringify(routes),
|
||||||
crontabs : JSON.stringify(docs),
|
crontabs : JSON.stringify(docs),
|
||||||
backups : crontab.get_backup_names(),
|
backups : crontab.get_backup_names(),
|
||||||
env : crontab.get_env()
|
env : crontab.get_env(),
|
||||||
|
moment: moment
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "crontab-ui",
|
"name": "crontab-ui",
|
||||||
"version": "0.1.6",
|
"version": "0.1.7",
|
||||||
"description": "Easy and safe way to manage your crontab file",
|
"description": "Easy and safe way to manage your crontab file",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -13,7 +13,8 @@
|
||||||
"body-parser": "latest",
|
"body-parser": "latest",
|
||||||
"mime": "latest",
|
"mime": "latest",
|
||||||
"cron-parser": "latest",
|
"cron-parser": "latest",
|
||||||
"connect-busboy": "latest"
|
"connect-busboy": "latest",
|
||||||
|
"moment": "latest"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "latest"
|
"node": "latest"
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<script src="jquery.js"></script>
|
<script src="jquery.js"></script>
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
<script src="bootstrap.min.js"></script>
|
<script src="bootstrap.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.12/datatables.min.js"></script>
|
||||||
<link rel="stylesheet" href="bootstrap.min.css" />
|
<link rel="stylesheet" href="bootstrap.min.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"/>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var crontabs = [];
|
var crontabs = [];
|
||||||
var routes = [];
|
var routes = [];
|
||||||
|
@ -37,15 +39,18 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<table class="table">
|
<table class="table table-striped" id="main_table">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Id</th>
|
<th>#</th>
|
||||||
<th></th>
|
<th>Name</th>
|
||||||
<th>Job</th>
|
<th>Job</th>
|
||||||
<th>Time</th>
|
<th>Time</th>
|
||||||
<th>Last Modified</th>
|
<th>Last Modified</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
<% var index = 1 %>
|
<% var index = 1 %>
|
||||||
<% JSON.parse(crontabs).forEach(function(crontab){ %>
|
<% JSON.parse(crontabs).forEach(function(crontab){ %>
|
||||||
<!-- color based on crontab state -->
|
<!-- color based on crontab state -->
|
||||||
|
@ -57,17 +62,19 @@
|
||||||
<td>
|
<td>
|
||||||
<%= index %>.
|
<%= index %>.
|
||||||
<% index += 1 %>
|
<% index += 1 %>
|
||||||
<%= crontab._id %>
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<% if (crontab.name) { %>
|
<% if (crontab.name) { %>
|
||||||
<a class="btn" data-toggle="tooltip" data-placement="right" title="<%= crontab.name %>"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> </a>
|
<%= crontab.name %>
|
||||||
|
<a class="btn" data-toggle="tooltip" data-placement="right" title="<%= crontab._id %>"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> </a>
|
||||||
|
<% } else { %>
|
||||||
|
<%= crontab._id %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= crontab.command %></td>
|
<td><%= crontab.command %></td>
|
||||||
<td><span style="cursor:pointer" data-toggle="tooltip" data-placement="bottom" title="<%= crontab.next %>"><%= crontab.schedule %></span></td>
|
<td><span style="cursor:pointer" data-toggle="tooltip" data-placement="bottom" title="<%= crontab.next %>"><%= crontab.schedule %></span></td>
|
||||||
<td style="width:20%"><%= crontab.timestamp %></td>
|
<td style="width:20%" title="<%= crontab.timestamp %>"><%= moment(new Date(crontab.timestamp)).fromNow() %></td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
<!-- controls based on crontab state -->
|
<!-- controls based on crontab state -->
|
||||||
|
@ -87,9 +94,24 @@
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<% include popup.ejs %>
|
<% include popup.ejs %>
|
||||||
|
<script>
|
||||||
|
jQuery(function($) {
|
||||||
|
$('#main_table').DataTable({
|
||||||
|
order: [1, 'asc'],
|
||||||
|
columns: [
|
||||||
|
{orderable: false},
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
{orderable: false},
|
||||||
|
{orderable: false}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue