goipam/web/ui/routes.go

31 lines
800 B
Go

package ui
import (
"github.com/gin-gonic/gin"
)
func GroupWeb(router *gin.Engine) *gin.Engine {
router.GET("/index.html", index)
router.GET("/", index)
router.POST("/", index)
router.GET("/login.html", getLogin)
router.GET("/logout.html", getLogout)
router.POST("/login.html", postLogin)
router.GET("/profile/", getProfile)
router.GET("/empty.html", getEmpty)
subnetsGroup := router.Group("/subnets")
subnetsGroup.GET("/", getSubnetsPage)
subnetsGroup.GET("/new")
subnetsGroup.GET("/details/:id")
subnetsGroup.GET("/edit/:id")
subnetsGroup.POST("/edit/:id")
addressGroup := router.Group("/addresses")
addressGroup.GET("/", getSubnetsPage)
addressGroup.GET("/new")
addressGroup.GET("/details/:id")
addressGroup.GET("/edit/:id")
addressGroup.POST("/edit/:id")
return router
}