goipam/web/templates/index.templ

44 lines
1.1 KiB
Plaintext

package templates
import "fmt"
import "git.jmbit.de/jmb/goipam/utils"
templ Index(metaContent utils.MetaContent, counters IndexCounts, err error) {
@wrapBase(metaContent, "GoIPAM", err) {
<div class="section is-centered">
<div class="container">
@indexStats(counters)
</div>
</div>
}
}
templ indexStats(counters IndexCounts) {
<div class="level mt-5 box">
<div class="level-item has-text-centered">
<a href="/subnets/">
<p class="heading">Subnets</p>
<p class="title">{ fmt.Sprint(counters.SubnetCount) }</p>
</a>
</div>
<div class="level-item has-text-centered">
<a href="/addresses/">
<p class="heading">Addresses</p>
<p class="title">{ fmt.Sprint(counters.AddressCount) }</p>
</a>
</div>
<div class="level-item has-text-centered">
<a href="/devices/">
<p class="heading">Devices</p>
<p class="title">{ fmt.Sprint(counters.DeviceCount) }</p>
</a>
</div>
<div class="level-item has-text-centered">
<a href="/locations/">
<p class="heading">Locations</p>
<p class="title">{ fmt.Sprint(counters.LocationCount) }</p>
</a>
</div>
</div>
}