goipam/web/templates/index.templ

44 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-02-22 20:52:37 +01:00
package templates
import "fmt"
2024-02-23 11:22:28 +01:00
import "git.jmbit.de/jmb/goipam/utils"
2024-02-22 20:52:37 +01:00
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">
2024-02-23 11:22:28 +01:00
<a href="/subnets/">
2024-02-22 20:52:37 +01:00
<p class="heading">Subnets</p>
<p class="title">{ fmt.Sprint(counters.SubnetCount) }</p>
2024-02-23 11:22:28 +01:00
</a>
2024-02-22 20:52:37 +01:00
</div>
<div class="level-item has-text-centered">
2024-02-23 11:22:28 +01:00
<a href="/addresses/">
2024-02-22 20:52:37 +01:00
<p class="heading">Addresses</p>
<p class="title">{ fmt.Sprint(counters.AddressCount) }</p>
2024-02-23 11:22:28 +01:00
</a>
2024-02-22 20:52:37 +01:00
</div>
<div class="level-item has-text-centered">
2024-02-23 11:22:28 +01:00
<a href="/devices/">
2024-02-22 20:52:37 +01:00
<p class="heading">Devices</p>
<p class="title">{ fmt.Sprint(counters.DeviceCount) }</p>
2024-02-23 11:22:28 +01:00
</a>
2024-02-22 20:52:37 +01:00
</div>
<div class="level-item has-text-centered">
2024-02-23 11:22:28 +01:00
<a href="/locations/">
2024-02-22 20:52:37 +01:00
<p class="heading">Locations</p>
<p class="title">{ fmt.Sprint(counters.LocationCount) }</p>
2024-02-23 11:22:28 +01:00
</a>
2024-02-22 20:52:37 +01:00
</div>
</div>
}