1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00
gron/index.htm

217 lines
4.1 KiB
HTML
Raw Normal View History

2022-03-26 13:23:39 +05:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
2022-03-27 12:43:57 +05:00
<title>gron</title>
2022-03-26 13:23:39 +05:00
<style>
2022-03-26 15:29:47 +05:00
/* Based on base16 architecture for building themes
https://github.com/chriskempson/base16 */
2022-03-26 13:23:39 +05:00
:root {
2022-03-26 16:54:52 +05:00
/* Default Background */
--base00: #282c34;
/* Lighter Background */
--base01: #353b45;
/* Selection Background */
--base02: #3e4451;
/* Comments, Invisibles, Line Highlighting */
--base03: #545862;
/* Dark Foreground (Used for status bars) */
--base04: #565c64;
/* Default Foreground, Caret, Delimiters, Operators */
--base05: #abb2bf;
/* Light Foreground (Not often used) */
--base06: #b6bdca;
/* Light Background (Not often used) */
--base07: #c8ccd4;
/* Red */
--base08: #e06c75;
/* Orange */
--base09: #d19a66;
/* Yellow */
--base0A: #e5c07b;
/* Green */
--base0B: #98c379;
/* Aqua */
--base0C: #56b6c2;
/* Blue */
--base0D: #61afef;
/* Purple */
--base0E: #c678dd;
/* Dark red */
--base0F: #be5046;
2022-03-26 13:23:39 +05:00
}
* {
font-family: Verdana;
font-size: 14px;
color: var(--base05);
margin: 0;
padding: 0;
}
html {
height: 100%
}
body {
background-color: var(--base00);
display: flex;
justify-content: space-between;
flex-wrap: nowrap;
flex-direction: column;
height: 100%;
}
h1 {
margin-top: 1em;
font-size: 150%;
margin-bottom: 0.5em;
}
main {
flex-grow: 1;
padding-left: 1em;
padding-right: 1em;
}
table {
border-collapse: collapse;
}
th {
2022-03-26 16:44:46 +05:00
background-color: var(--base01);
2022-03-26 13:23:39 +05:00
}
td,
th {
border: 1px solid var(--base03);
padding: 0.25em;
}
2022-03-26 16:54:52 +05:00
td:first-child {
padding: 0;
}
2022-03-26 16:44:46 +05:00
table button {
2022-03-26 13:23:39 +05:00
width: 100%;
2022-03-27 16:05:31 +05:00
color: #fff;
2022-03-26 13:23:39 +05:00
background-color: var(--base01);
2022-03-26 16:54:52 +05:00
border: 0;
cursor: pointer;
padding: 0.25em;
2022-03-26 13:23:39 +05:00
}
form {
display: none;
}
2022-03-27 16:12:44 +05:00
pre {
font-family: "Consolas";
}
2022-03-26 13:23:39 +05:00
.smaller {
font-size: 75%;
}
.nowrap {
white-space: nowrap;
}
.errorbg {
background-color: var(--base08);
}
2022-03-26 16:54:52 +05:00
2022-03-26 13:23:39 +05:00
.runningbg {
background-color: var(--base0B);
}
2022-03-26 16:54:52 +05:00
2022-03-26 16:44:46 +05:00
.dropbtn {
background-color: var(--base01);
color: var(--base05);
padding: 0.5em;
cursor: pointer;
border: 0;
}
2022-03-26 16:54:52 +05:00
2022-03-26 16:44:46 +05:00
.dropdown {
position: relative;
display: inline-block;
float: right;
}
2022-03-26 16:54:52 +05:00
2022-03-26 16:44:46 +05:00
.dropdown-content {
display: none;
position: absolute;
right: 0;
background-color: var(--base01);
z-index: 1;
}
.dropdown-content a {
color: var(--base05);
padding: 0.5em;
text-decoration: none;
display: block;
2022-03-26 20:20:00 +05:00
white-space: nowrap;
2022-03-26 16:44:46 +05:00
}
.dropdown:hover .dropdown-content {
display: block;
}
2022-03-27 16:05:31 +05:00
.green {
color: var(--base0B);
}
.red {
color: var(--base08);
}
2022-03-26 13:23:39 +05:00
</style>
</head>
<body>
<main>
2022-03-26 16:44:46 +05:00
<div class="dropdown">
<button class="dropbtn">☰ Menu</button>
<div class="dropdown-content">
2022-03-26 20:20:00 +05:00
<a href="/reloadJobs">&#x27f3; Reload jobs</a>
<a>
<hr>
</a>
2022-03-26 20:51:03 +05:00
<a href="/shutdown">&#x23fb; Shutdown</a>
2022-03-26 16:44:46 +05:00
</div>
</div>
2022-03-26 13:23:39 +05:00
<h1>Job list</h1>
<table>
<tr>
<th>Name</th>
<th>Description</th>
<th>Cron</th>
<th>Status</th>
2022-03-26 15:28:48 +05:00
<th>Start time</th>
<th>Finish time</th>
<th>Duration</th>
2022-03-26 13:23:39 +05:00
<th>Last error</th>
</tr>
{{range .}}<tr>
<td>
<form action="/start" method="get" id="form-{{.Name}}"></form>
2022-03-27 16:05:31 +05:00
<button{{if gt .CurrentRunningCount 0}} class="runningbg" {{else}}{{if .LastError}} class="errorbg" {{end}}{{end}} type="submit" form="form-{{.Name}}" name="jobName" value="{{.Name}}" {{if gt .CurrentRunningCount 0}} disabled{{end}}>{{.Name}}</button>
2022-03-26 13:23:39 +05:00
</td>
<td class="smaller">{{.Description}}</td>
2022-03-27 16:12:44 +05:00
<td class="nowrap" align="right">
<pre>{{.Cron}}</pre>
</td>
2022-03-27 16:05:31 +05:00
<td class="nowrap">{{if gt .CurrentRunningCount 1}}<span class="red">running {{.CurrentRunningCount}} jobs</span>{{else}}{{if .CurrentRunningCount}}<span class="green">&#x25b6; running</span>{{else}}&#x23F9; inactive{{end}}{{end}}</td>
2022-03-26 13:23:39 +05:00
<td>{{.LastStartTime}}</td>
<td>{{.LastEndTime}}</td>
<td align="right">{{.LastExecutionDuration}}</td>
2022-03-27 16:05:31 +05:00
<td class="smaller red">{{.LastError}}</td>
2022-03-26 13:23:39 +05:00
</tr>{{end}}
</table>
</main>
</body>
</html>