From dea50dc3b69b527a14e6e01ae6f7cba2964dd7f1 Mon Sep 17 00:00:00 2001 From: Qangan Date: Fri, 23 Feb 2024 10:08:53 +0700 Subject: [PATCH] qol changes --- README.md | 2 + accounts.json | 6 -- mashinka.py => app.py | 0 data.json | 1 - default_templates/login.html | 62 ++++++++++++++++++ default_templates/register.html | 57 +++++++++++++++++ default_templates/unauthorized.html | 99 +++++++++++++++++++++++++++++ templates/index.html | 2 +- test.py | 81 ----------------------- webs.py => test_led.py | 0 webs | 0 11 files changed, 221 insertions(+), 89 deletions(-) delete mode 100644 accounts.json rename mashinka.py => app.py (100%) delete mode 100644 data.json create mode 100644 default_templates/login.html create mode 100644 default_templates/register.html create mode 100644 default_templates/unauthorized.html delete mode 100644 test.py rename webs.py => test_led.py (100%) delete mode 100644 webs diff --git a/README.md b/README.md index e69de29..6119315 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,2 @@ +Заготовки под финал умного города 2023/2024 +=========================================== diff --git a/accounts.json b/accounts.json deleted file mode 100644 index 6b9b537..0000000 --- a/accounts.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "username": "1", - "password": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b" - } -] \ No newline at end of file diff --git a/mashinka.py b/app.py similarity index 100% rename from mashinka.py rename to app.py diff --git a/data.json b/data.json deleted file mode 100644 index 0967ef4..0000000 --- a/data.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/default_templates/login.html b/default_templates/login.html new file mode 100644 index 0000000..b9c385b --- /dev/null +++ b/default_templates/login.html @@ -0,0 +1,62 @@ + + + + + + + Mashinka Control + + + + + + + + + + + + + + +
+
+
+ + +
+

+
+ + +
+

+ +
+ {% if err != '' %} +

{{err}}

+ {% endif%} +
+ + + + + + + + + + + + diff --git a/default_templates/register.html b/default_templates/register.html new file mode 100644 index 0000000..02f6312 --- /dev/null +++ b/default_templates/register.html @@ -0,0 +1,57 @@ + + + + + + + Mashinka Control + + + + + + + + + + + + + + +
+
+
+ + +
+

+
+ + +
+

+ +
+ {% if err != '' %} +

{{err}}

+ {% endif%} +
+ + + + + + + diff --git a/default_templates/unauthorized.html b/default_templates/unauthorized.html new file mode 100644 index 0000000..bb8930b --- /dev/null +++ b/default_templates/unauthorized.html @@ -0,0 +1,99 @@ + + + + + + + Mashinka Control + + + + + + + + + + + + + +
+

Вы не авторизированы

+
+ +       + +
+ + + + + + + + + + + + + + + + + diff --git a/templates/index.html b/templates/index.html index ee645f2..bb8930b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,7 +20,7 @@
Seal Team - Управление машинкой + Недостаточно прав
diff --git a/test.py b/test.py deleted file mode 100644 index 118cc13..0000000 --- a/test.py +++ /dev/null @@ -1,81 +0,0 @@ -from flask import Flask, request, redirect, url_for, render_template, json, render_template_string, jsonify - -app = Flask(__name__) - - -@app.route('/', methods=['GET', 'POST']) -def control_panel(): - print('request.form:', request.form) - - if request.method == 'POST': - if request.form.get('button') == 'button-play': - print("play button pressed") - - elif request.form.get('button') == 'button-exit': - print("exit button pressed") - - elif request.form.get('slide'): - volume = request.form.get('slide') - print('volume:', volume) - #return jsonify({'volume': volume}) - return json.dumps({'volume': volume}) - - print('render') - return render_template_string(''' - - - - - - - - - - Slider - - -
-
-
-
- - - - - -
-
-
-
- - - - - - - -''') - -if __name__ == '__main__': - app.run(debug=True, use_reloader=False) diff --git a/webs.py b/test_led.py similarity index 100% rename from webs.py rename to test_led.py diff --git a/webs b/webs deleted file mode 100644 index e69de29..0000000