mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 06:25:35 +08:00
add AUTOMATIC entry to server list API for client compatibility
This commit is contained in:
18
web/data.go
18
web/data.go
@@ -145,6 +145,15 @@ func (s *Server) handleGetServersJSON(c *gin.Context) {
|
||||
ClientsConnectionAllowed: 99,
|
||||
IsSweatbox: isSweatbox,
|
||||
},
|
||||
{
|
||||
Ident: "AUTOMATIC",
|
||||
HostnameOrIp: serverHostname,
|
||||
Location: serverLocation,
|
||||
Name: serverIdent,
|
||||
ClientConnectionsAllowed: true,
|
||||
ClientsConnectionAllowed: 99,
|
||||
IsSweatbox: isSweatbox,
|
||||
},
|
||||
}
|
||||
|
||||
res, err := json.Marshal(&dataJson)
|
||||
@@ -190,6 +199,15 @@ func (s *Server) generateServersTxt() (txt string, err error) {
|
||||
ClientsConnectionAllowed: 99,
|
||||
IsSweatbox: false,
|
||||
},
|
||||
{
|
||||
Ident: "AUTOMATIC",
|
||||
HostnameOrIp: serverHostname,
|
||||
Location: serverLocation,
|
||||
Name: serverIdent,
|
||||
ClientConnectionsAllowed: true,
|
||||
ClientsConnectionAllowed: 99,
|
||||
IsSweatbox: false,
|
||||
},
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
|
||||
@@ -7,6 +7,7 @@ CONNECTED CLIENTS = 1
|
||||
;
|
||||
;
|
||||
!SERVERS:
|
||||
{{ range . }}{{ .Ident }}:{{ .HostnameOrIp }}:{{ .Location }}:{{ .Ident }}:{{ .ClientsConnectionAllowed }}:{{ end }}
|
||||
{{ range $index, $element := . }}{{ if $index }}
|
||||
{{ end }}{{ $element.Ident }}:{{ $element.HostnameOrIp }}:{{ $element.Location }}:{{ $element.Name }}:{{ $element.ClientsConnectionAllowed }}:{{ end }}
|
||||
;
|
||||
; END
|
||||
|
||||
Reference in New Issue
Block a user