Compare commits
6 Commits
e8b41b402e
...
277930acde
Author | SHA1 | Date | |
---|---|---|---|
|
277930acde | ||
|
4aab99bcbc | ||
|
58242e82a6 | ||
|
3ec11e3051 | ||
|
da166e5169 | ||
|
526e6d3439 |
32
.drone.yml
Normal file
32
.drone.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: python:3-buster
|
||||||
|
commands:
|
||||||
|
- export PYTHONPATH=.
|
||||||
|
- export FLASK_APP=period
|
||||||
|
- apt-get update -qy
|
||||||
|
- apt-get install -y python3-dev python3-pip
|
||||||
|
- pip3 install --upgrade pip
|
||||||
|
- pip3 install --upgrade setuptools
|
||||||
|
- pip3 install Flask gunicorn pytest pytest-cov
|
||||||
|
- pip3 install pendulum
|
||||||
|
# ---
|
||||||
|
# kind: pipeline
|
||||||
|
# type: docker
|
||||||
|
# name: test
|
||||||
|
# steps:
|
||||||
|
# - name: test
|
||||||
|
# image: python:3-buster
|
||||||
|
# commands:
|
||||||
|
# - export PYTHONPATH=.
|
||||||
|
# - export FLASK_APP=period
|
||||||
|
# - apt-get update -qy
|
||||||
|
# - apt-get install -y python3-dev python3-pip
|
||||||
|
# - pip3 install --upgrade pip
|
||||||
|
# - pip3 install --upgrade setuptools
|
||||||
|
# - pip3 install Flask gunicorn pytest pytest-cov
|
||||||
|
# - pip3 install pendulum
|
||||||
|
# - pytest tests --cov --cov-report term --cov-report html --junitxml=report.xml
|
@ -27,7 +27,7 @@ def success():
|
|||||||
def main_page():
|
def main_page():
|
||||||
query_api = client.query_api()
|
query_api = client.query_api()
|
||||||
query = 'from(bucket: "gas")\
|
query = 'from(bucket: "gas")\
|
||||||
|> range(start: -30d)\
|
|> range(start: -90d)\
|
||||||
|> filter(fn: (r) => r["_measurement"] == "2016_odyssey")\
|
|> filter(fn: (r) => r["_measurement"] == "2016_odyssey")\
|
||||||
|> filter(fn: (r) => r["_field"] == "odometer")\
|
|> filter(fn: (r) => r["_field"] == "odometer")\
|
||||||
|> sort(columns: ["_value"], desc: false)\
|
|> sort(columns: ["_value"], desc: false)\
|
||||||
@ -50,6 +50,10 @@ def main_page():
|
|||||||
temp['fuelcost'] = record['fuelcost']
|
temp['fuelcost'] = record['fuelcost']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
temp['winter'] = record['winter']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
results.append(temp)
|
results.append(temp)
|
||||||
# .append((record.get_time(), record.get_field(), record.get_value()))
|
# .append((record.get_time(), record.get_field(), record.get_value()))
|
||||||
newlist = sorted(results, key=itemgetter('time'), reverse=True)
|
newlist = sorted(results, key=itemgetter('time'), reverse=True)
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
|
autopep8==1.7.0
|
||||||
certifi==2022.6.15
|
certifi==2022.6.15
|
||||||
click==6.6
|
click==8.1.3
|
||||||
|
Flask==2.2.2
|
||||||
|
importlib-metadata==5.0.0
|
||||||
influxdb-client==1.30.0
|
influxdb-client==1.30.0
|
||||||
itsdangerous==0.24
|
itsdangerous==2.1.2
|
||||||
MarkupSafe==0.23
|
Jinja2==3.1.2
|
||||||
|
MarkupSafe==2.1.1
|
||||||
pendulum==2.1.2
|
pendulum==2.1.2
|
||||||
|
pycodestyle==2.9.1
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
python-dotenv==0.21.0
|
||||||
pytz==2016.10
|
pytz==2016.10
|
||||||
pytzdata==2020.1
|
pytzdata==2020.1
|
||||||
requests==2.12.4
|
requests==2.12.4
|
||||||
Rx==3.2.0
|
Rx==3.2.0
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
|
toml==0.10.2
|
||||||
urllib3==1.26.9
|
urllib3==1.26.9
|
||||||
Werkzeug==0.11.11
|
Werkzeug==2.2.2
|
||||||
WTForms==2.1
|
WTForms==2.1
|
||||||
|
zipp==3.10.0
|
||||||
|
@ -47,10 +47,18 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<label for="winter">Winter Tires:</label>
|
<label for="winter">Winter Tires:</label>
|
||||||
<select name="winter" class="form-control" default="false">
|
<select name="winter" class="form-control">
|
||||||
<option value="TRUE">True</option>
|
{% if data %}
|
||||||
<option value="FALSE" selected>False</option>
|
{% if data[0]['winter'] == "True" %}
|
||||||
</select>
|
<option value="TRUE" selected>True</option>
|
||||||
|
<option value="FALSE">False</option>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<option value="TRUE">True</option>
|
||||||
|
<option value="FALSE" selected>False</option>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div><br>
|
</div><br>
|
||||||
<input type="submit" value="Go">
|
<input type="submit" value="Go">
|
||||||
@ -69,6 +77,7 @@ Last Mileage
|
|||||||
<th scope="col">Oil</th>
|
<th scope="col">Oil</th>
|
||||||
<th scope="col">Litres</th>
|
<th scope="col">Litres</th>
|
||||||
<th scope="col">$/Litre</th>
|
<th scope="col">$/Litre</th>
|
||||||
|
<th scope="col">$ Total</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -79,6 +88,9 @@ Last Mileage
|
|||||||
<td>{{ point['oilhealth'] }}</td>
|
<td>{{ point['oilhealth'] }}</td>
|
||||||
<td>{{ point['fuel'] }}</td>
|
<td>{{ point['fuel'] }}</td>
|
||||||
<td>{{ point['fuelcost'] }}</td>
|
<td>{{ point['fuelcost'] }}</td>
|
||||||
|
{% if point['fuel'] %}
|
||||||
|
<td>{{ '%0.2f' % ((point['fuel'] | float) * (point['fuelcost'] | float)) }}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
Reference in New Issue
Block a user