feat(settings): Settings brought into line with the rest of Steward (milestone 493)
The last page of #5214's walk. Settings still described Steward as it was before monitors were unified and SNMP was rebuilt, drew its tabs below the breadcrumb, and showed the report schedule in UTC. - Tabs (#5377): settings/_tabs.html is a settings_tabs() macro called in each page's section_tabs block, above the trail, as Ansible's are. The breadcrumb guard also fails any page that {% include %}s a tab strip. - Report time (#5378): reports.schedule_tz keeps the zone of whoever saved the schedule; check_and_send compares in it (report_due), and the form shows the day and hour on the reader's clock (schedule_in) under their zone's name. "Last sent" uses |when. - Wording (#5379): the report contents list what the report holds (monitors, not ping-enabled hosts); "Ping latency" is "Response time" and says what it grades; plugin detail says enabling loads now and disabling needs a restart; the monitor interval says it applies on the next check (the scheduler reads it every pass); the dead list-config branch is gone. - Traefik (#5380): the 5xx and 4xx cutoffs are settings (traefik.threshold.error_5xx_pct 0.1, error_4xx_pct 1.0) in a "Traefik routers" group on Thresholds while the plugin runs, read by router_state through error_cutoffs(). The Traefik page has a Thresholds button for admins, to /settings/thresholds/#traefik. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,22 @@ def test_section_tabs_sit_above_the_trail():
|
||||
assert base.index("{% block section_tabs %}") < base.index("{% block breadcrumb %}")
|
||||
pages = [p for p in template_files() if _EXTENDS_BASE.search(p.read_text())]
|
||||
tabbed = [p for p in pages if _TABS_CALL.search(p.read_text())]
|
||||
assert len(tabbed) >= 10, [str(p) for p in tabbed] # the ten Ansible pages, at least
|
||||
assert len(tabbed) >= 18, [str(p) for p in tabbed] # the ten Ansible pages and eight Settings pages
|
||||
wrong = sorted(str(p.relative_to(REPO)) for p in tabbed if tabs_outside_their_block(p.read_text()))
|
||||
assert not wrong, f"move the tabs into {{% block section_tabs %}}: {wrong}"
|
||||
|
||||
|
||||
# A tab strip pulled in with {% include %} lands wherever the include sits, which
|
||||
# is how Settings drew its tabs under the trail unnoticed (#5377). Tabs come only
|
||||
# from a *_tabs() macro call, which the guard above places.
|
||||
_TABS_INCLUDE = re.compile(r"\{%-?\s*include\s+[\"'][^\"']*_tabs\.html")
|
||||
|
||||
|
||||
def test_the_include_guard_can_fail():
|
||||
assert _TABS_INCLUDE.search('{% include "settings/_tabs.html" %}')
|
||||
assert not _TABS_INCLUDE.search('{% from "settings/_tabs.html" import settings_tabs %}')
|
||||
|
||||
|
||||
def test_no_page_includes_a_tab_strip():
|
||||
included = sorted(str(p.relative_to(REPO)) for p in template_files() if _TABS_INCLUDE.search(p.read_text()))
|
||||
assert not included, f"call the section's *_tabs() macro in {{% block section_tabs %}}: {included}"
|
||||
|
||||
Reference in New Issue
Block a user