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:
+10
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user