Commit Graph
3 Commits
Author SHA1 Message Date
bvandeusenandClaude Opus 5.5 6caf737917 test: render plugin templates through render_template with the plugin's folder in front (#5122)
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 52s
CI / unit (push) Successful in 1m10s
CI / publish (push) Successful in 1m27s
Calling app.update_template_context directly failed in CI (run 8386:
"missing 1 required positional argument: 'context'"). Rather than
reproduce Quart's render path, the helper puts the plugin's template
folder ahead of the app's loader for the one render and calls
quart.render_template, which supplies the request context as it does
for every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 18:06:04 -04:00
bvandeusenandClaude Opus 5.5 2a3af60e99 test(hosts): render the host_agent fragments whether or not the plugin is enabled (#5122)
CI / lint (push) Successful in 2s
CI / publish (push) Skipped
CI / integration (push) Successful in 1m2s
CI / unit (push) Failing after 1m13s
The unit app does not register plugin blueprints, so render_template could
not find _host_vitals.html or _host_metrics.html (TemplateNotFound, CI run
8384). tests/_templates.render_plugin_template renders a plugin's template
through the app's own Jinja environment and request context, with the
plugin's template folder ahead of the app's loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 18:03:17 -04:00
bvandeusenandClaude Opus 5.5 f47fc23265 fix(ui): delete prompts use data-confirm, so a quote in a name no longer runs script (#5099)
#5099 "A name containing a quote runs script when an admin clicks Delete".
Inline handlers like onclick="return confirm('Delete {{ rule.name }}?')" are
HTML-decoded before the JavaScript is parsed, so autoescaping did not stop a
name such as  x');fetch(…);//  from running.

- Every prompt (22 handlers, plus the docker prune and token revoke ones)
  is now data-confirm="…", read through dataset by one submit listener in
  base.html; nothing rendered is parsed as JavaScript.
- The remaining inline handlers take integers only (|int), and the time
  range buttons pass this.dataset.range.
- tests/test_inline_handlers.py fails on any {{ }} in an inline handler that
  is not |int, with a self-test; tests/_templates.py is the one template
  walker the template guards now share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 14:30:13 -04:00