#77: Make page logo customizable
This commit is contained in:
@ -5,17 +5,22 @@ import (
|
||||
"html/template"
|
||||
)
|
||||
|
||||
const defaultTitle = "Health Dashboard | Gatus"
|
||||
const (
|
||||
defaultTitle = "Health Dashboard | Gatus"
|
||||
defaultLogo = ""
|
||||
)
|
||||
|
||||
// UIConfig is the configuration for the UI of Gatus
|
||||
type UIConfig struct {
|
||||
Title string `yaml:"title"` // Title of the page
|
||||
Logo string `yaml:"logo"` // Logo to display on the page
|
||||
}
|
||||
|
||||
// GetDefaultUIConfig returns a UIConfig struct with the default values
|
||||
func GetDefaultUIConfig() *UIConfig {
|
||||
return &UIConfig{
|
||||
Title: defaultTitle,
|
||||
Logo: defaultLogo,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,4 +18,7 @@ func TestGetDefaultUIConfig(t *testing.T) {
|
||||
if defaultUIConfig.Title != defaultTitle {
|
||||
t.Error("expected GetDefaultUIConfig() to return defaultTitle, got", defaultUIConfig.Title)
|
||||
}
|
||||
if defaultUIConfig.Logo != defaultLogo {
|
||||
t.Error("expected GetDefaultUIConfig() to return defaultLogo, got", defaultUIConfig.Logo)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user