goipam/web/ui/index.go

27 lines
553 B
Go
Raw Normal View History

2024-02-22 10:18:59 +01:00
package ui
import (
"net/http"
"github.com/gin-gonic/gin"
2024-02-22 20:52:37 +01:00
"git.jmbit.de/jmb/goipam/db"
2024-02-22 10:18:59 +01:00
"git.jmbit.de/jmb/goipam/utils"
"git.jmbit.de/jmb/goipam/web/templates"
)
func index(c *gin.Context) {
2024-02-22 20:52:37 +01:00
counters := templates.IndexCounts{
AddressCount: db.CountAddresss(),
SubnetCount: db.CountSubnets(),
DeviceCount: db.CountDevices(),
LocationCount: db.CountLocations(),
}
c.HTML(http.StatusOK, "", templates.Index(utils.GenMetaContent(c), counters, nil))
2024-02-22 10:18:59 +01:00
}
2024-02-23 11:22:28 +01:00
func getEmpty(c *gin.Context) {
c.HTML(http.StatusOK, "", templates.Empty())
}