Skip to content

Commit 5d01beb

Browse files
committed
Add the version number to the UI web pages
1 parent 458d2af commit 5d01beb

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

dnscrypt-proxy/monitoring_ui.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ func (ui *MonitoringUI) handleRoot(w http.ResponseWriter, r *http.Request) {
10921092
// Don't cache: ensures the browser revalidates auth before the JS issues /api/metrics and WebSocket calls.
10931093
setDynamicCacheHeaders(w)
10941094
w.Header().Set("Content-Type", "text/html")
1095-
w.Write([]byte(MainHTMLTemplate))
1095+
body := strings.ReplaceAll(MainHTMLTemplate, "{{VERSION}}", AppVersion)
1096+
w.Write([]byte(body))
10961097
}
10971098

10981099
// handleMetrics - Handles the metrics API endpoint

dnscrypt-proxy/static/templates/dashboard.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>DNSCrypt Proxy Monitoring</title>
6+
<title>DNSCrypt Proxy Monitoring Dashboard V{{VERSION}}</title>
77
<style>
88
body {
99
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
@@ -120,7 +120,7 @@
120120
</head>
121121
<body>
122122
<header>
123-
<h1>DNSCrypt Proxy Monitoring Dashboard</h1>
123+
<h1>DNSCrypt Proxy Monitoring Dashboard V{{VERSION}}</h1>
124124
<div class="header-meta">
125125
<span>Last Updated: <strong id="last-updated">-</strong></span>
126126
<a href="/api/metrics" target="_blank">Raw Data</a>

0 commit comments

Comments
 (0)