mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-12 13:37:13 +02:00
Change /admin route to /admin-panel (#1)
This commit is contained in:
@ -101,7 +101,7 @@ func adminUserDelete(ctx echo.Context) error {
|
||||
}
|
||||
|
||||
addFlash(ctx, "User has been deleted", "success")
|
||||
return redirect(ctx, "/admin/users")
|
||||
return redirect(ctx, "/admin-panel/users")
|
||||
}
|
||||
|
||||
func adminGistDelete(ctx echo.Context) error {
|
||||
@ -119,7 +119,7 @@ func adminGistDelete(ctx echo.Context) error {
|
||||
}
|
||||
|
||||
addFlash(ctx, "Gist has been deleted", "success")
|
||||
return redirect(ctx, "/admin/gists")
|
||||
return redirect(ctx, "/admin-panel/gists")
|
||||
}
|
||||
|
||||
func adminSyncReposFromFS(ctx echo.Context) error {
|
||||
@ -148,7 +148,7 @@ func adminSyncReposFromFS(ctx echo.Context) error {
|
||||
}
|
||||
syncReposFromFS = false
|
||||
}()
|
||||
return redirect(ctx, "/admin")
|
||||
return redirect(ctx, "/admin-panel")
|
||||
}
|
||||
|
||||
func adminSyncReposFromDB(ctx echo.Context) error {
|
||||
@ -180,5 +180,5 @@ func adminSyncReposFromDB(ctx echo.Context) error {
|
||||
syncReposFromDB = false
|
||||
return
|
||||
}()
|
||||
return redirect(ctx, "/admin")
|
||||
return redirect(ctx, "/admin-panel")
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ func Start() {
|
||||
g1.POST("/settings/ssh-keys", sshKeysProcess, logged)
|
||||
g1.DELETE("/settings/ssh-keys/:id", sshKeysDelete, logged)
|
||||
|
||||
g2 := g1.Group("/admin")
|
||||
g2 := g1.Group("/admin-panel")
|
||||
{
|
||||
g2.Use(adminPermission)
|
||||
g2.GET("", adminIndex)
|
||||
|
@ -148,7 +148,7 @@ func validateReservedKeywords(fl validator.FieldLevel) bool {
|
||||
name := fl.Field().String()
|
||||
|
||||
restrictedNames := map[string]struct{}{}
|
||||
for _, restrictedName := range []string{"assets", "register", "login", "logout", "config", "admin", "all"} {
|
||||
for _, restrictedName := range []string{"assets", "register", "login", "logout", "config", "admin-panel", "all"} {
|
||||
restrictedNames[restrictedName] = struct{}{}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user