go-watch/web/templates/index.html

51 lines
No EOL
1.7 KiB
HTML

{{define "title"}}
GoWatch
{{end}}
{{define "content"}}
{{ if .warnings }}
<div class="h3 text-center text-danger" id="logHeader">Startup Warnings</div>
{{ range .warnings }}
<div class="h5 text-center text-danger">{{ . }}</div>
{{ end }}
{{ end }}
<table class="table table-striped table-hover caption-top">
<caption class="h3 text-center">Watches</caption>
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Last Run</th>
<th>Next Run</th>
<th>Last Value</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{{ range .watches }}
<tr class="pointer" onclick="window.location='{{$.urlPrefix}}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 class="h3">
{{ .LastValue }}
</td>
<td>
<a href="{{$.urlPrefix}}watch/edit/{{ .ID }}" class="btn btn-success">Edit</a>
</td>
<td>
<form action="{{$.urlPrefix}}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}}