Skip to content

Commit e970cb2

Browse files
committed
Add footer to Sloth UI
Signed-off-by: Xabier Larrakoetxea <[email protected]>
1 parent 7089418 commit e970cb2

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

internal/http/ui/static/css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ mark {
9898
padding-bottom: 0.25em;
9999
}
100100

101+
102+
footer li {
103+
font-size: 0.9rem;
104+
}

internal/http/ui/templates/shared/footer.tmpl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{{define "shared_footer"}}
2-
<footer></footer>
2+
<footer class="container">
3+
<hr>
4+
5+
<nav>
6+
<ul>
7+
<li>Code licensed under <a href=https://github.com/slok/sloth/blob/main/LICENSE>Apache 2.0</a>.</li>
8+
<li>Running Sloth <small><mark>{{.Common.SlothVersion}}</mark></small></li>
9+
</ul>
10+
<ul>
11+
<li><a href="https://sloth.dev/"> Docs</a></li>
12+
<li><a href="https://github.com/slok/sloth"> Source code</a></li>
13+
</ul>
14+
</nav>
15+
</footer>
316

417
<script src="https://unpkg.com/lucide@latest"></script>
518
<script>lucide.createIcons();</script>

internal/http/ui/tpl.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"strings"
1313
"text/template"
1414

15+
"github.com/slok/sloth/internal/info"
1516
"github.com/slok/sloth/internal/log"
1617
)
1718

@@ -75,12 +76,13 @@ func newTplRenderer(logger log.Logger) (*tplRenderer, error) {
7576
logger: logger,
7677
tpls: templates,
7778
CommonData: map[string]any{
78-
"CSSPath": urls.NonAppURL(staticPrefix + "/css"),
79-
"JSPath": urls.NonAppURL(staticPrefix + "/js"),
80-
"ImagePath": urls.NonAppURL(staticPrefix + "/img"),
81-
"HomeURL": urls.AppURL("/"),
82-
"ServicesURL": urls.AppURL("/services"),
83-
"SLOsURL": urls.AppURL("/slos"),
79+
"CSSPath": urls.NonAppURL(staticPrefix + "/css"),
80+
"JSPath": urls.NonAppURL(staticPrefix + "/js"),
81+
"ImagePath": urls.NonAppURL(staticPrefix + "/img"),
82+
"HomeURL": urls.AppURL("/"),
83+
"ServicesURL": urls.AppURL("/services"),
84+
"SLOsURL": urls.AppURL("/slos"),
85+
"SlothVersion": info.Version,
8486
},
8587
}, nil
8688
}

0 commit comments

Comments
 (0)