wifi geht

This commit is contained in:
2023-11-06 19:41:27 +01:00
parent 8fd88f1805
commit 99ff706a12
6 changed files with 85 additions and 32 deletions

View File

@@ -55,7 +55,7 @@ def cal():
@app.route("/qr.html")
def makeqr():
data = ""
data = "Sorry kein Inhalt!!!"
if request.args.get('type') == "text":
data = request.args.get('text')
@@ -72,8 +72,18 @@ def makeqr():
pass
elif request.args.get('type') == "wifi":
pass
passw = (request.args.get("passw").replace("\\", "\\\\").replace(";", "\\;")
.replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\""))
ssid = (request.args.get("ssid").replace("\\", "\\\\").replace(";", "\\;")
.replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\""))
if request.args.get("auth") == "WPA":
data = f'WIFI:T:WPA;S:"{ssid}";P:"{passw}"'
else:
data = f'WIFI:T:nopass;S:"{ssid}"'
if request.args.get("hidden"):
data += "H:true;;"
else:
data += ";"
elif request.args.get('type') == "cal":
# Format für Calendar (Zeilenumbrüche beachten!!):
# BEGIN:VEVENT
@@ -124,9 +134,6 @@ def makeqr():
else:
data += "?"
data += f"body={request.args.get('body')}"
else:
data = "Sorry kein Inhalt!!!"
return render_template('qr.html', data=data)

View File

@@ -26,3 +26,16 @@
border-radius: 50px;
filter: drop-shadow(10px 10px 10px blue);
}
input[type='radio']
{
transform: scale(4);
margin: 10px;
vertical-align:12px;
}
input[type='checkbox']
{
transform: scale(4);
margin: 10px;
vertical-align:12px;
}

View File

@@ -2,7 +2,7 @@
{% block inhalt %}
<form action="qr.html">
<label>Gib bitte Details für deinen Termin ein!</label><br />
<label>Gebe bitte Details für deinen Termin ein!</label><br />
<input type="hidden" name="type" value="cal">
<label for="title">Titel:</label>

View File

@@ -9,6 +9,6 @@
<!--<div><button><a href="./vcard.html">Visitenkarte (vCard)</a></button></div>-->
<!--<div><button><a href="./geo.html">geographische Koordinaten</a></button></div>-->
<div><button><a href="./mail.html">EMail-Adresse</a></button></div>
<!--<div><button><a href="./wifi.html">WIFI</a></button></div>-->
<<div><button><a href="./wifi.html">WIFI</a></button></div>
<div><button><a href="./cal.html">Kalender-Termin</a></button></div>
{% endblock %}

View File

@@ -2,13 +2,21 @@
{% block inhalt %}
<form action="qr.html">
<label>Gib bitte Details zum WIFI ein!</label><br />
<label>Gebe bitte Details zum WIFI ein!</label><br />
<input type="hidden" name="type" value="wifi">
<label for="ssid">SSID:</label>
<label for="ssid">Netzwerkname (SSID):</label>
<input type="text" name="ssid" id="ssid" size="30" maxlength="60" required><br />
<label for="passw">Passcode &#47; Passwort:</label>
<input type="text" name="passw" id="passw" size="30" maxlength="60"><br />
<input type="checkbox" name="hidden" id="hidden" value=True>
<label for="hidden"><i>versteckte &#47; unsichtbare SSID</i></label><br />
<label>
<input name="auth" type="radio" value="WPA" required>
</label> WPA/WPA2/WPA3<br />
<label>
<input name="auth" type="radio" value="nopass" required>
</label> keine Verschl&uuml;sselung