feat: add section_mode, api_section, editable flags and oauth section to settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 11:49:41 -04:00
parent de81751e59
commit 8640d731aa
3 changed files with 162 additions and 25 deletions
+6 -1
View File
@@ -879,6 +879,8 @@ async def start(
ch_cfg = config.get("notification_channels", {}).get(ch_name, {})
notif_channels.append({"name": ch_name, "type": ch_cfg.get("type", "")})
all_channel_names = sorted((config.get("notification_channels") or {}).keys())
tmpl = env.get_template("profile.html")
body = tmpl.render(
title="Profile - Heartbeat",
@@ -888,6 +890,7 @@ async def start(
managed_hosts=managed,
monitored_hosts=monitored,
notification_channels=notif_channels,
all_channel_names=all_channel_names,
active_page="profile",
)
return web.Response(text=body, content_type="text/html")
@@ -947,9 +950,11 @@ async def start(
templates_dir = config.get("templates_dir", os.path.join(pkg_dir, "templates"))
env = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir))
tmpl = env.get_template("settings.html")
settings_data = settings_mod.get_settings_data(config, threshold_checker=threshold_checker)
body = tmpl.render(
title="Settings - Heartbeat",
sections=settings_mod.get_settings_sections(config, threshold_checker=threshold_checker),
sections=settings_data["sections"],
all_channel_names=settings_data["all_channel_names"],
current_user=current_user.to_dict() if current_user else None,
active_page="settings",
)