Core

/views/vadmin/ServerInfo.html (1.0 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
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/layout"
) %}

{% code type ServerInfo struct {
layout.Basic
Info *util.DebugInfo
} %}

{% func (p *ServerInfo) Body(as *app.State, ps *cutil.PageState) %}
{%= renderTags("Server Information", p.Info.ServerTags) %}
{%= renderTags("Runtime Information", p.Info.RuntimeTags) %}
{%= renderTags("App Information", p.Info.AppTags) %}
<div class="card">
<h3>Go Modules</h3>
{%= moduleTable(p.Info.Mods) %}
</div>
{% endfunc %}

{% func renderTags(title string, tags *util.OrderedMap[string]) %}
<div class="card">
<h3>{%s title %}</h3>
<div class="overflow full-width">
<table class="mt min-200">
<tbody>
{%- for _, k := range tags.Order -%}
<tr>
<th class="shrink">{%s k %}</th>
<td>{%s tags.GetSimple(k) %}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
</div>
{% endfunc %}