go-watch/templates/index.html
2022-10-18 20:34:35 +00:00

36 lines
No EOL
1.2 KiB
HTML

{{define "content"}}
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Last Run</th>
<th>Next Run</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{{ range . }}
<tr class="pointer" onclick="window.location='/watch/view/{{ .ID }}'">
<td class="h3">{{ .Name }}</td>
{{ if .CronEntry }}
<td class="h3">{{ .CronEntry.Prev.Format "2006-01-02 15:04:05" }}</td>
<td class="h3">{{ .CronEntry.Next.Format "2006-01-02 15:04:05" }}</td>
{{ else }}
<td class="h3" colspan="2">No schedule (Add cron filter)</td>
{{ end }}
<td>
<a href="/watch/edit/{{ .ID }}" class="btn btn-success">Edit</a>
</td>
<td>
<form action="/watch/delete" method="post">
<input type="hidden" name="watch_id" value="{{ .ID }}">
<input type="submit" class="btn btn-danger" value="Delete">
</form>
</td>
</tr>
{{ end }}
</tbody>
</table>
{{end}}