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/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(),
|
|
|
|
}
|
|
|
|
|
2024-02-23 18:39:05 +01:00
|
|
|
c.HTML(http.StatusOK, "", templates.Index(templates.GenMetaContent(c), counters))
|
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())
|
|
|
|
}
|