Add initial support for multiple servers
This commit is contained in:
parent
11f0b09725
commit
2d0e07b59f
|
@ -61,12 +61,13 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
data := serverData{
|
data := []serverData{}
|
||||||
|
data = append(data, serverData{
|
||||||
*serverAddr,
|
*serverAddr,
|
||||||
34197,
|
34197,
|
||||||
"Server with Bob's Mod, est. Feb 2020",
|
"Server with Bob's Mod, est. Feb 2020",
|
||||||
playersOnline,
|
playersOnline,
|
||||||
}
|
})
|
||||||
|
|
||||||
t.Execute(w, data)
|
t.Execute(w, data)
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,11 +10,15 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>blackolivepineapple.pizza Factorio Server</h1>
|
<h1>blackolivepineapple.pizza Factorio Servers</h1>
|
||||||
|
{{range .}}
|
||||||
|
<h3>{{.Title}}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Connection String:</b> {{.IPAddr}}{{if ne .Port 34197}}:{{.Port}}{{end}}</li>
|
<li><b>Connection String:</b> {{.IPAddr}}{{if ne .Port 34197}}:{{.Port}}{{end}}</li>
|
||||||
|
<li><b>Version:</b> {{.Version}}</li>
|
||||||
<li><b>Server Name:</b> {{.Title}}</li>
|
<li><b>Server Name:</b> {{.Title}}</li>
|
||||||
<li><b>Current players:</b><br>{{.Players}}</li>
|
<li><b>Current players:</b><br>{{.Players}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{{end}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue