fix(docker): drop the unused .w-meter style; the bars test reads the loaded plugin's models (#5214)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -405,9 +405,6 @@ body.dash-editing .widget-drawer { transform:translateY(0); }
|
|||||||
.w-item .w-label { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
.w-item .w-label { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||||
.w-item .w-label a { color:inherit; text-decoration:none; }
|
.w-item .w-label a { color:inherit; text-decoration:none; }
|
||||||
.w-item .w-meta { flex-shrink:0; font-size:0.72rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
|
.w-item .w-meta { flex-shrink:0; font-size:0.72rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
|
||||||
/* A number with its share drawn behind it (--pct, 0–100), in the number's own
|
|
||||||
tone: the bar never stands without the figure it measures. */
|
|
||||||
.w-meter { background:linear-gradient(90deg, color-mix(in srgb, currentColor 20%, transparent) var(--pct, 0%), transparent var(--pct, 0%)); border-radius:3px; }
|
|
||||||
.w-note { font-size:0.7rem; color:var(--text-dim); margin-top:0.3rem; }
|
.w-note { font-size:0.7rem; color:var(--text-dim); margin-top:0.3rem; }
|
||||||
.w-table col.w-barcol { width:9.5rem; }
|
.w-table col.w-barcol { width:9.5rem; }
|
||||||
/* Bars of a figure's recent past, inline before it (Busiest Containers, #5214):
|
/* Bars of a figure's recent past, inline before it (Busiest Containers, #5214):
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ time bucket in one query (#5214). Two samples share a bucket and must merge
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import importlib
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
@@ -21,10 +22,20 @@ def app():
|
|||||||
return create_app(testing=False)
|
return create_app(testing=False)
|
||||||
|
|
||||||
|
|
||||||
|
def _docker(sub):
|
||||||
|
"""The app's loaded docker plugin module: importing plugins.docker.models a
|
||||||
|
second time raises "Table already defined" (see test_mcp_plugin_tools)."""
|
||||||
|
from steward.core.plugin_manager import get_loaded_plugin_modules
|
||||||
|
loaded = get_loaded_plugin_modules().get("docker")
|
||||||
|
base = loaded.__name__ if loaded is not None else "plugins.docker"
|
||||||
|
return importlib.import_module(f"{base}.{sub}")
|
||||||
|
|
||||||
|
|
||||||
def test_recent_usage_averages_each_containers_bucket(app):
|
def test_recent_usage_averages_each_containers_bucket(app):
|
||||||
from plugins.docker.models import DockerMetric
|
|
||||||
from plugins.docker.service import bar_slots, recent_usage
|
|
||||||
from steward.models.hosts import Host
|
from steward.models.hosts import Host
|
||||||
|
DockerMetric = _docker("models").DockerMetric
|
||||||
|
service = _docker("service")
|
||||||
|
bar_slots, recent_usage = service.bar_slots, service.recent_usage
|
||||||
|
|
||||||
tag = uuid.uuid4().hex[:8]
|
tag = uuid.uuid4().hex[:8]
|
||||||
hid = str(uuid.uuid4())
|
hid = str(uuid.uuid4())
|
||||||
|
|||||||
Reference in New Issue
Block a user