This commit is contained in:
jonnybravo
2026-07-20 17:16:55 +02:00
parent ab91d5582d
commit a8b103e2c6
14 changed files with 383 additions and 120 deletions

View File

@@ -31,6 +31,12 @@ class AppState(rx.State):
error: str = ""
show_preview: bool = False
preview_content: str = ""
@rx.var
def error_color(self) -> str:
if "erfolgreich" in self.error:
return "green"
return "red"
def toggle_preview(self):
"""Schaltet die Vorschau um."""
@@ -65,7 +71,7 @@ class AppState(rx.State):
try:
with open(os.path.join(OUTPUT_DIR, val), "r", encoding="utf-8") as f:
self.output = f.read()
self.error = f"Log geladen: {val}"
self.error = f"Log erfolgreich geladen: {val}"
except Exception as e:
self.error = f"Fehler beim Laden des Logs: {str(e)}"
@@ -210,7 +216,7 @@ def index():
),
rx.cond(
AppState.error,
rx.text(AppState.error, color="red"),
rx.text(AppState.error, color=AppState.error_color),
),
spacing="2"
),
@@ -257,7 +263,7 @@ def index():
AppState.error,
rx.text(
AppState.error,
color="red",
color=AppState.error_color,
margin_top="1em",
font_weight="bold"
),