add hostname to footer text
This commit is contained in:
@@ -2,7 +2,9 @@ package webcontroller
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -19,6 +21,8 @@ type WebController struct {
|
||||
|
||||
resourceDir string
|
||||
|
||||
hostname string
|
||||
|
||||
apiURLInternal string
|
||||
apiURLExternal string
|
||||
|
||||
@@ -40,6 +44,7 @@ func New(
|
||||
maintenanceMode bool,
|
||||
debugMode bool,
|
||||
) (wc *WebController) {
|
||||
var err error
|
||||
wc = &WebController{
|
||||
resourceDir: resourceDir,
|
||||
apiURLInternal: apiURLInternal,
|
||||
@@ -49,6 +54,10 @@ func New(
|
||||
wc.templates = NewTemplateManager(resourceDir, apiURLExternal, debugMode)
|
||||
wc.templates.ParseTemplates(false)
|
||||
|
||||
if wc.hostname, err = os.Hostname(); err != nil {
|
||||
panic(fmt.Errorf("Could not get hostname: %s", err))
|
||||
}
|
||||
|
||||
var p = prefix
|
||||
|
||||
// Serve static files
|
||||
|
Reference in New Issue
Block a user