from ..constants import CONTENT_MODE_FULL, CONTENT_MODE_SHORT, CONTENT_MODES from .sections import Field CHOICES = ( (CONTENT_MODE_FULL, "Voll (mit Plugin-Output und KI-Analyse)"), (CONTENT_MODE_SHORT, "Kurz (nur Host, Service, Status und Verlauf, ohne Output und KI-Text)"), ) def content_mode_field(key: str, hint: str) -> Field: return Field(key, "Inhalt der Alarmnachrichten", kind="select", default=CONTENT_MODE_FULL, choices=CHOICES, hint=hint) def validate_content_mode(values: dict, key: str) -> list[str]: value = values.get(key, "") if value and value not in CONTENT_MODES: return ["Inhalt der Alarmnachrichten muss \"voll\" oder \"kurz\" sein."] return []