Fixing build issues
This commit is contained in:
parent
921af2f1b0
commit
a4dd48007d
|
@ -85,7 +85,7 @@ func parseCommand(user *gumble.User, username, command string) {
|
|||
// Web command
|
||||
case dj.conf.Aliases.WebAlias:
|
||||
if dj.HasPermission(username, dj.conf.Permissions.AdminWeb) {
|
||||
GetWebAddress(user)
|
||||
web.GetWebAddress(user)
|
||||
} else {
|
||||
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
|
||||
}
|
||||
|
|
4
main.go
4
main.go
|
@ -172,6 +172,8 @@ var dj = mumbledj{
|
|||
cache: NewSongCache(),
|
||||
}
|
||||
|
||||
var web *Webserver
|
||||
|
||||
// main primarily performs startup tasks. Grabs and parses commandline
|
||||
// args, sets up the gumble client and its listeners, and then connects to the server.
|
||||
func main() {
|
||||
|
@ -242,7 +244,7 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
Webserver(9563)
|
||||
web = Webserver(9563)
|
||||
|
||||
<-dj.keepAlive
|
||||
}
|
||||
|
|
3
web.go
3
web.go
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
|
@ -43,7 +44,7 @@ func (web WebServer) homepage(w http.ResponseWriter, r *http.Request) {
|
|||
fmt.Fprintf(w, "Invalid Token")
|
||||
} else {
|
||||
t, _ := template.ParseFiles("index.html")
|
||||
t.Execute(w, Page{"http://" + getIp() + ":" + web.port + "/", r.URL.Path[1:]})
|
||||
t.Execute(w, Page{"http://" + getIP() + ":" + web.port + "/", r.URL.Path[1:]})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue