Core

/views/vadmin/Modules.html (1.1 KB)

 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
{% import (
"runtime/debug"

"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/layout"
) %}

{% code type Modules struct {
layout.Basic
Modules []*debug.Module
} %}

{% func (p *Modules) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<div class="right">{%s util.AppName %} v{%s as.BuildInfo.Version %}</div>
<h3>Go Modules</h3>
{%= moduleTable(p.Modules) %}
</div>
{% endfunc %}

{% func moduleTable(mods []*debug.Module) %}
<div class="overflow full-width">
<table class="mt">
<thead>
<tr>
<th>Name</th>
<th>Version</th>
</tr>
</thead>
<tbody>
{%- for _, m := range mods -%}
<tr>
<td><a target="_blank" rel="noopener noreferrer" href="https://{%s m.Path %}">{%s m.Path %}</a></td>
<td title="{%s m.Sum %}">{%s m.Version %}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
{% endfunc %}