Core

/views/vadmin/Routes.html (704 B)

 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
{% import (
"github.com/samber/lo"

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

{% code type Routes struct {
layout.Basic
Routes map[string][]string
} %}

{% func (p *Routes) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<h3>HTTP Routes</h3>
<ul class="mt">
{%- for _, k := range util.ArraySorted(lo.Keys(p.Routes)) -%}
<li>
<strong>{%s k %}</strong>
<ul>
{%- for _, r := range p.Routes[k] -%}
<li><code>{%s r %}</code></li>
{%- endfor -%}
</ul>
</li>
{%- endfor -%}
</ul>
</div>
{% endfunc %}