mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
b7d38590ba
- Introduced NodeAccessLog model and corresponding database migrations. - Implemented access log retrieval in the service layer. - Created API endpoint for accessing logs with appropriate security measures. - Developed frontend components for displaying access logs, including filtering and summary statistics. - Updated observability buffer to include access logs and ensure proper merging and retention. - Enhanced traffic report and observability tests to validate new access log features. - Updated documentation to reflect changes in access log handling and data retention policies.
23 lines
508 B
Go
23 lines
508 B
Go
package controller
|
|
|
|
import "atsflare/service"
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
// GetAccessLogs godoc
|
|
// @Summary List access logs
|
|
// @Tags AccessLogs
|
|
// @Produce json
|
|
// @Security BearerAuth
|
|
// @Param node_id query string false "Node ID"
|
|
// @Success 200 {object} map[string]interface{}
|
|
// @Router /api/access-logs/ [get]
|
|
func GetAccessLogs(c *gin.Context) {
|
|
logs, err := service.ListAccessLogs(c.Query("node_id"))
|
|
if err != nil {
|
|
respondFailure(c, err.Error())
|
|
return
|
|
}
|
|
respondSuccess(c, logs)
|
|
}
|