Includes atomic migrations, per-rule reminder semantics, first-run helper script and the note on the undecided UI chat idea. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
721 B
Python
20 lines
721 B
Python
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 []
|