Skip to content

fix(deps): update module github.com/prometheus/client_golang to v1.21.0 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/henrywhitaker3/flow v1.10.0
github.com/labstack/echo-contrib v0.17.2
github.com/labstack/echo/v4 v4.13.3
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_golang v1.21.0
github.com/prometheus/common v0.62.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.6
Expand Down
6 changes: 6 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ type UI struct {
RefreshInterval time.Duration `yaml:"refresh"`
Graphs Graphs `yaml:"graphs"`
Theme string `yaml:"theme"`
Header UIHeader `yaml:"header`
}

type UIHeader struct {
Enabled bool `yaml:"enabled"`
Logo string `yaml:"logo"`
}

type Metrics struct {
Expand Down
53 changes: 34 additions & 19 deletions internal/resources/views/base.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
<!DOCTYPE html>
<html lang="en" {{ if ne .Config.UI.Theme "auto" }}class="{{ .Config.UI.Theme }}"{{ end }}>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/tailwind.css?v={{ .Version }}" />
<link rel="icon" type="image/png" href="/static/icon.png" />
<title>{{ .Config.UI.PageTitle }}</title>
</head>
<body class="mx-auto min-h-dvh w-full md:w-3/4 p-6 md:p-8 lg:p-6 lg:w-1/2 flex flex-col justify-between bg-neutral-50 dark:bg-zinc-900">
<div>
{{ template "content" . }}
</div>
<html lang="en" {{ if ne .Config.UI.Theme "auto" }}class="{{ .Config.UI.Theme }}" {{ end }}>

<div class="mt-6 text-center text-gray-400 dark:text-gray-200">
Built with <a class="text-avocado-600 hover:text-avocado-500" href="https://github.com/henrywhitaker3/prompage">PromPage</a> |
Checked {{ .Age }} ago
</div>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/tailwind.css?v={{ .Version }}" />
<link rel="icon" type="image/png" href="/static/icon.png" />
<title>{{ .Config.UI.PageTitle }}</title>
</head>

{{ template "scripts" . }}
</body>
</html>
<body
class="mx-auto min-h-dvh w-full md:w-3/4 p-6 md:p-8 lg:p-6 lg:w-1/2 flex flex-col justify-between bg-neutral-50 dark:bg-zinc-900">
{{ if .Config.UI.Header.Enabled }}
<div>
<a class="flex flex-row" href="/" title="{{ .Config.UI.PageTitle }}">
{{ if ne .Config.UI.Header.Logo "" }}
<img class="max-h-[100px]" src="{{ .Config.UI.Header.Logo }}" />
{{ end }}
<h1 class="align-middle text-black dark:text-white">{{ .Config.UI.PageTitle }}</h1>
</a>
</div>
{{ end }}
<div>
{{ template "content" . }}
</div>

<div class="mt-6 text-center text-gray-400 dark:text-gray-200">
Built with <a class="text-avocado-600 hover:text-avocado-500"
href="https://github.com/henrywhitaker3/prompage">PromPage</a> |
Checked {{ .Age }} ago
</div>

{{ template "scripts" . }}
</body>

</html>
14 changes: 9 additions & 5 deletions internal/resources/views/service.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
{{- if not (eq .Graph "") }}
<div class="flex flex-col justify-between items-center">
<div class="w-full flex flex-col md:flex-row justify-center md:items-baseline items-center mb-6">
<h1 class="text-xl font-bold md:inline-block md:mr-2 text-avocado-800 dark:text-avocado-100" >{{ .Result.Service.Name }}</h1>
<span class="text-gray-500 dark:text-gray-300 text-sm">{{ $.Sprintf "%.2f" .Result.Uptime }}% over the last {{ $.PrettyDuration .Result.Service.Query.Range }}</span>
<h1 class="text-xl font-bold md:inline-block md:mr-2 text-avocado-800 dark:text-avocado-100">{{
.Result.Service.Name }}</h1>
<span class="text-gray-500 dark:text-gray-300 text-sm">{{ $.Sprintf "%.2f" .Result.Uptime }}% over the last {{
$.PrettyDuration .Result.Service.Query.Range }}</span>
</div>

<div class="h-64 md:h-96 w-full border dark:border-none dark:bg-zinc-800 rounded-md shadow-md mb-6">{{ .Graph }}</div>
<div class="h-64 md:h-96 w-full border border-gray-200 dark:border-none dark:bg-zinc-800 rounded-md shadow-md mb-6">
{{ .Graph }}
</div>

{{- if .Extras }}
{{- range $name, $graph := .Extras }}
<div class="w-full border dark:border-none dark:bg-zinc-800 rounded-md shadow-md pt-4 mb-6">
<div class="w-full border border-gray-200 dark:border-none dark:bg-zinc-800 rounded-md shadow-md pt-4 mb-6">
<h2 class="text-center text-avocado-800 dark:text-avocado-100">{{ $name }}</h2>
<div class="h-64 md:h-96 w-full">{{ $graph }}</div>
</div>
Expand All @@ -21,4 +25,4 @@ <h2 class="text-center text-avocado-800 dark:text-avocado-100">{{ $name }}</h2>
{{- end }}

{{- define "scripts"}}
{{- end }}
{{- end }}
14 changes: 8 additions & 6 deletions internal/resources/views/status.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{{- define "content" }}
<div class="flex flex-col justify-center items-center py-6 mb-6 w-full rounded-md shadow-md text-xl {{ .BannerClasses }}">
<div
class="flex flex-col justify-center items-center py-6 mb-6 w-full rounded-md shadow-md text-xl {{ .BannerClasses }}">
{{- if eq .Outage "None" }}
All Systems Operational
{{- else }}
Expand All @@ -17,10 +17,12 @@ <h2 class="text-xl mb-2 pl-1 text-avocado-800 dark:text-avocado-100">{{ .Name }}
<div class="flex flex-col items-center justify-center rounded-md shadow-md dark:shadow-none dark:bg-zinc-800">
{{- range .Results }}
<a href="/{{ .Service.Name }}" class="block w-full">
<div class="flex justify-between items-center w-full py-6 px-6 md:px-8 lg:px-12 border-b dark:border-none">
<div class="flex justify-between items-center w-full py-6 px-6 md:px-8 lg:px-12 border-b border-gray-200 dark:border-none">
<div>
<h3 class="text-lg font-bold md:inline-block md:mr-2 text-avocado-800 dark:text-avocado-100" >{{ .Service.Name }}</h3>
<span class="text-gray-500 dark:text-gray-300 text-sm">{{ $.Sprintf "%.2f" .Uptime }}% over the last {{ $.PrettyDuration .Service.Query.Range }}</span>
<h3 class="text-lg font-bold md:inline-block md:mr-2 text-avocado-800 dark:text-avocado-100">{{
.Service.Name }}</h3>
<span class="text-gray-500 dark:text-gray-300 text-sm">{{ $.Sprintf "%.2f" .Uptime }}% over the last
{{ $.PrettyDuration .Service.Query.Range }}</span>
</div>
<div>
{{- if not .Success }}
Expand All @@ -44,4 +46,4 @@ <h3 class="text-lg font-bold md:inline-block md:mr-2 text-avocado-800 dark:text-
<script>
setTimeout(() => { location.reload() }, {{ .Refresh }})
</script>
{{- end}}
{{- end}}
Loading