Add log buffer site

This commit is contained in:
2020-10-12 00:16:23 +02:00
parent 2a1ef7f2cb
commit 866a7a8b81
8 changed files with 134 additions and 2 deletions

View File

@@ -4,10 +4,11 @@ import (
"github.com/gin-gonic/gin"
"github.com/jackc/pgx/v4/pgxpool"
"trikotwaschliste/handler"
"trikotwaschliste/logbuffer"
"trikotwaschliste/models"
)
func RoutesInit(router *gin.Engine, pool *pgxpool.Pool, config *models.Config) {
func RoutesInit(router *gin.Engine, pool *pgxpool.Pool, config *models.Config, logbuf *logbuffer.Queue) {
router.GET("/", handler.MainPage(pool))
router.GET("/credits", handler.Credits())
router.POST("/uploadname", handler.UploadName(pool))
@@ -22,5 +23,6 @@ func RoutesInit(router *gin.Engine, pool *pgxpool.Pool, config *models.Config) {
// Basic auth routes
authorized.GET("/", handler.AdminMainPage(pool))
authorized.POST("/changename", handler.ChangeName(pool))
authorized.GET("/logs", handler.Logs(logbuf))
}