1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{template "head" .}}
<h1>Status</h1>
{{if .Session}}<div class="banner ok">Logged in as <b>{{.Session.Name}}</b> ({{.Session.Username}}). <a href="/login">Replace the session</a>.</div>{{end}}
<p>Polling every {{.Poll}} (activity stream and messages; this is also what keeps the session alive), full sync every {{.Full}}.
{{if .Running}}A <b>{{.Running}}</b> sync is running since {{when .RunningSince}}.{{end}}</p>
<form method="post" action="/sync"><button {{if not .Session}}disabled{{end}}>Sync everything now</button></form>

<h2>Mirror</h2>
<p>{{.Totals.Courses}} courses · {{.Totals.Files}} files, {{.Totals.Stored}} stored ({{.Totals.Versions}} versions, {{size .Totals.Bytes}}) ·
{{.Totals.News}} news · {{.Totals.Messages}} messages · {{.Totals.Postings}} forum postings · {{.Totals.Events}} dates · {{.Totals.Wiki}} wiki pages · {{.Totals.Info}} information pages</p>
{{range .Failing}}<p class="banner">Sync of <a href="/course/{{.ID}}">{{.Title}}</a> failed: {{.SyncError}}</p>{{end}}
{{if .Docs}}<h3>Documents whose view is incomplete</h3>
<p class="muted">Word documents and presentations whose file page shows not all of the document; open the original for these.</p>
<ul>{{range .Docs}}<li><a href="/file/{{.File.ID}}">{{.File.Name}}</a> <span class="muted">({{.File.CourseTitle}})</span> — {{.Findings}}</li>{{end}}</ul>{{end}}

<h2>Sessions</h2>
<p class="muted">“alive for” runs from pasting to the last request Stud.IP answered. For a dead session the real lifetime lies between that and the death — this is how long a pasted cookie lasts.</p>
<table>
<tr><th>#</th><th>pasted</th><th>alive for</th><th>state</th><th class="num">requests</th><th class="num">rotations</th></tr>
{{range .Sessions}}<tr>
  <td>{{.ID}}</td><td class="nowrap">{{when .Pasted}}</td><td>{{.Lifetime}}</td>
  <td>{{if .Alive}}<span class="tag new">alive</span> last answer {{ago .LastOK}}{{else}}died {{when .Died}} <span class="muted">{{.Reason}}</span>{{end}}</td>
  <td class="num">{{.Requests}}</td><td class="num">{{.Rotations}}</td>
</tr>{{else}}<tr><td colspan="6" class="muted">None yet. <a href="/login">Log in</a>.</td></tr>{{end}}
</table>

<h2>Sync runs</h2>
<table>
<tr><th>started</th><th>kind</th><th>took</th><th class="num">requests</th><th class="num">downloads</th><th></th></tr>
{{range .Runs}}<tr>
  <td class="nowrap">{{when .Started}}</td><td>{{.Kind}}</td>
  <td>{{if .Finished.IsZero}}running{{else}}{{.Duration}}{{end}}</td>
  <td class="num">{{.Requests}}</td><td class="num">{{.Downloaded}}</td>
  <td>{{if .Error}}<span class="tag gone">error</span> <span class="muted">{{.Error}}</span>{{end}}</td>
</tr>{{else}}<tr><td colspan="6" class="muted">No runs yet.</td></tr>{{end}}
</table>
{{template "foot" .}}