2024-02-23 11:22:28 +01:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
2024-02-23 11:43:23 +01:00
|
|
|
"strconv"
|
2024-02-23 11:22:28 +01:00
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
|
|
|
"git.jmbit.de/jmb/goipam/db"
|
|
|
|
"git.jmbit.de/jmb/goipam/web/templates"
|
|
|
|
)
|
|
|
|
|
|
|
|
func getSubnetsPage(c *gin.Context) {
|
|
|
|
subnets := db.SubnetsList(&db.Subnet{}, -1, -1, "")
|
2024-02-23 11:43:23 +01:00
|
|
|
c.HTML(http.StatusOK, "", templates.SubnetsPage(templates.GenMetaContent(c), subnets, nil))
|
2024-02-23 11:22:28 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func getSubnetDetails(c *gin.Context) {
|
2024-02-23 11:43:23 +01:00
|
|
|
subnetID, err := strconv.Atoi(c.Param("id"))
|
|
|
|
c.Errors = append(c.Errors, &gin.Error{Err: err, Type: gin.ErrorTypeAny})
|
|
|
|
|
|
|
|
subnet := db.SubnetByID(subnetID)
|
2024-02-23 11:22:28 +01:00
|
|
|
}
|