3b6e005ed8
Adds a Kuma-style "is everything up?" surface that aggregates heterogeneous monitor types via a status-source registry (steward/core/status.py): each type registers an async source(db) -> [StatusEntry]. Core registers ping/DNS; the http plugin registers its own from setup() so core never imports plugin tables. Per entry: current up/down, last-30 heartbeat bar, uptime % (24h/7d/30d), latest latency + response sparkline, and TLS expiry countdown (HTTP). New /status page (live htmx refresh) + a status_overview dashboard widget + nav link. Pure-function unit tests for registry + sparkline. First deliverable of milestone #68 (task #866). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
29 lines
689 B
Python
29 lines
689 B
Python
# plugins/http/__init__.py
|
|
from __future__ import annotations
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from quart import Quart
|
|
|
|
_app: "Quart | None" = None
|
|
|
|
|
|
def setup(app: "Quart") -> None:
|
|
global _app
|
|
_app = app
|
|
from .models import HttpMonitor, HttpResult # noqa: F401
|
|
# Contribute HTTP monitors to the core unified Status page.
|
|
from steward.core.status import register_status_source
|
|
from .routes import http_status_source
|
|
register_status_source(http_status_source)
|
|
|
|
|
|
def get_scheduled_tasks() -> list:
|
|
from .scheduler import make_task
|
|
return [make_task(_app)]
|
|
|
|
|
|
def get_blueprint():
|
|
from .routes import http_bp
|
|
return http_bp
|