Skip to content
Snippets Groups Projects
Commit 11688780 authored by Wortman, Elliot (UG - Comp Sci & Elec Eng)'s avatar Wortman, Elliot (UG - Comp Sci & Elec Eng)
Browse files

Volar + pep8 formatting

parent 051617a0
No related branches found
No related tags found
1 merge request!6Tooltips + Formatting
...@@ -16,18 +16,19 @@ def main(): ...@@ -16,18 +16,19 @@ def main():
def values(): def values():
return read_latest_entry_as_json() return read_latest_entry_as_json()
@app.route("/past-values") @app.route("/past-values")
def pastValues(): def pastValues():
past_values = {"npkData": { past_values = {"npkData": {
"nitrogen": [120, 118, 119, 121, 120, 122, 120], "nitrogen": [120, 118, 119, 121, 120, 122, 120],
"phosphorus": [110, 112, 111, 113, 110, 112, 111], "phosphorus": [110, 112, 111, 113, 110, 112, 111],
"potassium": [115, 116, 117, 115, 114, 116, 117] "potassium": [115, 116, 117, 115, 114, 116, 117]
}, },
"thmData": { "thmData": {
"temperature": [18, 19, 20, 18, 17, 18, 19], "temperature": [18, 19, 20, 18, 17, 18, 19],
"humidity": [50, 52, 53, 50, 49, 51, 52], "humidity": [50, 52, 53, 50, 49, 51, 52],
"moisture": [40, 42, 45, 43, 41, 40, 44] "moisture": [40, 42, 45, 43, 41, 40, 44]
}} }}
return jsonify(past_values) return jsonify(past_values)
......
...@@ -46,42 +46,48 @@ export default { ...@@ -46,42 +46,48 @@ export default {
Nitrogen (N):  Nitrogen (N): 
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[0].N, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[0].N, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{
values[0].N }} ppm</li> values[0].N }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Phosphorus (P):&nbsp; Phosphorus (P):&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[1].P, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[1].P, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{
values[1].P }} ppm</li> values[1].P }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Potassium (K):&nbsp; Potassium (K):&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[2].K, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[2].K, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{
values[2].K }} ppm</li> values[2].K }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Temperature:&nbsp; Temperature:&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[3].T, this.rangeT[0], this.rangeT[1], this.rangeT[2], this.rangeT[3])" v-bind:class="getClass(values[3].T, this.rangeT[0], this.rangeT[1], this.rangeT[2], this.rangeT[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeT[1] + '-' + this.rangeT[2] + ' °C'">{{ data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeT[1] + '-' + this.rangeT[2] + ' °C'">
{{
values[3].T }} °C</li> values[3].T }} °C</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Humidity:&nbsp; Humidity:&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[4].H, this.rangeHM[0], this.rangeHM[1], this.rangeHM[2], this.rangeHM[3])" v-bind:class="getClass(values[4].H, this.rangeHM[0], this.rangeHM[1], this.rangeHM[2], this.rangeHM[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeHM[1] + '-' + this.rangeHM[2] + ' %'">{{ data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeHM[1] + '-' + this.rangeHM[2] + ' %'">
{{
values[4].H }} %</li> values[4].H }} %</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Moisture:&nbsp; Moisture:&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[5].M, this.rangeHM[0], this.rangeHM[1], this.rangeHM[2], this.rangeHM[3])" v-bind:class="getClass(values[5].M, this.rangeHM[0], this.rangeHM[1], this.rangeHM[2], this.rangeHM[3])"
data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeHM[1] + '-' + this.rangeHM[2] + ' %'">{{ data-bs-toggle="tooltip" :data-bs-title="'Ideal conditions: ' + this.rangeHM[1] + '-' + this.rangeHM[2] + ' %'">
{{
values[5].M }} %</li> values[5].M }} %</li>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment