109 lines
No EOL
3.6 KiB
Cheetah
109 lines
No EOL
3.6 KiB
Cheetah
{{template "head"}}
|
|
<script src="/static/js/table_sort.js"></script>
|
|
<h2>New Tasks</h2>
|
|
<form method="POST">
|
|
<label for="library">Library:</label>
|
|
<select id="library" name="library">
|
|
{{range $l := .Libraries}}
|
|
<option value="{{$l.ID}}">{{$l.Name}}</option>
|
|
{{end}}
|
|
</select>
|
|
<label for="health">Health</label>
|
|
<select id="health" name="health">
|
|
<option value="-1">All</option>
|
|
<option value="0">Unknown</option>
|
|
<option value="1">Damaged</option>
|
|
<option value="2">Healthy</option>
|
|
</select>
|
|
<label for="transcode">Transcode Status</label>
|
|
<select id="transcode" name="transcode">
|
|
<option value="-1">All</option>
|
|
<option value="0">Unknown</option>
|
|
<option value="1">None</option>
|
|
<option value="2">Failed</option>
|
|
<option value="2">Success</option>
|
|
</select>
|
|
<label for="type">Type</label>
|
|
<select id="type" name="type">
|
|
<option value="0">Health Check</option>
|
|
<option value="1">Transcode</option>
|
|
</select>
|
|
<label for="ffmpeg_command">FFmpeg Command:</label>
|
|
<select id="ffmpeg_command" name="ffmpeg_command">
|
|
{{range $l := .FfmpegCommands}}
|
|
<option value="{{$l.ID}}">{{$l.Name}}</option>
|
|
{{end}}
|
|
</select>
|
|
<input type="submit" value="Submit">
|
|
</form>
|
|
|
|
<h2>Task Stats</h2>
|
|
Running: {{.Stats.RunningCount}}
|
|
Queued: {{.Stats.QueuedCount}}
|
|
Failed: {{.Stats.FailedCount}}
|
|
Success: {{.Stats.SuccessCount}}
|
|
Unknown: {{.Stats.UnknownCount}}
|
|
Assigned: {{.Stats.AssignedCount}}
|
|
Paused: {{.Stats.PausedCount}}
|
|
Waiting: {{.Stats.WaitingCount}}
|
|
Total: {{.Stats.TotalCount}}
|
|
|
|
|
|
|
|
<h2>Tasks</h2>
|
|
<label for="limit">Limit:</label>
|
|
<select id="limit" name="limit" onchange="setLimit(this.value)" class="short-button">
|
|
<option selected value="{{.Limit}}">{{.Limit}}</option>
|
|
{{if ne .Limit 100 }}<option value="100">100</option>{{end}}
|
|
{{if ne .Limit 500 }}<option value="500">500</option>{{end}}
|
|
{{if ne .Limit 1000 }}<option value="1000">1000</option>{{end}}
|
|
{{if ne .Limit 10000 }}<option value="10000">10000</option>{{end}}
|
|
</select>
|
|
|
|
<table>
|
|
<tr>
|
|
<th onclick="setTableSort('id')">ID</th>
|
|
<th onclick="setTableSort('library')">Library</th>
|
|
<th onclick="setTableSort('worker')">Worker</th>
|
|
<th onclick="setTableSort('type')">Type</th>
|
|
<th onclick="setTableSort('ffmpeg_command')">FFmpeg Command</th>
|
|
<th onclick="setTableSort('status')">Status</th>
|
|
<th onclick="setTableSort('file')">File</th>
|
|
<th onclick="setTableSort('updated_at')">Updated At</th>
|
|
</tr>
|
|
{{range $t := .Tasks}}
|
|
<tr onclick="window.location='/tasks/{{ $t.ID }}';">
|
|
<td>
|
|
{{ $t.ID }}
|
|
</td>
|
|
<td>
|
|
{{ $t.Library }}
|
|
</td>
|
|
<td>
|
|
{{ $t.Worker }}
|
|
</td>
|
|
<td>
|
|
{{ $t.Type }}
|
|
</td>
|
|
<td>
|
|
{{ $t.FfmpegCommand }}
|
|
</td>
|
|
<td>
|
|
{{ $t.Status }}
|
|
</td>
|
|
<td>
|
|
{{ $t.File }}
|
|
</td>
|
|
<td>
|
|
{{ $t.UpdatedAt }}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</table>
|
|
<div class="button-list">
|
|
{{if ne .Page 0 }}{{if ne .Page 1 }}<button type="button" onclick="setPage(0)" class="short-button">First Page</button>{{end}}{{end}}
|
|
{{if ne .Page 0 }}<button type="button" onclick="setPage({{.Page}} -1)" class="short-button">Previous Page</button>{{end}}
|
|
<div> Page {{.Page}} </div>
|
|
{{if ne .Count 0}}<button type="button" onclick="setPage({{.Page}} +1)" class="short-button">Next Page</button>{{end}}
|
|
</div>
|
|
{{template "tail"}} |