Skip to content

Commit 333fefd

Browse files
fix: service page styling
1 parent d6f25a1 commit 333fefd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

internal/http/service.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ func NewGetServiceHandler(app *app.App, cache *ResultCache) echo.HandlerFunc {
6464
}
6565

6666
data := getServiceData{
67-
Age: time.Since(age).Round(time.Second),
68-
Result: svc,
69-
Graph: template.HTML(graph.Out()),
70-
Extras: map[string]template.HTML{},
67+
Config: *app.Config,
68+
Version: app.Version,
69+
Age: time.Since(age).Round(time.Second),
70+
Result: svc,
71+
Graph: template.HTML(graph.Out()),
72+
Extras: map[string]template.HTML{},
7173
}
7274

7375
for name, res := range extraGraphs {

internal/resources/views/service.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{{- define "content" }}
22
{{- if not (eq .Graph "") }}
33
<div class="flex flex-col justify-between items-center">
4-
<div class="w-full flex flex-col md:flex-row justify-center md:items-baseline items-center">
4+
<div class="w-full flex flex-col md:flex-row justify-center md:items-baseline items-center mb-6">
55
<h1 class="text-xl font-bold md:inline-block md:mr-2 text-avocado-800" >{{ .Result.Service.Name }}</h1>
66
<span class="text-gray-500 text-sm">{{ $.Sprintf "%.2f" .Result.Uptime }}% over the last {{ $.PrettyDuration .Result.Service.Query.Range }}</span>
77
</div>
88

9-
<div class="h-64 md:h-96 w-full">{{ .Graph }}</div>
9+
<div class="h-64 md:h-96 w-full border rounded-md shadow-md mb-6">{{ .Graph }}</div>
1010

11-
<div class="w-full">
11+
<div class="w-full border rounded-md shadow-md pt-4 mb-6">
1212
{{- range $name, $graph := .Extras }}
1313
<h2 class="text-center text-avocado-800">{{ $name }}</h2>
1414
<div class="h-64 md:h-96 w-full">{{ $graph }}</div>

0 commit comments

Comments
 (0)