mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 18:26:36 +08:00
migrate
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package dashboard
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/openflare/compat"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// RegisterRoutes mounts legacy OpenFlare dashboard routes.
|
||||
func RegisterRoutes(apiGroup *gin.RouterGroup) {
|
||||
dashboardRoute := apiGroup.Group("/dashboard")
|
||||
dashboardRoute.Use(compat.AdminAuth())
|
||||
{
|
||||
dashboardRoute.GET("/overview", getOverviewHandler)
|
||||
}
|
||||
}
|
||||
|
||||
func getOverviewHandler(c *gin.Context) {
|
||||
overview, err := GetOverview(c.Request.Context())
|
||||
if err != nil {
|
||||
compat.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
compat.OK(c, overview)
|
||||
}
|
||||
Reference in New Issue
Block a user