feat(admin-panel): update url
feat(admin-panel): update some of the ui feat(oauth-screen): make oauth success screen match the rest of the app
This commit is contained in:
parent
3db5ec25c2
commit
f6ed4f1e2e
8 changed files with 79 additions and 34 deletions
|
|
@ -8,8 +8,6 @@ import (
|
|||
"github.com/router-for-me/CLIProxyAPI/v7/sdk/api/handlers/openai"
|
||||
)
|
||||
|
||||
const oauthCallbackSuccessHTML = `<html><head><meta charset="utf-8"><title>Authentication successful</title><script>setTimeout(function(){window.close();},5000);</script></head><body><h1>Authentication successful!</h1><p>You can close this window.</p><p>This window will close automatically in 5 seconds.</p></body></html>`
|
||||
|
||||
func (s *Server) setupRoutes() {
|
||||
healthzHandler := func(c *gin.Context) {
|
||||
if c.Request.Method == http.MethodHead {
|
||||
|
|
@ -21,8 +19,10 @@ func (s *Server) setupRoutes() {
|
|||
s.engine.GET("/healthz", healthzHandler)
|
||||
s.engine.HEAD("/healthz", healthzHandler)
|
||||
|
||||
s.engine.GET("/management.html", s.serveManagementControlPanel)
|
||||
s.engine.HEAD("/management.html", s.serveManagementControlPanel)
|
||||
s.engine.GET("/admin", s.serveManagementControlPanel)
|
||||
s.engine.HEAD("/admin", s.serveManagementControlPanel)
|
||||
s.engine.GET("/admin/oauth-success", s.serveManagementControlPanel)
|
||||
s.engine.HEAD("/admin/oauth-success", s.serveManagementControlPanel)
|
||||
s.engine.GET("/management-assets/*filepath", s.serveManagementAsset)
|
||||
s.engine.HEAD("/management-assets/*filepath", s.serveManagementAsset)
|
||||
|
||||
|
|
@ -59,7 +59,6 @@ func (s *Server) setupRoutes() {
|
|||
if state != "" {
|
||||
_, _ = managementHandlers.WriteOAuthCallbackFileForPendingSession(s.cfg.AuthDir, "codex", state, code, errStr)
|
||||
}
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
c.String(http.StatusOK, oauthCallbackSuccessHTML)
|
||||
c.Redirect(http.StatusSeeOther, "/admin/oauth-success")
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue