feat: replace YAML hosts editor with form-based CRUD table

Settings > Hosts now renders a table with per-column controls
(watch, dyndns, owner, managers/monitors multi-select, threshold
config, notification channels) instead of a raw YAML textarea.
Changes stage via the existing Publish flow like other form sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Wrede
2026-05-11 07:57:28 -04:00
parent 12e8812070
commit 1dbe0f8e64
5 changed files with 157 additions and 7 deletions
+10 -1
View File
@@ -1049,6 +1049,8 @@ async def start(
title="Settings - Heartbeat",
sections=settings_data["sections"],
all_channel_names=settings_data["all_channel_names"],
all_usernames=settings_data["all_usernames"],
all_threshold_configs=settings_data["all_threshold_configs"],
current_user=current_user.to_dict() if current_user else None,
active_page="settings",
)
@@ -1226,10 +1228,17 @@ async def start(
attrs.pop("client_secret", None)
data["oauth"] = new_oauth
for section in ("notification_channels", "thresholds", "hosts", "dns"):
for section in ("notification_channels", "thresholds", "dns"):
if section in payload:
configio_mod.apply_yaml_section(data, section, payload[section])
if "hosts" in payload:
h = payload["hosts"]
if isinstance(h, dict):
configio_mod.apply_structured_section(data, "hosts", h)
else:
configio_mod.apply_yaml_section(data, "hosts", h)
configio_mod.write_config(_config_path, data)
except Exception as exc:
logger.error("Config write failed: %s", exc)