Better UI for admin settings (#30)

This commit is contained in:
Thomas Miceli
2023-05-11 15:16:05 +02:00
committed by GitHub
parent 089d321898
commit 5fe84164a5
6 changed files with 74 additions and 33 deletions

View File

@ -185,6 +185,14 @@ func adminSyncReposFromDB(ctx echo.Context) error {
return redirect(ctx, "/admin-panel")
}
func adminSettings(ctx echo.Context) error {
setData(ctx, "title", "Admin Settings")
setData(ctx, "htmlTitle", "Admin Settings - Admin panel")
setData(ctx, "adminHeaderPage", "settings")
return html(ctx, "admin_settings.html")
}
func adminSetSetting(ctx echo.Context) error {
key := ctx.FormValue("key")
value := ctx.FormValue("value")

View File

@ -188,6 +188,7 @@ func Start() {
g2.POST("/gists/:gist/delete", adminGistDelete)
g2.POST("/sync-fs", adminSyncReposFromFS)
g2.POST("/sync-db", adminSyncReposFromDB)
g2.GET("/settings", adminSettings)
g2.PUT("/set-setting", adminSetSetting)
}