69 lines
2.5 KiB
HTML
69 lines
2.5 KiB
HTML
<!doctype html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta http-equiv="refresh" content="5">
|
|
<title>jellybit</title>
|
|
<style>
|
|
:root { color-scheme: light dark; }
|
|
body { font-family: system-ui, sans-serif; max-width: 60rem; margin: 2rem auto; padding: 0 1rem; }
|
|
h1 { margin-bottom: .25rem; }
|
|
form.add { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
|
|
form.add input[name=source] { flex: 1 1 24rem; }
|
|
input, button { padding: .4rem .6rem; font-size: 1rem; }
|
|
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
|
|
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid #8884; vertical-align: top; }
|
|
td.src { font-family: monospace; font-size: .85rem; word-break: break-all; }
|
|
.err { color: #c0392b; }
|
|
.state { font-size: .8rem; padding: .1rem .5rem; border-radius: 1rem; background: #8883; white-space: nowrap; }
|
|
.state-completed { background: #2ecc7155; }
|
|
.state-downloading { background: #3498db55; }
|
|
.state-stuck { background: #f39c1255; }
|
|
.state-failed { background: #e74c3c55; }
|
|
.state-cancelled { background: #95a5a655; }
|
|
small { color: #8888; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>jellybit</h1>
|
|
<p><small>обновляется каждые 5 с</small></p>
|
|
|
|
<form class="add" method="post" action="/ui/downloads">
|
|
<input type="text" name="source" placeholder="magnet:?xt=urn:btih:…" required>
|
|
<input type="text" name="context" placeholder="контекст (опц.)">
|
|
<button type="submit">Добавить</button>
|
|
</form>
|
|
|
|
{{if .Error}}<p class="err">{{.Error}}</p>{{end}}
|
|
|
|
<table>
|
|
<thead>
|
|
<tr><th>#</th><th>Источник</th><th>Контекст</th><th>Состояние</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Downloads}}
|
|
<tr>
|
|
<td>{{.ID}}</td>
|
|
<td class="src" title="{{.Infohash}}">{{.Source}}</td>
|
|
<td>{{.Context}}</td>
|
|
<td>
|
|
<span class="state state-{{.State}}">{{.State}}</span>
|
|
{{if .Error}}<br><small>{{.Error}}</small>{{end}}
|
|
</td>
|
|
<td>
|
|
{{if not .Terminal}}
|
|
<form method="post" action="/ui/downloads/{{.ID}}/cancel">
|
|
<button type="submit">Отклонить</button>
|
|
</form>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr><td colspan="5"><small>пока пусто</small></td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|