docs(settings): Update README + Copilot instructions; bump Program Info to 2025.1.0-alpha.11
README: Add System Settings API endpoints; describe new tabbed Settings layout with role gating; add Vite dev proxy tip to use relative /api paths. Copilot instructions: Note SystemSetting key–value store in data model; document system_settings.py (CRUD + supplement-table convenience endpoint); reference apiSystemSettings.ts; note defaults seeding via init_defaults.py. Program Info: Bump version to 2025.1.0-alpha.11; changelog explicitly tied to the Settings page (Events tab: supplement-table URL moved; Academic Calendar: set active period; proxy note); README docs mention. No functional changes to API or UI code in this commit; documentation and program info only.
This commit is contained in:
@@ -42,3 +42,25 @@ with engine.connect() as conn:
|
||||
print(f"✅ Superadmin-Benutzer '{admin_user}' angelegt.")
|
||||
else:
|
||||
print(f"ℹ️ Superadmin-Benutzer '{admin_user}' existiert bereits.")
|
||||
|
||||
# Default System Settings anlegen
|
||||
default_settings = [
|
||||
('supplement_table_url', '', 'URL für Vertretungsplan (Stundenplan-Änderungstabelle)'),
|
||||
('supplement_table_enabled', 'false', 'Ob Vertretungsplan aktiviert ist'),
|
||||
]
|
||||
|
||||
for key, value, description in default_settings:
|
||||
result = conn.execute(
|
||||
text("SELECT COUNT(*) FROM system_settings WHERE `key`=:key"),
|
||||
{"key": key}
|
||||
)
|
||||
if result.scalar() == 0:
|
||||
conn.execute(
|
||||
text("INSERT INTO system_settings (`key`, value, description) VALUES (:key, :value, :description)"),
|
||||
{"key": key, "value": value, "description": description}
|
||||
)
|
||||
print(f"✅ System-Einstellung '{key}' angelegt.")
|
||||
else:
|
||||
print(f"ℹ️ System-Einstellung '{key}' existiert bereits.")
|
||||
|
||||
print("✅ Initialisierung abgeschlossen.")
|
||||
|
||||
Reference in New Issue
Block a user