mirror of
https://github.com/Octops/quake-kube.git
synced 2026-04-12 13:00:34 +00:00
Fix config map time limit and commands, add client password
This commit is contained in:
@ -48,8 +48,19 @@ func NewRouter(cfg *Config) (*echo.Echo, error) {
|
||||
|
||||
// default route
|
||||
e.GET("/", func(c echo.Context) error {
|
||||
return c.Render(http.StatusOK, "index", map[string]string{
|
||||
m, err := quakenet.GetInfo(cfg.ServerAddr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
needsPass := false
|
||||
if v, ok := m["g_needpass"]; ok {
|
||||
if v == "1" {
|
||||
needsPass = true
|
||||
}
|
||||
}
|
||||
return c.Render(http.StatusOK, "index", map[string]interface{}{
|
||||
"ServerAddr": cfg.ServerAddr,
|
||||
"NeedsPass": needsPass,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user