Database UI

/views/vdatabase/List.html (768 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
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/lib/database"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/components"
"{{{ .Package }}}/views/layout"
) %}

{% code type List struct {
layout.Basic
Keys []string
Services map[string]*database.Service
} %}

{% func (p *List) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<h3>{%= components.SVGRefIcon(`database`, ps) %}Databases</h3>
<em>{%s util.StringPlural(len(p.Keys), "database") %} available</em>
</div>
{%- for _, key := range p.Keys -%}
<div class="card">
<h3><a href="/admin/database/{%s key %}">{%= components.SVGRefIcon(`database`, ps) %}{%s key %}</a></h3>
</div>
{%- endfor -%}
{% endfunc %}