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
| {% import ( "runtime/debug"
"{{{ .Package }}}/app" "{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/app/util" "{{{ .Package }}}/views/components" "{{{ .Package }}}/views/components/view" "{{{ .Package }}}/views/layout" ) %}
{% code type Modules struct { layout.Basic Modules []*debug.Module Version string } %}
{% func (p *Modules) Body(as *app.State, ps *cutil.PageState) %} <div class="card"> <div class="right">{%s util.AppName %} v{%s p.Version %}</div> <h3>{%= components.SVGIcon(`archive`, ps) %} Go Modules</h3> {%= moduleTable(p.Modules, ps) %} </div> {% endfunc %}
{% func moduleTable(mods []*debug.Module, ps *cutil.PageState) %} <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>{%= view.URL("https://" + m.Path, m.Path, true, ps) %}</td> <td title="{%s m.Sum %}">{%s m.Version %}</td> </tr> {%- endfor -%} </tbody> </table> </div> {% endfunc %}
|