The Monitors widget opens with a verdict ("1 of 5 monitors down."), then one
row per monitor under a single header: latency and uptime over 24h, 7d and
30d, down monitors first with why and since when, the name linking to the
monitor. Counts follow the type filter. Problems always show; the limit
trims only the healthy rest ("+N more up").
Uptime / SLA (uptime_summary) repeated those numbers per host; migration
0033 moves dashboards onto Monitors. Shared widget styles (.w-verdict,
.w-table, .w-sub, .w-more) carry the widget-shape ruling for the widgets
that follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
"""Uptime / SLA folds into Monitors (#5250)
|
|
|
|
Revision ID: 0033_retire_uptime_widget
|
|
Revises: 0032_retire_duplicate_widgets
|
|
Create Date: 2026-10-07
|
|
|
|
The Monitors widget now shows each monitor's uptime over 24h, 7d and 30d, so
|
|
the separate Uptime / SLA widget (uptime_summary) repeated it. A dashboard
|
|
that already shows Monitors loses the Uptime placement; any other keeps the
|
|
cell, now showing Monitors. The same steps as 0032.
|
|
"""
|
|
from typing import Sequence, Union
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision: str = "0033_retire_uptime_widget"
|
|
down_revision: Union[str, None] = "0032_retire_duplicate_widgets"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
_OLD, _NEW = "uptime_summary", "monitors"
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.execute(sa.text("""
|
|
DELETE FROM dashboard_widgets d
|
|
WHERE d.widget_key = :old
|
|
AND EXISTS (SELECT 1 FROM dashboard_widgets k
|
|
WHERE k.dashboard_id = d.dashboard_id AND k.widget_key = :new)
|
|
""").bindparams(old=_OLD, new=_NEW))
|
|
op.execute(sa.text("""
|
|
DELETE FROM dashboard_widgets d
|
|
WHERE d.widget_key = :old
|
|
AND EXISTS (SELECT 1 FROM dashboard_widgets k
|
|
WHERE k.dashboard_id = d.dashboard_id AND k.widget_key = :old
|
|
AND k.id < d.id)
|
|
""").bindparams(old=_OLD))
|
|
op.execute(sa.text("""
|
|
UPDATE dashboard_widgets SET widget_key = :new, config_json = NULL
|
|
WHERE widget_key = :old
|
|
""").bindparams(old=_OLD, new=_NEW))
|
|
|
|
|
|
def downgrade() -> None:
|
|
# One-way, as 0032: the retired widget no longer exists to render.
|
|
pass
|