Skip to content

Commit c12179d

Browse files
committed
Aligned with spaces, changed feature name to DashboardHeading and DashboardSubheading
1 parent d738f78 commit c12179d

File tree

6 files changed

+53
-53
lines changed

6 files changed

+53
-53
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ If you want to test it locally, see [Docker](#docker).
258258
| `ui` | UI configuration. | `{}` |
259259
| `ui.title` | [Title of the document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title). | `Health Dashboard ǀ Gatus` |
260260
| `ui.description` | Meta description for the page. | `Gatus is an advanced...`. |
261-
| `ui.dashboard-title` | Dashboard title between header and endpoints | `Health Dashboard` |
262-
| `ui.dashboard-description` | Dashboard description between header and endpoints | `Monitor the health of your endpoints in real-time` |
261+
| `ui.dashboard-heading` | Dashboard title between header and endpoints | `Health Dashboard` |
262+
| `ui.dashboard-subheading` | Dashboard description between header and endpoints | `Monitor the health of your endpoints in real-time` |
263263
| `ui.header` | Header at the top of the dashboard. | `Gatus` |
264264
| `ui.logo` | URL to the logo to display. | `""` |
265265
| `ui.link` | Link to open when the logo is clicked. | `""` |

config/ui/ui.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import (
1010
)
1111

1212
const (
13-
defaultTitle = "Health Dashboard | Gatus"
14-
defaultDescription = "Gatus is an advanced automated status page that lets you monitor your applications and configure alerts to notify you if there's an issue"
15-
defaultHeader = "Gatus"
16-
defaultDashboardTitle = "Health Dashboard"
17-
defaultDashboardDescription = "Monitor the health of your endpoints in real-time"
18-
defaultLogo = ""
19-
defaultLink = ""
20-
defaultCustomCSS = ""
21-
defaultSortBy = "name"
22-
defaultFilterBy = "none"
13+
defaultTitle = "Health Dashboard | Gatus"
14+
defaultDescription = "Gatus is an advanced automated status page that lets you monitor your applications and configure alerts to notify you if there's an issue"
15+
defaultHeader = "Gatus"
16+
defaultDashboardHeading = "Health Dashboard"
17+
defaultDashboardSubheading = "Monitor the health of your endpoints in real-time"
18+
defaultLogo = ""
19+
defaultLink = ""
20+
defaultCustomCSS = ""
21+
defaultSortBy = "name"
22+
defaultFilterBy = "none"
2323
)
2424

2525
var (
@@ -32,18 +32,18 @@ var (
3232

3333
// Config is the configuration for the UI of Gatus
3434
type Config struct {
35-
Title string `yaml:"title,omitempty"` // Title of the page
36-
Description string `yaml:"description,omitempty"` // Meta description of the page
37-
DashboardTitle string `yaml:"dashboard-title,omitempty"` // Dashboard Title between header and endpoints
38-
DashboardDescription string `yaml:"dashboard-description,omitempty"` // Dashboard Description between header and endpoints
39-
Header string `yaml:"header,omitempty"` // Header is the text at the top of the page
40-
Logo string `yaml:"logo,omitempty"` // Logo to display on the page
41-
Link string `yaml:"link,omitempty"` // Link to open when clicking on the logo
42-
Buttons []Button `yaml:"buttons,omitempty"` // Buttons to display below the header
43-
CustomCSS string `yaml:"custom-css,omitempty"` // Custom CSS to include in the page
44-
DarkMode *bool `yaml:"dark-mode,omitempty"` // DarkMode is a flag to enable dark mode by default
45-
DefaultSortBy string `yaml:"default-sort-by,omitempty"` // DefaultSortBy is the default sort option ('name', 'group', 'health')
46-
DefaultFilterBy string `yaml:"default-filter-by,omitempty"` // DefaultFilterBy is the default filter option ('none', 'failing', 'unstable')
35+
Title string `yaml:"title,omitempty"` // Title of the page
36+
Description string `yaml:"description,omitempty"` // Meta description of the page
37+
DashboardHeading string `yaml:"dashboard-heading,omitempty"` // Dashboard Title between header and endpoints
38+
DashboardSubheading string `yaml:"dashboard-subheading,omitempty"` // Dashboard Description between header and endpoints
39+
Header string `yaml:"header,omitempty"` // Header is the text at the top of the page
40+
Logo string `yaml:"logo,omitempty"` // Logo to display on the page
41+
Link string `yaml:"link,omitempty"` // Link to open when clicking on the logo
42+
Buttons []Button `yaml:"buttons,omitempty"` // Buttons to display below the header
43+
CustomCSS string `yaml:"custom-css,omitempty"` // Custom CSS to include in the page
44+
DarkMode *bool `yaml:"dark-mode,omitempty"` // DarkMode is a flag to enable dark mode by default
45+
DefaultSortBy string `yaml:"default-sort-by,omitempty"` // DefaultSortBy is the default sort option ('name', 'group', 'health')
46+
DefaultFilterBy string `yaml:"default-filter-by,omitempty"` // DefaultFilterBy is the default filter option ('none', 'failing', 'unstable')
4747
//////////////////////////////////////////////
4848
// Non-configurable - used for UI rendering //
4949
//////////////////////////////////////////////
@@ -76,8 +76,8 @@ func GetDefaultConfig() *Config {
7676
return &Config{
7777
Title: defaultTitle,
7878
Description: defaultDescription,
79-
DashboardTitle: defaultDashboardTitle,
80-
DashboardDescription: defaultDashboardDescription,
79+
DashboardHeading: defaultDashboardHeading,
80+
DashboardSubheading: defaultDashboardSubheading,
8181
Header: defaultHeader,
8282
Logo: defaultLogo,
8383
Link: defaultLink,
@@ -97,11 +97,11 @@ func (cfg *Config) ValidateAndSetDefaults() error {
9797
if len(cfg.Description) == 0 {
9898
cfg.Description = defaultDescription
9999
}
100-
if len(cfg.DashboardTitle) == 0 {
101-
cfg.DashboardTitle = defaultDashboardTitle
100+
if len(cfg.DashboardHeading) == 0 {
101+
cfg.DashboardHeading = defaultDashboardHeading
102102
}
103-
if len(cfg.DashboardDescription) == 0 {
104-
cfg.DashboardDescription = defaultDashboardDescription
103+
if len(cfg.DashboardSubheading) == 0 {
104+
cfg.DashboardSubheading = defaultDashboardSubheading
105105
}
106106
if len(cfg.Header) == 0 {
107107
cfg.Header = defaultHeader

config/ui/ui_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import (
88

99
func TestConfig_ValidateAndSetDefaults(t *testing.T) {
1010
cfg := &Config{
11-
Title: "",
12-
Description: "",
13-
DashboardTitle: "",
14-
DashboardDescription: "",
15-
Header: "",
16-
Logo: "",
17-
Link: "",
11+
Title: "",
12+
Description: "",
13+
DashboardHeading: "",
14+
DashboardSubheading: "",
15+
Header: "",
16+
Logo: "",
17+
Link: "",
1818
}
1919
if err := cfg.ValidateAndSetDefaults(); err != nil {
2020
t.Error("expected no error, got", err.Error())
@@ -25,11 +25,11 @@ func TestConfig_ValidateAndSetDefaults(t *testing.T) {
2525
if cfg.Description != defaultDescription {
2626
t.Errorf("expected description to be %s, got %s", defaultDescription, cfg.Description)
2727
}
28-
if cfg.DashboardTitle != defaultDashboardTitle {
29-
t.Errorf("expected DashboardTitle to be %s, got %s", defaultDashboardTitle, cfg.DashboardTitle)
28+
if cfg.DashboardHeading != defaultDashboardHeading {
29+
t.Errorf("expected DashboardHeading to be %s, got %s", defaultDashboardHeading, cfg.DashboardHeading)
3030
}
31-
if cfg.DashboardDescription != defaultDashboardDescription {
32-
t.Errorf("expected DashboardDescription to be %s, got %s", defaultDashboardDescription, cfg.DashboardDescription)
31+
if cfg.DashboardSubheading != defaultDashboardSubheading {
32+
t.Errorf("expected DashboardSubheading to be %s, got %s", defaultDashboardSubheading, cfg.DashboardSubheading)
3333
}
3434
if cfg.Header != defaultHeader {
3535
t.Errorf("expected header to be %s, got %s", defaultHeader, cfg.Header)
@@ -86,11 +86,11 @@ func TestGetDefaultConfig(t *testing.T) {
8686
if defaultConfig.Title != defaultTitle {
8787
t.Error("expected GetDefaultConfig() to return defaultTitle, got", defaultConfig.Title)
8888
}
89-
if defaultConfig.DashboardTitle != defaultDashboardTitle {
90-
t.Error("expected GetDefaultConfig() to return defaultDashboardTitle, got", defaultConfig.DashboardTitle)
89+
if defaultConfig.DashboardHeading != defaultDashboardHeading {
90+
t.Error("expected GetDefaultConfig() to return defaultDashboardHeading, got", defaultConfig.DashboardHeading)
9191
}
92-
if defaultConfig.DashboardDescription != defaultDashboardDescription {
93-
t.Error("expected GetDefaultConfig() to return defaultDashboardDescription, got", defaultConfig.DashboardDescription)
92+
if defaultConfig.DashboardSubheading != defaultDashboardSubheading {
93+
t.Error("expected GetDefaultConfig() to return defaultDashboardSubheading, got", defaultConfig.DashboardSubheading)
9494
}
9595
if defaultConfig.Logo != defaultLogo {
9696
t.Error("expected GetDefaultConfig() to return defaultLogo, got", defaultConfig.Logo)

web/app/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<script type="text/javascript">
6-
window.config = {logo: "{{ .UI.Logo }}", header: "{{ .UI.Header }}", dashboardTitle: "{{ .UI.DashboardTitle }}", dashboardDescription: "{{ .UI.DashboardDescription }}", link: "{{ .UI.Link }}", buttons: [], maximumNumberOfResults: "{{ .UI.MaximumNumberOfResults }}", defaultSortBy: "{{ .UI.DefaultSortBy }}", defaultFilterBy: "{{ .UI.DefaultFilterBy }}"};{{- range .UI.Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
6+
window.config = {logo: "{{ .UI.Logo }}", header: "{{ .UI.Header }}", dashboardHeading: "{{ .UI.DashboardHeading }}", dashboardSubheading: "{{ .UI.DashboardSubheading }}", link: "{{ .UI.Link }}", buttons: [], maximumNumberOfResults: "{{ .UI.MaximumNumberOfResults }}", defaultSortBy: "{{ .UI.DefaultSortBy }}", defaultFilterBy: "{{ .UI.DefaultFilterBy }}"};{{- range .UI.Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
77
// Initialize theme immediately to prevent flash
88
(function() {
99
const themeFromCookie = document.cookie.match(/theme=(dark|light);?/)?.[1];

web/app/src/views/Home.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div class="mb-6">
55
<div class="flex items-center justify-between mb-6">
66
<div>
7-
<h1 class="text-4xl font-bold tracking-tight">{{ dashboardTitle }}</h1>
8-
<p class="text-muted-foreground mt-2">{{ dashboardDescription }}</p>
7+
<h1 class="text-4xl font-bold tracking-tight">{{ dashboardHeading }}</h1>
8+
<p class="text-muted-foreground mt-2">{{ dashboardSubheading }}</p>
99
</div>
1010
<div class="flex items-center gap-4">
1111
<Button
@@ -382,12 +382,12 @@ const initializeCollapsedGroups = () => {
382382
}
383383
}
384384
385-
const dashboardTitle = computed(() => {
386-
return window.config && window.config.dashboardTitle && window.config.dashboardTitle !== '{{ .UI.DashboardTitle }}' ? window.config.dashboardTitle : "Health Dashboard"
385+
const dashboardHeading = computed(() => {
386+
return window.config && window.config.dashboardHeading && window.config.dashboardHeading !== '{{ .UI.DashboardHeading }}' ? window.config.dashboardHeading : "Health Dashboard"
387387
})
388388
389-
const dashboardDescription = computed(() => {
390-
return window.config && window.config.dashboardDescription && window.config.dashboardDescription !== '{{ .UI.dashboardDescription }}' ? window.config.dashboardDescription : "Monitor the health of your endpoints in real-time"
389+
const dashboardSubheading = computed(() => {
390+
return window.config && window.config.dashboardSubheading && window.config.dashboardSubheading !== '{{ .UI.dashboardSubheading }}' ? window.config.dashboardSubheading : "Monitor the health of your endpoints in real-time"
391391
})
392392
393393
onMounted(() => {

web/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang="en" class="{{ .Theme }}"><head><meta charset="utf-8"/><script>window.config = {logo: "{{ .UI.Logo }}", header: "{{ .UI.Header }}", dashboardTitle: "{{ .UI.DashboardTitle }}", dashboardDescription: "{{ .UI.DashboardDescription }}", link: "{{ .UI.Link }}", buttons: [], maximumNumberOfResults: "{{ .UI.MaximumNumberOfResults }}", defaultSortBy: "{{ .UI.DefaultSortBy }}", defaultFilterBy: "{{ .UI.DefaultFilterBy }}"};{{- range .UI.Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
1+
<!doctype html><html lang="en" class="{{ .Theme }}"><head><meta charset="utf-8"/><script>window.config = {logo: "{{ .UI.Logo }}", header: "{{ .UI.Header }}", dashboardHeading: "{{ .UI.DashboardHeading }}", dashboardSubheading: "{{ .UI.DashboardSubheading }}", link: "{{ .UI.Link }}", buttons: [], maximumNumberOfResults: "{{ .UI.MaximumNumberOfResults }}", defaultSortBy: "{{ .UI.DefaultSortBy }}", defaultFilterBy: "{{ .UI.DefaultFilterBy }}"};{{- range .UI.Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
22
// Initialize theme immediately to prevent flash
33
(function() {
44
const themeFromCookie = document.cookie.match(/theme=(dark|light);?/)?.[1];

0 commit comments

Comments
 (0)