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