internal/assets/overview.tmpl
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{{ template "header.tmpl" . }}
<div class="row">
<div class="col-md-12">
<p>Add a new service:</p>
<form action="/add" method="POST">
<input type="text" name="path" placeholder="Go module URL" required style="width: 300px;">
<button type="submit">Add</button>
</form>
<h1>services</h1>
<table class="table">
<tbody><tr>
<th width="20%">path</th>
<th width="8%">status</th>
<th width="72%">last log line</th>
</tr>
{{ range $idx, $svc := .Services }}
<tr>
<td>
<a href="/status?path={{ $svc.Name }}">{{ $svc.Name }}</a>
</td>
<td>
{{ if restarting $svc.Started }}
<span class="label label-danger">restarting</span>
{{ end }}
{{ if $svc.Stopped }}
<span class="label label-default">stopped</span>
{{ else if not (restarting $svc.Started) }}
<span class="label label-success">running</span>
{{ end }}
</td>
<td class="lastlog">
{{ if $svc.Stdout.Lines }}
<small>stdout: </small>{{last $svc.Stdout.Lines }}<br/>
{{ end }}
{{ if $svc.Stderr.Lines }}
<small>stderr: </small>{{last $svc.Stderr.Lines }}<br/>
{{ end }}
</td>
</tr>
{{ end }}
</table>
</div>
<div class="col-md-12">
<h2>memory</h2>
{{ megabytes (index .Meminfo "MemTotal") }} total, {{ megabytes (index .Meminfo "MemAvailable") }} available<br>
<strong>resident set size (RSS) by service</strong>:
<div class="progress">
{{ with $rss := initRss }}
<div class="progress-bar" style="width: {{ rssPercentage $.Meminfo $rss }}%" title="init uses {{ megabytes $rss }} RSS">
<span class="sr-only"></span>
init
</div>
{{ end }}
{{ range $idx, $svc := .Services }}
{{ with $rss := $svc.RSS }}
<div class="progress-bar" style="width: {{ rssPercentage $.Meminfo $rss }}%" title="{{ $svc.Name }} uses {{ megabytes $rss }} RSS">
<span class="sr-only"></span>
{{ baseName $svc.Name }}
</div>
{{ end }}
{{ end }}
<div class="progress-bar" style="width: 100%; overflow:initial; float: none" title="memory usage outside of gokrazy services">
<span class="sr-only"></span>
unaccounted
</div>
</div>
</div>
<div class="col-md-12">
</div>
</div>
{{ template "footer.tmpl" . }}