diff options
| author | Fuwn <[email protected]> | 2026-01-19 18:37:16 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-19 18:37:16 -0800 |
| commit | db17158de7bd7b0a9656893c0c36c6b198b0d713 (patch) | |
| tree | ebc51b6c4ac52edf73612d37468076afbafe0d1b /internal/config/config.go | |
| parent | fix: Preserve config formatting when updating reset flag (diff) | |
| download | kaze-db17158de7bd7b0a9656893c0c36c6b198b0d713.tar.xz kaze-db17158de7bd7b0a9656893c0c36c6b198b0d713.zip | |
feat: Add disable_ping_tooltips option to hide ping hover details
Add monitor-level option to disable hover tooltips on individual ping bars.
Can be set at group defaults or per-monitor. When enabled, visual appearance
remains unchanged but tooltips no longer appear on hover.
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 5a173b6..7ed28dd 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -66,31 +66,33 @@ type GroupConfig struct { // MonitorDefaults contains default values that can be set at group level type MonitorDefaults struct { - Interval *Duration `yaml:"interval,omitempty"` - Timeout *Duration `yaml:"timeout,omitempty"` - Retries *int `yaml:"retries,omitempty"` - VerifySSL *bool `yaml:"verify_ssl,omitempty"` + Interval *Duration `yaml:"interval,omitempty"` + Timeout *Duration `yaml:"timeout,omitempty"` + Retries *int `yaml:"retries,omitempty"` + VerifySSL *bool `yaml:"verify_ssl,omitempty"` + DisablePingTooltips *bool `yaml:"disable_ping_tooltips,omitempty"` } // MonitorConfig represents a single monitor type MonitorConfig struct { - Name string `yaml:"name"` - Type string `yaml:"type"` // http, https, tcp, gemini - Target string `yaml:"target"` - Interval Duration `yaml:"interval"` - Timeout Duration `yaml:"timeout"` - Retries int `yaml:"retries,omitempty"` // Number of retry attempts before marking as down - ResetOnNextCheck bool `yaml:"reset_on_next_check,omitempty"` // Wipe monitor data on next check and flip to false - ExpectedStatus int `yaml:"expected_status,omitempty"` - 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 - 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%) - Method string `yaml:"method,omitempty"` - UserAgent string `yaml:"user_agent,omitempty"` // Custom User-Agent header (default: "Kaze-Monitor/1.0") - Headers map[string]string `yaml:"headers,omitempty"` - Body string `yaml:"body,omitempty"` + Name string `yaml:"name"` + Type string `yaml:"type"` // http, https, tcp, gemini + Target string `yaml:"target"` + Interval Duration `yaml:"interval"` + Timeout Duration `yaml:"timeout"` + Retries int `yaml:"retries,omitempty"` // Number of retry attempts before marking as down + ResetOnNextCheck bool `yaml:"reset_on_next_check,omitempty"` // Wipe monitor data on next check and flip to false + ExpectedStatus int `yaml:"expected_status,omitempty"` + 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 + 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 + Method string `yaml:"method,omitempty"` + UserAgent string `yaml:"user_agent,omitempty"` // Custom User-Agent header (default: "Kaze-Monitor/1.0") + Headers map[string]string `yaml:"headers,omitempty"` + Body string `yaml:"body,omitempty"` } // IncidentConfig represents an incident or maintenance @@ -262,6 +264,10 @@ func (c *Config) applyDefaults() { } } } + // Apply group-level disable_ping_tooltips default + if !m.DisablePingTooltips && grp.Defaults != nil && grp.Defaults.DisablePingTooltips != nil && *grp.Defaults.DisablePingTooltips { + m.DisablePingTooltips = true + } } } } |