diff --git a/app.py b/app.py index a48e8d39d866fbbac73dfde665e075cac7755eb1..4fa320faae384ff0682a28efc4cc8a2d675fb969 100644 --- a/app.py +++ b/app.py @@ -16,18 +16,19 @@ def main(): def values(): return read_latest_entry_as_json() + @app.route("/past-values") def pastValues(): past_values = {"npkData": { "nitrogen": [120, 118, 119, 121, 120, 122, 120], "phosphorus": [110, 112, 111, 113, 110, 112, 111], "potassium": [115, 116, 117, 115, 114, 116, 117] - }, - "thmData": { + }, + "thmData": { "temperature": [18, 19, 20, 18, 17, 18, 19], "humidity": [50, 52, 53, 50, 49, 51, 52], "moisture": [40, 42, 45, 43, 41, 40, 44] - }} + }} return jsonify(past_values) diff --git a/src/components/ValueTabs.vue b/src/components/ValueTabs.vue index 5b7da556f386cef6b941c14d59d8bfc196080e1f..7dbf367691480e436afdda97d8165aceb76b5802 100644 --- a/src/components/ValueTabs.vue +++ b/src/components/ValueTabs.vue @@ -46,42 +46,48 @@ export default { Nitrogen (N): <li class="list-group-item" 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> </div> <div class="valueBox"> Phosphorus (P): <li class="list-group-item" 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> </div> <div class="valueBox"> Potassium (K): <li class="list-group-item" 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> </div> <div class="valueBox"> Temperature: <li class="list-group-item" 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> </div> <div class="valueBox"> Humidity: <li class="list-group-item" 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> </div> <div class="valueBox"> Moisture: <li class="list-group-item" 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> </div> </div>