You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
crontab-ui/views/restore.ejs

66 lines
1.7 KiB

10 years ago
<!doctype html>
<head>
<title>Crontab UI</title>
<script src="jquery.js"></script>
<script src="script.js"></script>
<script src="bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css" />
10 years ago
<script type="text/javascript">
var crontabs = [];
var routes = [];
$(function () {
// initialize tooltips
$('[data-toggle="tooltip"]').tooltip();
crontabs = JSON.parse('<%- crontabs.replace(/\\\\/g, "\\\\\\\\").replace(/\\\"/g,"\\\\\"").replace(/\'/g,"\\\'") %>');
10 years ago
routes = JSON.parse('<%- routes %>');
})
</script>
</head>
<body>
<%- include('navbar.ejs') -%>
10 years ago
<div class="container">
<h2><%= db %></h2>
<table class="table">
<tr>
10 years ago
<th>Id</th>
10 years ago
<th></th>
<th>Job</th>
<th>Time</th>
<th>Last Modified</th>
</tr>
10 years ago
<% var index = 1 %>
10 years ago
<% JSON.parse(crontabs).forEach(function(crontab){ %>
<!-- color based on crontab state -->
<% if (!crontab.stopped) { %>
<tr>
<% } else { %>
<tr style="background:#3A6DA6;color:#fff">
<% } %>
10 years ago
<td>
<%= index %>.
<% index += 1 %>
<%= crontab._id %>
</td>
10 years ago
<td>
<% 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>
<% } %>
</td>
<td><%= crontab.command %></td>
<td><%= crontab.schedule %></td>
<td><%= crontab.timestamp %></td>
</tr>
<% }); %>
</table>
<a class="btn btn-primary" onclick="restore_backup('<%= db %>')"><span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> Restore</a>
<a class="btn btn-danger" onclick="delete_backup('<%= db %>')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete</a>
</div>
<%- include('popup.ejs') -%>
10 years ago
</body>
</html>