add hostname to footer text
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
Bye!
|
Bye!
|
||||||
</p>
|
</p>
|
||||||
</div></div>
|
</div></div>
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
{{template "analytics"}}
|
{{template "analytics"}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -112,7 +112,7 @@
|
|||||||
<a href="mailto:support@pixeldrain.com">support@pixeldrain.com</a>
|
<a href="mailto:support@pixeldrain.com">support@pixeldrain.com</a>
|
||||||
</p>
|
</p>
|
||||||
</div></div>
|
</div></div>
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
{{template "analytics"}}
|
{{template "analytics"}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
{{template "analytics"}}
|
{{template "analytics"}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
Fornax
|
Fornax
|
||||||
{{end}}
|
{{end}}
|
||||||
</div></div>
|
</div></div>
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
{{template "analytics"}}
|
{{template "analytics"}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -48,6 +48,10 @@
|
|||||||
Twitter: <a href="https://twitter.com/Fornax96" target="_blank">@Fornax96</a>
|
Twitter: <a href="https://twitter.com/Fornax96" target="_blank">@Fornax96</a>
|
||||||
Reddit: <a href="https://reddit.com/r/pixeldrain" target="_blank">/r/pixeldrain</a>
|
Reddit: <a href="https://reddit.com/r/pixeldrain" target="_blank">/r/pixeldrain</a>
|
||||||
Medium: <a href="https://medium.com/pixeldrain" target="_blank">Pixeldrain</a>
|
Medium: <a href="https://medium.com/pixeldrain" target="_blank">Pixeldrain</a>
|
||||||
|
<br/>
|
||||||
|
<span class="small_footer_text" style="font-size: .75em; line-height: .75em;">
|
||||||
|
page rendered by {{.Hostname}}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- end page_body -->
|
</div><!-- end page_body -->
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@@ -147,7 +147,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
'use strict';
|
'use strict';
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
</div></div>
|
</div></div>
|
||||||
{{template "page_bottom"}}
|
{{template "page_bottom" .}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@@ -30,6 +30,7 @@ type TemplateData struct {
|
|||||||
UserStyle template.CSS
|
UserStyle template.CSS
|
||||||
APIEndpoint template.URL
|
APIEndpoint template.URL
|
||||||
PixelAPI *pixelapi.PixelAPI
|
PixelAPI *pixelapi.PixelAPI
|
||||||
|
Hostname template.HTML
|
||||||
|
|
||||||
// Only used on file viewer page
|
// Only used on file viewer page
|
||||||
Title string
|
Title string
|
||||||
@@ -50,6 +51,7 @@ func (wc *WebController) newTemplateData(w http.ResponseWriter, r *http.Request)
|
|||||||
Style: userStyle(r),
|
Style: userStyle(r),
|
||||||
UserStyle: template.CSS(userStyle(r).String()),
|
UserStyle: template.CSS(userStyle(r).String()),
|
||||||
APIEndpoint: template.URL(wc.apiURLExternal),
|
APIEndpoint: template.URL(wc.apiURLExternal),
|
||||||
|
Hostname: template.HTML(wc.hostname),
|
||||||
URLQuery: r.URL.Query(),
|
URLQuery: r.URL.Query(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,9 @@ package webcontroller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
@@ -19,6 +21,8 @@ type WebController struct {
|
|||||||
|
|
||||||
resourceDir string
|
resourceDir string
|
||||||
|
|
||||||
|
hostname string
|
||||||
|
|
||||||
apiURLInternal string
|
apiURLInternal string
|
||||||
apiURLExternal string
|
apiURLExternal string
|
||||||
|
|
||||||
@@ -40,6 +44,7 @@ func New(
|
|||||||
maintenanceMode bool,
|
maintenanceMode bool,
|
||||||
debugMode bool,
|
debugMode bool,
|
||||||
) (wc *WebController) {
|
) (wc *WebController) {
|
||||||
|
var err error
|
||||||
wc = &WebController{
|
wc = &WebController{
|
||||||
resourceDir: resourceDir,
|
resourceDir: resourceDir,
|
||||||
apiURLInternal: apiURLInternal,
|
apiURLInternal: apiURLInternal,
|
||||||
@@ -49,6 +54,10 @@ func New(
|
|||||||
wc.templates = NewTemplateManager(resourceDir, apiURLExternal, debugMode)
|
wc.templates = NewTemplateManager(resourceDir, apiURLExternal, debugMode)
|
||||||
wc.templates.ParseTemplates(false)
|
wc.templates.ParseTemplates(false)
|
||||||
|
|
||||||
|
if wc.hostname, err = os.Hostname(); err != nil {
|
||||||
|
panic(fmt.Errorf("Could not get hostname: %s", err))
|
||||||
|
}
|
||||||
|
|
||||||
var p = prefix
|
var p = prefix
|
||||||
|
|
||||||
// Serve static files
|
// Serve static files
|
||||||
|
Reference in New Issue
Block a user