From c889e599b2c27e2966a5b46817d7fa3f397bcd74 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 20 Jan 2026 05:35:34 -0800 Subject: feat: Add hide_ping option to hide response time --- ideas.md | 1 - internal/config/config.go | 1 + internal/server/server.go | 2 ++ internal/server/templates/index.html | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ideas.md b/ideas.md index 0d82d5d..d5d437a 100644 --- a/ideas.md +++ b/ideas.md @@ -45,7 +45,6 @@ - Alert escalation policies ### Monitor Types -- Database connection monitoring - Custom script/command execution - WebSocket monitoring diff --git a/internal/config/config.go b/internal/config/config.go index 9cc9eac..b819d8f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -88,6 +88,7 @@ type MonitorConfig struct { ExpectedContent string `yaml:"expected_content,omitempty"` // Expected text in response body VerifySSL *bool `yaml:"verify_ssl,omitempty"` HideSSLDays bool `yaml:"hide_ssl_days,omitempty"` // Hide SSL days left from display + HidePing bool `yaml:"hide_ping,omitempty"` // Hide response time from display RoundResponseTime bool `yaml:"round_response_time,omitempty"` // Round response time to nearest second RoundUptime bool `yaml:"round_uptime,omitempty"` // Round uptime percentage (e.g., 99.99% → 100%) DisablePingTooltips bool `yaml:"disable_ping_tooltips,omitempty"` // Disable hover tooltips on ping history bars diff --git a/internal/server/server.go b/internal/server/server.go index ab1ca4c..50a41af 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -149,6 +149,7 @@ type MonitorData struct { Status string StatusClass string ResponseTime int64 + HidePing bool // Hide response time from display UptimePercent float64 Ticks []*storage.TickData // Aggregated tick data for history bar SSLDaysLeft int @@ -237,6 +238,7 @@ func (s *Server) handleIndex(w http.ResponseWriter, r *http.Request) { Name: monCfg.Name, Type: monCfg.Type, Link: template.URL(monCfg.Link), + HidePing: monCfg.HidePing, DisablePingTooltips: monCfg.DisablePingTooltips, } diff --git a/internal/server/templates/index.html b/internal/server/templates/index.html index 0e36c16..62a56b4 100644 --- a/internal/server/templates/index.html +++ b/internal/server/templates/index.html @@ -95,7 +95,7 @@ {{.Type}}
- {{formatDuration .ResponseTime}} + {{if not .HidePing}}{{formatDuration .ResponseTime}}{{end}} {{if gt .SSLDaysLeft 0}} SSL: {{.SSLDaysLeft}}d {{end}} -- cgit v1.2.3