erste fassung komplett

This commit is contained in:
br committed 2022-10-27 22:31:41 +02:00
1 parent ff2b35179a
commit 06fc10a5c6
8 files changed
+312 -4

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
app.cpython-310.pyc
energiemon.db
gtVi.py
+34 -4
View File
@@ -1,8 +1,38 @@
from flask import Flask
import sqlite3
from flask import Flask, render_template, request, url_for, flash, redirect
from werkzeug.exceptions import abort
def get_db_connection():
conn = sqlite3.connect('energiemon.db')
conn.row_factory = sqlite3.Row
return conn
app = Flask(__name__)
app.config['SECRET_KEY'] = 'Voobaiyae*h7kigj'
@app.route('/', methods=('GET', 'POST'))
def index():
@app.route('/')
def hello():
return 'Hello, World!'
if request.method == 'POST':
gaszaehler = request.form['gaszaehler']
stromzaehler = request.form['stromzaehler']
wasserzaehler = request.form['wasserzaehler']
wetter = "weteter"
conn = get_db_connection()
conn.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)",
(gaszaehler , stromzaehler, wasserzaehler, wetter )
)
conn.commit()
conn.close()
flash('Vielen Dank G' + gaszaehler + ' S' + stromzaehler + ' W' + wasserzaehler,'success')
return redirect(url_for('index'))
conn = get_db_connection()
eintraege = conn.execute('SELECT * FROM eintraege').fetchall()
conn.close()
return render_template('index.html', eintraege=eintraege )
if __name__ == '__main__':
app.run()
View File
Whitespace-only changes.
+107
View File
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="132.56mm" height="132.56mm" viewBox="0 0 13256 13256" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="13256" height="13256"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="13" y="13" width="13230" height="13230"/>
</clipPath>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
<g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
</g>
</defs>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="container-id1">
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="Group">
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id3">
<rect class="BoundingBox" stroke="none" fill="none" x="4562" y="2539" width="4060" height="4065"/>
<path fill="rgb(151,194,30)" stroke="none" d="M 8594,4426 C 8432,3359 7515,2539 6404,2539 L 6404,2917 C 5385,2917 4562,3745 4562,4760 4562,5779 5389,6603 6404,6603 7163,6603 7815,6144 8096,5488 L 7663,5488 C 7409,5925 6941,6218 6398,6218 5590,6218 4936,5564 4936,4756 L 5317,4756 C 5317,4764 5317,4770 5317,4780 5317,5365 5790,5840 6377,5840 6843,5840 7235,5539 7376,5125 L 6962,5125 C 6843,5324 6627,5459 6381,5459 6006,5459 5702,5155 5702,4780 5702,4774 5702,4766 5702,4756 L 7353,4756 7862,4756 8244,4756 8247,4756 8621,4756 C 8621,4692 8619,4631 8611,4567 L 8008,4440 8038,4305 8594,4426 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id4">
<rect class="BoundingBox" stroke="none" fill="none" x="6953" y="3227" width="936" height="933"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 7420,4159 C 7163,4159 6954,3950 6954,3694 6954,3437 7163,3228 7420,3228 7677,3228 7887,3437 7887,3694 7889,3950 7680,4159 7420,4159 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id5">
<rect class="BoundingBox" stroke="none" fill="none" x="7062" y="3349" width="455" height="455"/>
<path fill="rgb(112,111,111)" stroke="none" d="M 7288,3802 C 7163,3802 7062,3700 7062,3575 7062,3450 7163,3349 7288,3349 7413,3349 7515,3450 7515,3575 7515,3700 7413,3802 7288,3802 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id6">
<rect class="BoundingBox" stroke="none" fill="none" x="3586" y="9495" width="6086" height="1145"/>
<path fill="rgb(112,111,111)" stroke="none" d="M 4156,9698 L 4726,9698 4726,9495 4156,9495 C 3842,9495 3586,9751 3586,10065 3586,10379 3842,10635 4156,10635 L 4726,10635 4726,10433 4156,10433 C 3953,10433 3789,10268 3789,10065 3789,9862 3953,9698 4156,9698 Z M 5266,10433 C 5196,10422 5139,10366 5128,10295 L 5128,9499 4925,9499 4925,10278 C 4925,10336 4940,10389 4962,10436 4997,10508 5057,10568 5128,10602 5176,10625 5229,10639 5287,10639 L 5867,10639 5867,10436 5266,10433 Z M 6465,9495 C 6151,9495 5895,9751 5895,10065 5895,10379 6151,10635 6465,10635 6779,10635 7035,10379 7035,10065 7035,9751 6782,9495 6465,9495 Z M 6465,10433 C 6262,10433 6097,10268 6097,10065 6097,9862 6263,9698 6465,9698 6667,9698 6833,9862 6833,10065 6833,10268 6667,10433 6465,10433 Z M 8129,9495 L 8129,10065 C 8129,10268 7964,10433 7761,10433 7559,10433 7393,10268 7393,10065 L 7393,9495 7191,9495 7191,10065 C 7191,10379 7448,10635 7761,10635 8075,10635 8332,10379 8332,10065 L 8332,9495 8129,9495 Z M 8531,9495 L 8531,10635 9101,10635 C 9256,10635 9398,10572 9503,10467 9513,10457 9526,10443 9536,10433 9620,10336 9671,10204 9671,10065 9671,9751 9415,9495 9101,9495 L 8531,9495 Z M 8733,9700 L 9101,9700 C 9304,9700 9468,9867 9468,10069 9468,10271 9304,10436 9101,10436 L 8733,10436 8733,9700 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id7">
<rect class="BoundingBox" stroke="none" fill="none" x="1020" y="7682" width="11217" height="1145"/>
<path fill="rgb(112,111,111)" stroke="none" d="M 1590,7885 L 2160,7885 2160,7682 1590,7682 C 1276,7682 1020,7938 1020,8252 1020,8566 1276,8822 1590,8822 L 2160,8822 2160,8621 1590,8621 C 1389,8621 1223,8455 1223,8252 1223,8051 1389,7885 1590,7885 Z M 3295,7682 L 3295,8098 2562,8098 2562,7682 2361,7682 2361,8822 2562,8822 2562,8299 3295,8299 3295,8822 3497,8822 3497,7682 3295,7682 Z M 4693,8621 L 4213,7682 3733,8621 3629,8822 3858,8822 3963,8621 4213,8131 4463,8621 4568,8822 4797,8822 4693,8621 Z M 5864,7838 L 5495,8121 5128,7838 4925,7682 4925,8822 5128,8822 5128,8094 5327,8246 5493,8375 5657,8246 5856,8094 5856,8822 6059,8822 6059,7682 5864,7838 Z M 7261,8621 L 6781,7682 6303,8621 6198,8822 6428,8822 6532,8621 6781,8131 7031,8621 7136,8822 7365,8822 7261,8621 Z M 7798,8621 C 7726,8611 7669,8553 7659,8482 L 7659,7686 7457,7686 7457,8465 C 7457,8523 7470,8576 7494,8623 7527,8695 7589,8756 7659,8789 7710,8812 7761,8826 7818,8826 L 8399,8826 8399,8623 7798,8621 Z M 8897,7885 L 9732,7885 9732,7682 8897,7682 C 8729,7682 8590,7821 8590,7989 L 8590,8516 C 8590,8685 8729,8822 8897,8822 L 9732,8822 9732,8621 8897,8621 C 8840,8621 8793,8574 8793,8516 L 8793,8299 9525,8299 9525,8098 8793,8098 8793,7993 C 8793,7932 8840,7885 8897,7885 Z M 10370,7682 C 10056,7682 9799,7938 9799,8252 9799,8566 10056,8822 10370,8822 10683,8822 10940,8566 10940,8252 10940,7938 10683,7682 10370,7682 Z M 10370,8621 C 10167,8621 10001,8454 10001,8252 10001,8050 10167,7885 10370,7885 10572,7885 10737,8050 10737,8252 10737,8454 10572,8621 10370,8621 Z M 12033,7682 L 12033,8412 11301,7844 11098,7688 11098,8826 11301,8826 11301,8104 12033,8671 12236,8826 12236,7686 12033,7682 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id8">
<rect class="BoundingBox" stroke="none" fill="none" x="6360" y="7682" width="204" height="205"/>
<path fill="rgb(112,111,111)" stroke="none" d="M 6461,7885 C 6518,7885 6562,7838 6562,7784 6562,7727 6514,7682 6461,7682 6407,7682 6360,7729 6360,7784 6360,7841 6407,7885 6461,7885 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id9">
<rect class="BoundingBox" stroke="none" fill="none" x="7001" y="7682" width="204" height="205"/>
<path fill="rgb(112,111,111)" stroke="none" d="M 7103,7885 C 7160,7885 7204,7838 7204,7784 7204,7727 7157,7682 7103,7682 7046,7682 7001,7729 7001,7784 7001,7841 7046,7885 7103,7885 Z"/>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+51
View File
@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- <link rel="stylesheet" href="{{ url_for('static', filename= 'css/style.css') }}"> -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<title>{% block title %} {% endblock %}</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="{{ url_for('index')}}">Zählerstände für EnergieMonitor</a>
</nav>
<div class="container">
{% with errors = get_flashed_messages(category_filter=["error"]) %}
{% if errors %}
<div class="alert-message block-message error">
<ul>
{%- for msg in errors %}
<div class="alert alert-danger">{{ msg }}</dev>
{% endfor -%}
</ul>
</div>
{% endif %}
{% endwith %}
{% with successmsgs = get_flashed_messages(category_filter=["success"]) %}
{% if successmsgs %}
<div class="alert-message block-message success">
<ul>
{%- for msg in successmsgs %}
<div class="alert alert-success">{{ msg }}</dev>
{% endfor -%}
</ul>
</div>
{% endif %}
{% endwith %}
{% block content %} {% endblock %}
</div>
<!-- Optional JavaScript -->
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.min.js" integrity="sha384-IDwe1+LCz02ROU9k972gdyvl+AESN10+x7tBKgc9I5HFtuNz0wWnPclzo6p9vxnk" crossorigin="anonymous"></script>
</body>
</html>
+75
View File
@@ -0,0 +1,75 @@
{% extends 'base.html' %}
{% block content %}
<h1>{% block title %} EnergieMonitor {% endblock %}</h1>
<h2> Erfassung </h2>
<div class="row">
<div class="col-sm-6">
<small> App statt Zettel!
<br>
Hier gibt es etwas zu erfassen....
</small>
</div>
<img src="{{ url_for('static', filename='CCLOGO-vect.svg') }}" alt="Chamäleon Logo" class="img-thumbnail col-sm-6" width=25%>
</div>
<form method="post" name="Erfassung" >
<div class="form-group ">
<label for="gaszaehler">Gaszählerstand</label>
<input type="text" name="gaszaehler"
placeholder="0" class="form-control"
value="{{ request.form['gaszaehler'] }}"></input>
<br/>
<label for="stromzaehler">Stromzählerstand</label>
<input type="text" name="stromzaehler"
placeholder="0" class="form-control"
value="{{ request.form['stromzaehler'] }}"></input>
<br />
<label for="wasserzaehler">Wasseruhrenstand</label>
<input type="text" name="wasserzaehler"
placeholder="0" class="form-control"
value="{{ request.form['wasserzaehler'] }}"></input>
</div>
</br>
<div class="form-group">
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</form>
<h2> Infos / Datenschutz </h2>
<p>
Diese Erfassung läuft bei uns im Serverraum. </br>
Die hier aufgenommenen Daten werden <em>vertraulich</em> und lediglich für die Auswertung von
Verbräuchen verwendet.
Bei Fragen zur Datenhaltung und zum Datenschutz wenden Sie sich gern <br/>
an: <a href="mailto:kontakt@chamaeleoncloud.de"> kontakt @ ChamäleonCloud </a>
</p>
<!--
<h2> Einträge bisher:</h2>
<p>
{% for eintrag in eintraege %}
<a href="#">
<h4>{{ eintrag['id'] }}</h4>
</a>
<div> G {{ eintrag['gaszaehler'] }}, S {{ eintrag['stromzaehler'] }}, W {{ eintrag['wasserzaehler'] }}, {{ eintrag['wetterinfo']}} </div>
<span >Z {{ eintrag['zeitpunkt'] }}</span>
<hr>
{% endfor %}
</p>
-->
<table class="table">
<tbody>
<tr>
<td> <a href="https://www.xn--chamleoncloud-efb.de/">ChamäleonCloud Website</a> </td>
<td> <a href="https://www.xn--chamleoncloud-efb.de/impressum">Impressum</a> </td>
<td> <a href="https://www.xn--chamleoncloud-efb.de/datenschutz">Datenschutz</a> </td>
</tr>
</div>
{% endblock %}
+44
View File
@@ -0,0 +1,44 @@
{% extends 'base.html' %}
{% block content %}
<h1>{% block title %} Registrierung {% endblock %}</h1>
<h2> Registrierung </h2>
<h2> Infos / Datenschutz </h2>
<p>
Diese Registrierung läuft lokal bei uns im Haus. </br>
Die hier aufgenommenen Daten werden <em>vertraulich</em> und lediglich für die ggf. nötige,
hilfreiche Nachverfolgung von Infektionsketten im Zusammenhang mit der Corona-Pandemie aufgenommen,
maximal vier Wochen gesichert im Hause aufbewahrt und nur auf Anfrage an das zuständige Gesundheitsamt weitergegeben.
<br/>
Verpflichtende Angaben sind:
<ul>
<li> Datum, Zeit (Wird automatisch erfasst) </li>
<li> Vorname, Name </li>
<li> <strong>Eine</strong> Angabe von </li>
<ul>
<li> Telefonnummer <em>oder</em></li>
<li> E-Mail Adresse <em>oder</em></li>
<li> Anschrift (Straße Hausnummer, PLZ Ort </li>
</ul>
</ul>
Bei Fragen zur Datenhaltung und zum Datenschutz wenden Sie sich gern <br/>
an: <a href="mailto:moin@gut-moorbeck.de"> [E-Mail] moin @ Gut Moorbeck </a>
</p>
<!-- -->
{#
<h2> Gäste bisher:</h2>
<p>
{% for gast in guests %}
<a href="#">
<h2>{{ gast['nachname'] }}</h2>
</a>
<div> {{ gast['nachname'] }}, {{ gast['vorname'] }}, {{ gast['anschrift'] }}, {{ gast['telefonnummer']}}, {{ gast['emailadresse'] }}, {{ gast['id'] }} </div>
<span class="badge badge-primary">{{ gast['zeitpunkt'] }}</span>
<hr>
{% endfor %}
</p>
#} <!-- -->
{% endblock %}