aboutsummaryrefslogtreecommitdiff
path: root/internal
Commit message (Collapse)AuthorAgeFilesLines
* feat: Add SSE streaming for instant page load and real-time updatesFuwn2026-01-285-19/+1129
| | | | | | | | | | | New refresh_mode 'stream' eliminates blocking database queries from initial page load. Page renders instantly with skeleton UI, then hydrates via SSE. - Add SSE hub for managing client connections and broadcasting - Add /api/stream endpoint with init and update events - Add stream.html skeleton template with loading animations - Wire scheduler to broadcast on check completion - Backwards compatible: page/api modes unchanged
* fix: Handle libsql string-based time valuesFuwn2026-01-231-7/+41
|
* feat: Switch to libsql driver for Turso compatibilityFuwn2026-01-232-60/+72
|
* feat: Add database maintenance with backup/reset modes and triggersFuwn2026-01-234-25/+473
|
* feat: Add config imports for monitor inheritanceFuwn2026-01-221-2/+84
|
* perf: Implement zero-downtime configuration reloadFuwn2026-01-211-68/+88
|
* fix: Respect display.timezone for version tooltip build dateFuwn2026-01-202-4/+35
| | | | | | | - Include raw timestamp in tooltip data for browser timezone conversion - Add timestampLabel field to identify which row contains the date - JavaScript converts build date to browser timezone when timezone: Browser - Falls back to configured timezone for server-side rendering
* feat: Add version tooltip to 'Powered by Kaze' footerFuwn2026-01-202-1/+45
| | | | | | | - Add VersionInfo struct to server - Add SetVersion() method called from main.go - Display version, commit, and build date in hoverable tooltip - Tooltip uses same style as other tooltips in the UI
* feat: Add POST /api/reload endpoint for config reloadFuwn2026-01-201-26/+79
| | | | | | | - Add /api/reload endpoint that triggers configuration reload - Always requires API key authentication (even if api.access is public) - Returns error if no API keys are configured - Update config.example.yaml with new endpoint and {group}/{name} format docs
* feat: Use composite group/name key for monitor identificationFuwn2026-01-2011-188/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously monitors were identified by just their name, causing monitors with the same name in different groups to share data in the database. Changes: - Add ID() method to MonitorConfig returning 'group/name' format - Add Group field to MonitorConfig (set at runtime) - Update Monitor interface with ID() and Group() methods - Update all monitor implementations (http, tcp, dns, icmp, gemini, graphql, database) to use composite ID - Update Scheduler to use monitor ID instead of name - Update server handlers to use composite ID for stats lookups - Change API routes to use {group}/{name} pattern: - /api/monitor/{group}/{name} - /api/history/{group}/{name} - /api/uptime/{group}/{name} - /api/badge/{group}/{name}.svg - URL-encode group and name components to handle special characters (e.g., slashes in names become %2F) - Update config.UpdateResetFlag to accept group and name separately BREAKING: API endpoints now require group in the path. Existing database data using just monitor names won't be associated with the new composite keys.
* fix: Use wildcard path for badge endpoint to support .svg extensionFuwn2026-01-201-1/+5
| | | | | Go's ServeMux doesn't support wildcards with extensions like {name}.svg, so use {name...} to capture the full path and strip .svg in the handler.
* feat: Add SVG status badge endpointFuwn2026-01-201-0/+131
| | | | | | | | | | | | | | | | | GET /api/badge/{name}.svg - Shields.io style status badges (always public) Options: - ?label=Custom - Override the label text (default: monitor name) - ?style=flat|plastic - Badge style (default: flat) - ?type=status|uptime - Show status or uptime percentage (default: status) Colors: - Green (#22c55e) for up / >=99% uptime - Yellow (#eab308) for degraded / >=95% uptime - Red (#ef4444) for down / <95% uptime - Gray (#9ca3af) for unknown Example: ![Status](https://status.example.com/api/badge/Website.svg)
* feat: Add new API endpoints (health, summary, uptime, incidents)Fuwn2026-01-202-0/+220
| | | | | | | | | | New endpoints: - GET /api/health - Simple health check, always public (for load balancers) - GET /api/summary - Lightweight status overview (counts + overall status) - GET /api/uptime/{name}?period=1h|24h|7d|30d|90d - Historical uptime stats - GET /api/incidents?filter=all|active|resolved|scheduled - List incidents All new endpoints (except /api/health) follow api.access rules.
* perf: Optimize API refresh to single /api/page requestFuwn2026-01-202-69/+125
| | | | | | | | | | Replace N+1 API calls (1 status + N history) with a single /api/page endpoint that returns all monitor data including history ticks. For 20 monitors: 21 requests -> 1 request per refresh interval. The /api/page endpoint is automatically public when refresh_mode=api, regardless of api.access setting, to ensure the page can always refresh.
* fix: Update history bars (ping ticks) in API refresh modeFuwn2026-01-201-23/+144
| | | | | | Fetch /api/history/{name} for each monitor in parallel and rebuild tick elements with proper colors and tooltips. Also add data attributes to monitor elements for hide_ping and disable_tooltips settings.
* feat: Add API-based refresh mode for smoother updatesFuwn2026-01-203-2/+199
| | | | | | | | | | | | Add display.refresh_mode option: - 'page' (default): Full page refresh via meta refresh - 'api': Fetch /api/status and update DOM without reload Also add display.refresh_interval (default: 30s, min: 5s) API mode updates: status indicators, response times, uptimes, errors, overall status banner, and page title counts. History bars remain static until full page refresh.
* feat: Add API access control (public/private/authenticated)Fuwn2026-01-202-3/+77
| | | | | | | | | | | | | | Add configurable access control for /api/* endpoints: - public: Anyone can access (default, backwards compatible) - private: API endpoints return 403 Forbidden - authenticated: Requires API key via X-API-Key header or ?api_key= param Config example: api: access: authenticated keys: - "secret-key-1" - "secret-key-2"
* feat: Add all remaining monitor options to group defaultsFuwn2026-01-201-0/+50
| | | | | | | | | | | | Support defaulting any monitor option at group level: - expected_content, body (HTTP/HTTPS) - ping_count (ICMP) - dns_server, record_type (DNS) - graphql_query, graphql_variables (GraphQL) - db_type (Database) Only name, type, target, link, reset_on_next_check, expected_ips, and expected_cname remain monitor-specific (not defaultable).
* feat: Expand group-level defaults with more monitor optionsFuwn2026-01-201-13/+56
| | | | | | | | | Add support for setting these options at group level: - hide_ssl_days, hide_ping, round_response_time, round_uptime - method, user_agent, headers, expected_status This allows configuring common settings once per group instead of repeating them on every monitor.
* fix: Support disable_uptime_tooltip in group defaultsFuwn2026-01-201-5/+10
|
* feat: Add disable_uptime_tooltip optionFuwn2026-01-203-44/+47
|
* fix: Use correct column name error_message in last failure queryFuwn2026-01-201-5/+7
|
* feat: Add uptime tooltip showing last failure time and reasonFuwn2026-01-203-45/+111
|
* feat: Add custom_head option for injecting HTML into headFuwn2026-01-203-5/+9
|
* fix: Use generic error message for unknown error typesFuwn2026-01-201-5/+1
|
* fix: Remove detailed error from tooltip to prevent URL leakageFuwn2026-01-201-1/+1
|
* fix: Simplify error messages in monitor displayFuwn2026-01-202-3/+50
|
* style: Update tab title format to show up/down countsFuwn2026-01-201-1/+1
|
* style: Use arrow icons for tab title statusFuwn2026-01-201-1/+1
|
* feat: Add status indicator to browser tab titleFuwn2026-01-202-4/+21
|
* fix: Auto-select first item in command paletteFuwn2026-01-201-4/+3
|
* fix: Scroll selected item into view in command paletteFuwn2026-01-201-0/+8
|
* feat: Add command palette for quick navigationFuwn2026-01-202-1/+328
|
* fix: Hide ping in tooltips when hide_ping is enabledFuwn2026-01-202-6/+30
|
* feat: Add hide_ping option to hide response timeFuwn2026-01-203-1/+4
|
* fix: Add database type to config validationFuwn2026-01-201-2/+5
|
* feat: Add database connection monitoring typeFuwn2026-01-203-1/+534
|
* feat: Add configurable UI scale optionFuwn2026-01-204-9/+26
|
* fix: Allow non-HTTP URL schemes in monitor linksFuwn2026-01-201-2/+2
|
* style: Remove default link underline stylingFuwn2026-01-202-2/+7
|
* feat: Add clickable link option for monitor namesFuwn2026-01-203-1/+4
|
* refactor: Use CSS prefers-color-scheme instead of JS-based theme toggleFuwn2026-01-205-130/+89
|
* fix: Prevent flash of light mode on page loadFuwn2026-01-202-33/+36
| | | | | | | - Default to dark mode by setting class="dark" on html element - Move theme CSS before external stylesheet to prevent flash - Only remove dark class if light mode is explicitly preferred - Add !important to theme variable overrides for precedence
* fix: Prevent flash of light mode on page loadFuwn2026-01-201-6/+6
| | | | | | | Move theme detection script to the very top of <head>, before any stylesheets load. This ensures the 'dark' class is added to <html> before the browser starts rendering with CSS, eliminating the flash of unstyled/wrong-theme content.
* fix: Use consistent CSS selectors for theme variable overridesFuwn2026-01-201-2/+4
| | | | | | | | Match the same selectors used in GenerateCSS(): - Light mode: :root, :root.light - Dark mode: :root.dark This ensures the override specificity matches the theme variable definitions.
* refactor: Use CSS variable overrides for proper theme integrationFuwn2026-01-202-178/+49
| | | | | | | | | | | | | | | | Instead of trying to override individual Tailwind classes (which was fragile and incomplete), now properly override Kaze's root CSS variables (--bg-primary, --status-ok, etc.) to use OpenCode theme values. This works because style.css already maps all Tailwind classes to these CSS variables, so overriding the variables automatically themes everything. The theme flow is now: 1. OpenCode theme defines: --theme-background, --theme-success, etc. 2. Override CSS redefines: --bg-primary = var(--theme-background), etc. 3. style.css classes use: background: var(--bg-primary), etc. This approach is much cleaner and ensures complete, consistent theming.
* feat: Improve theme CSS mappings for comprehensive stylingFuwn2026-01-201-40/+108
| | | | | | | | | | | | | | | | | Rewrite Tailwind class overrides to be much more comprehensive and accurate: - Page backgrounds (main, panels, cards, badges) - All text colors (primary, muted, status-specific) - Border colors and dividers - Status colors for all states (up, degraded, down, unknown) - Status banners with proper color-mixed backgrounds - Interactive hover states (group headers, monitor cards) - SVG icon colors - Tooltip styling with theme colors - Status indicator dots with proper colors Uses color-mix() for subtle background tints on status banners. Targets exact Tailwind classes used in the actual HTML output.
* fix: Support both single-color and dual-mode theme formatsFuwn2026-01-191-10/+24
| | | | | | | | | Update theme parser to handle both OpenCode theme formats: 1. Dual-mode: {"dark": "color", "light": "color"} - opencode.json 2. Single-color: "color" - ayu.json and other dark-only themes When a single color is provided, use it for both light and dark modes. Fixes parsing error when loading themes like ayu.json.
* feat: Add OpenCode-compatible theme loaderFuwn2026-01-194-2/+312
| | | | | | | | | | | | | | | | | | | | Add support for loading and applying OpenCode-compatible themes via URL. Fetches theme JSON, resolves color references, generates CSS variables and Tailwind class overrides to apply the theme seamlessly. Features: - Add theme_url config field under site section - Fetch and parse OpenCode theme.json format - Generate CSS custom properties (--theme-*) for all theme colors - Generate Tailwind class overrides to apply theme colors - Support both light and dark modes - Template.CSS type for safe CSS injection Example usage: site: theme_url: "https://raw.githubusercontent.com/anomalyco/opencode/.../opencode.json" Theme schema: https://opencode.ai/theme.json
* fix: Remove duplicate monitor name validation across groupsFuwn2026-01-191-5/+0
| | | | | | | | | | Previously, monitors with the same name in different groups would fail validation. This restriction has been removed to allow duplicate names across groups, restoring the original behavior. Note: Monitors with duplicate names will share the same data in the database since MonitorName is used as the identifier. A future enhancement could use group+name as a composite key.