Add initial support for multiple servers

This commit is contained in:
Chandler Swift 2020-03-29 21:29:00 -05:00
parent 11f0b09725
commit 2d0e07b59f
2 changed files with 13 additions and 8 deletions

View file

@ -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)
})

View file

@ -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>