morffix/tmpl/index.tmpl
Samuel Lorch 57969cc07d
All checks were successful
/ release (push) Successful in 44s
Add Parallel Tasks Settings
2025-03-19 21:39:46 +01:00

136 lines
3.5 KiB
Cheetah

{{template "head"}}
<div class="counter">
{{ $l := len .Counter }}
{{range $i, $c := .Counter}}
<img class="counter-image" alt="{{$c}}" src="/static/counter/{{$c}}.gif">
{{ $n := sub $l $i }}
{{ if eq $n 4 }}
KB
{{ else if eq $n 7 }}
MB
{{ else if eq $n 10 }}
GB
{{ else if eq $n 13 }}
TB
{{end}}
{{end}}
</div>
<h2>Set Queue Enable</h2>
<form method="POST" action= "/queue_enable">
<label for="worker">Worker:</label>
<select id="worker" name="worker">
<option value="all">All</option>
{{range $w := .Workers}}
<option value="{{$w.ID}}">{{$w.Name}}</option>
{{end}}
</select>
<label for="enable">Enable</label>
<select id="enable" name="enable">
<option value="true">True</option>
<option value="false">False</option>
</select>
<input type="submit" value="Submit">
</form>
<h2>Set Queue Enable</h2>
<form method="POST" action= "/parallel_tasks">
<label for="worker">Worker:</label>
<select id="worker" name="worker">
<option value="all">All</option>
{{range $w := .Workers}}
<option value="{{$w.ID}}">{{$w.Name}}</option>
{{end}}
</select>
<label for="parallel_tasks">Parallel Tasks</label>
<select id="parallel_tasks" name="enable">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<input type="submit" value="Submit">
</form>
<h2>Workers</h2>
<div class="workers">
{{range $w := .Workers}}
<div>
<h4>{{ $w.Name }}</h4>
<table>
<tr>
<td>
Address
</td>
<td>
{{ $w.Address }}
</td>
</tr>
<tr>
<td>
Connected
</td>
<td>
{{ $w.Connected }}
</td>
</tr>
<tr>
<td>
ConnectionChanged
</td>
<td>
{{ $w.ConnectionChanged }}
</td>
</tr>
<tr>
<td>
QueueEnabled
</td>
<td>
{{ $w.QueueEnabled }}
</td>
</tr>
<tr>
<td>
ParallelTasks
</td>
<td>
{{ $w.ParallelTasks }}
</td>
</tr>
{{if $w.Connected}}
<tr>
<td>
CPUs
</td>
<td>
{{ $w.Status.CPUCount }}
</td>
</tr>
<tr>
<td>
CPU Usage
</td>
<td>
{{ $w.Status.CPUUsage }}%
</td>
</tr>
<tr>
<td>
Memory
</td>
<td>
{{ $w.Status.MemoryTotal }} GB
</td>
</tr>
<tr>
<td>
Memory Usage
</td>
<td>
{{ $w.Status.MemoryUsage }}%
</td>
</tr>
{{end}}
</table>
</div>
{{end}}
</div>
{{template "tail"}}