Merkmal personalisierung (Migration 0062) und Hinweisseite /personalisierung
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46ec2f5151
commit
e72d9da725
2 files changed
+53
-1
No files matched your search
@@ -23,7 +23,7 @@ from cryptography.fernet import Fernet, InvalidToken
|
||||
|
||||
from fastapi import FastAPI, Header, HTTPException, Request
|
||||
from pydantic import BaseModel
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.responses import FileResponse, HTMLResponse
|
||||
|
||||
|
||||
LOG_PATH = Path("activation.log")
|
||||
@@ -5822,6 +5822,35 @@ def health():
|
||||
}
|
||||
|
||||
|
||||
# Startseite des Kiosks im Konto "Personalisierung" (ADR-0041, Rolle
|
||||
# personalisierung in ansible-content). Bis das Formular mit Aktivierungscode
|
||||
# steht, nur ein Hinweis. "tuxflotte:abmelden" fängt der Kiosk ab und beendet
|
||||
# die Sitzung.
|
||||
PERSONALISIERUNG_SEITE = """<!doctype html>
|
||||
<html lang="de"><head><meta charset="utf-8">
|
||||
<title>Personalisierung</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; background: #f4f4f4; color: #222;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
height: 100vh; margin: 0; }
|
||||
main { max-width: 34em; text-align: center; }
|
||||
a { display: inline-block; margin: 1em .5em; padding: .7em 1.4em;
|
||||
background: #2a6db0; color: #fff; text-decoration: none; border-radius: 4px; }
|
||||
</style></head><body><main>
|
||||
<h1>Personalisierung</h1>
|
||||
<p>Hier wird bald ein persönliches Konto für dieses Gerät eingerichtet.
|
||||
Dafür brauchst du einen Aktivierungscode von der Verwaltung deiner
|
||||
Einrichtung. Die Einrichtung ist noch nicht freigeschaltet.</p>
|
||||
<a href="tuxflotte:abmelden">Abmelden</a>
|
||||
</main></body></html>
|
||||
"""
|
||||
|
||||
|
||||
@app.get("/personalisierung", response_class=HTMLResponse)
|
||||
def personalisierung_seite():
|
||||
return HTMLResponse(PERSONALISIERUNG_SEITE, headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
@app.post("/api/v1/activate")
|
||||
def activate(payload: ActivationRequest, request: Request):
|
||||
# Enrollment Sessions zuerst versuchen (Auto-Modus-ISOs, siehe
|
||||
|
||||
Reference in new issue
Block a user