|
|
|
|
@ -19,10 +19,24 @@ func GetPageSelectOne(c *fiber.Ctx) error { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func GetPageContent(c *fiber.Ctx) error { |
|
|
|
|
_, err := AuthCheck(c, true) |
|
|
|
|
if err != nil { return c.Redirect("/") } |
|
|
|
|
|
|
|
|
|
table := c.Params("table") |
|
|
|
|
|
|
|
|
|
headers := Schema(table) |
|
|
|
|
|
|
|
|
|
return c.Render("admin/table/contents", fiber.Map{ |
|
|
|
|
"table": table, |
|
|
|
|
"headers": headers, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func SetupPages(app *fiber.App) { |
|
|
|
|
AddAuthedPage(app, true, "admin/table/", "admin/table/index") |
|
|
|
|
AddAuthedPage(app, true, "admin/table/:table/", "admin/table/contents") |
|
|
|
|
AddAuthedPage(app, true, "admin/table/new/:table/", "admin/table/new") |
|
|
|
|
|
|
|
|
|
app.Get("admin/table/:table/", GetPageContent) |
|
|
|
|
app.Get("/admin/table/:table/:id/", GetPageSelectOne) |
|
|
|
|
} |
|
|
|
|
|