OpenAI-compatible AI gateway with Vue admin UI, multi-provider egress, ingress key governance, monitoring, and security controls. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rose_cat707/luminary/internal/settings"
|
||||
)
|
||||
|
||||
func (h *Handler) GetSettings(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, h.settings.PublicView())
|
||||
}
|
||||
|
||||
func (h *Handler) UpdateSettings(c *gin.Context) {
|
||||
var in settings.UpdateInput
|
||||
if err := c.ShouldBindJSON(&in); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"})
|
||||
return
|
||||
}
|
||||
if err := h.settings.Update(in); err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
h.loginLimit.Configure(h.settings.LoginMaxAttempts(), h.settings.LoginLockout())
|
||||
if h.monitor != nil {
|
||||
h.monitor.NotifySettingsChanged()
|
||||
}
|
||||
c.JSON(http.StatusOK, h.settings.PublicView())
|
||||
}
|
||||
Reference in New Issue
Block a user