undefined is teruggekeert in Flask
This commit is contained in:
1
src/css/style.css.map
Normal file
1
src/css/style.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"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","file":"style.css"}
|
||||
50
src/get_data.php
Normal file
50
src/get_data.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// Database-verbinding instellen (vervang deze gegevens door je eigen databasegegevens)
|
||||
$servername = "localhost";
|
||||
$username = "root";
|
||||
$password = "";
|
||||
$dbname = "goodgarden";
|
||||
|
||||
// Verbinding maken met de database
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
|
||||
// Controleren op een geslaagde verbinding
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Query om gegevens op te halen uit de tabel devices
|
||||
$query_devices = "SELECT * FROM devices";
|
||||
$result_devices = $conn->query($query_devices);
|
||||
|
||||
// Query om gegevens op te halen uit de tabel battery_voltage_events
|
||||
$query_battery_voltage = "SELECT * FROM battery_voltage_events";
|
||||
$result_battery_voltage = $conn->query($query_battery_voltage);
|
||||
|
||||
// Query om gegevens op te halen uit de tabel fetch
|
||||
$query_fetch = "SELECT * FROM fetch";
|
||||
$result_fetch = $conn->query($query_fetch);
|
||||
|
||||
// Array om resultaten op te slaan
|
||||
$data = array();
|
||||
|
||||
// Controleren of er resultaten zijn van de tabel devices
|
||||
if ($result_devices->num_rows > 0) {
|
||||
$data['devices'] = $result_devices->fetch_all(MYSQLI_ASSOC);
|
||||
}
|
||||
|
||||
// Controleren of er resultaten zijn van de tabel battery_voltage_events
|
||||
if ($result_battery_voltage->num_rows > 0) {
|
||||
$data['battery_voltage_events'] = $result_battery_voltage->fetch_all(MYSQLI_ASSOC);
|
||||
}
|
||||
|
||||
// Controleren of er resultaten zijn van de tabel fetch
|
||||
if ($result_fetch->num_rows > 0) {
|
||||
$data['fetch'] = $result_fetch->fetch_all(MYSQLI_ASSOC);
|
||||
}
|
||||
|
||||
// Gegevens als JSON-uitvoer
|
||||
echo json_encode($data);
|
||||
|
||||
// Verbinding sluiten
|
||||
$conn->close();
|
||||
113
src/js/main.js
Normal file
113
src/js/main.js
Normal file
@@ -0,0 +1,113 @@
|
||||
const { ipcRenderer } = require("electron");
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () =>
|
||||
{
|
||||
ipcRenderer.send('request-update-temp', ['some', 'arguments']);
|
||||
|
||||
ipcRenderer.on('update-temp-result', (event, newTemperature) => {
|
||||
if (newTemperature === 'error') {
|
||||
console.error('Er is een fout opgetreden bij het ophalen van de nieuwe temperatuur');
|
||||
} else {
|
||||
document.getElementById('bodem-temperatuur').textContent = newTemperature;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function openModal()
|
||||
{
|
||||
const modal = document.getElementById("myModal");
|
||||
const button = document.getElementById("modalButton");
|
||||
const close = document.getElementsByClassName("close")[0];
|
||||
|
||||
// Toon de modal wanneer op de knop wordt geklikt
|
||||
button.onclick = function()
|
||||
{
|
||||
modal.style.display = "block";
|
||||
}
|
||||
|
||||
// Sluit de modal wanneer op het 'sluiten' icoon wordt geklikt
|
||||
close.onclick = function()
|
||||
{
|
||||
modal.style.display = "none";
|
||||
}
|
||||
|
||||
// Sluit de modal wanneer buiten de modal wordt geklikt
|
||||
window.onclick = function(event)
|
||||
{
|
||||
if (event.target == modal)
|
||||
{
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* --- Functie om de grafiek te tekenen. Enigste belangrijke is de eerste 2 "const" arrays "data" & "xLabels".
|
||||
*/
|
||||
function drawLineChart()
|
||||
{
|
||||
/*Dit is de data die getoond wordt als "punt" op de grafiek. 20 = y20 / x20, 50 = y50 / x50 enzovoort... De array "data" & "xLabels" moeten beide evenveel array items hebben!!*/
|
||||
const data = [20, 50, 60, 45, 50, 100, 70, 60, 65, 0, 85, 0];
|
||||
const xLabels = ["", "", "", "", "", 6, "", "", "", "", "", 12];
|
||||
|
||||
const yLabels = ["", 20, "", 40, "", 60, "", 80, "", 100]; /*NIET VERANDEREN!!!*/
|
||||
|
||||
const canvas = document.getElementById("myCanvas");
|
||||
const ctx = canvas.getContext("2d");
|
||||
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
const padding = 35; // Increased padding for Y labels
|
||||
const graphWidth = canvas.width - padding * 2;
|
||||
const graphHeight = canvas.height - padding * 2;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(padding, padding);
|
||||
ctx.lineTo(padding, canvas.height - padding);
|
||||
ctx.lineTo(canvas.width - padding, canvas.height - padding);
|
||||
ctx.stroke();
|
||||
|
||||
// Set the color of the line
|
||||
ctx.strokeStyle = "rgb(143, 188, 143)";
|
||||
|
||||
const xIncrement = graphWidth / (xLabels.length - 1);
|
||||
const yIncrement = graphHeight / (yLabels.length - 1);
|
||||
|
||||
// Plot the data
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(padding, canvas.height - padding - (data[0] / 100) * graphHeight);
|
||||
|
||||
for (let i = 1; i < data.length; i++)
|
||||
{
|
||||
const xPos = padding + i * xIncrement;
|
||||
const yPos = canvas.height - padding - (data[i] / 100) * graphHeight;
|
||||
ctx.lineTo(xPos, yPos);
|
||||
}
|
||||
ctx.stroke();
|
||||
|
||||
// Draw Y labels
|
||||
ctx.fillStyle = "black";
|
||||
ctx.textAlign = "right"; // Align text to the right
|
||||
ctx.textBaseline = "middle"; // Center vertically
|
||||
|
||||
for (let i = 0; i < yLabels.length; i++)
|
||||
{
|
||||
if (yLabels[i] !== "")
|
||||
{
|
||||
const yPos = canvas.height - padding - i * yIncrement;
|
||||
ctx.fillText(yLabels[i], padding - 10, yPos);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw X labels
|
||||
ctx.textAlign = "center"; // Center horizontally for X labels
|
||||
for (let i = 0; i < xLabels.length; i++)
|
||||
{
|
||||
if (xLabels[i] !== "")
|
||||
{
|
||||
const xPos = padding + i * xIncrement;
|
||||
ctx.fillText(xLabels[i], xPos, canvas.height - padding + 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
src/js/planten.class.js
Normal file
32
src/js/planten.class.js
Normal file
@@ -0,0 +1,32 @@
|
||||
dataHardObject = {
|
||||
"id": 1,
|
||||
"plantnaam": "Tomaat",
|
||||
"plantensoort": "Groente",
|
||||
"plantGeteelt": 1
|
||||
}
|
||||
|
||||
// Nieuwe planten aanmaken in de table
|
||||
// function hardcodeData(dataHardObject)
|
||||
// {
|
||||
// dataHardObject => "id"
|
||||
// }
|
||||
|
||||
class Plant {
|
||||
constructor(dataHardObject) {
|
||||
this.id = dataHardObject.id;
|
||||
this.plantNaam = dataHardObject.plantNaam;
|
||||
this.plantensoort = dataHardObject.plantensoort;
|
||||
this.plantGeteelt = dataHardObject.plantGeteelt;
|
||||
}
|
||||
|
||||
htmlData(plantNaam) {
|
||||
if (this.plantGeteelt)
|
||||
{
|
||||
const titel = document.querySelector(".plant-naam");
|
||||
titel.textContent = this.plantNaam;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const tomaatPlant = new Plant(dataHardObject);
|
||||
tomaatPlant.htmlData();
|
||||
119
src/kas_informatie.html
Normal file
119
src/kas_informatie.html
Normal file
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="../src/css/style.css" />
|
||||
<script src="../src/js/main.js" defer></script>
|
||||
<title>Informatie Kas</title>
|
||||
</head>
|
||||
<body>
|
||||
<section class="mainContainer">
|
||||
<article>
|
||||
<img src="../src/images/logo.png" class="goodgarden-logo">
|
||||
</article>
|
||||
<section class="mainBorder informatie-kas-main-container">
|
||||
<article>
|
||||
<h1 class="pagina-titel">Informatie Kas</h1>
|
||||
<section id="sectie-1">
|
||||
<article class="parent-algemeen-overzicht">
|
||||
<article class="algemeen-overzicht">
|
||||
<table class="table-informatie-kas">
|
||||
<tr class="tr-informatie-kas">
|
||||
<td>Dagen tot Oogst</td>
|
||||
<td>12</td>
|
||||
</tr>
|
||||
<tr class="tr-informatie-kas">
|
||||
<td>Dagen in Kas</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr class="tr-informatie-kas">
|
||||
<td>Tevredenheid</td>
|
||||
<td>80%</td>
|
||||
</tr>
|
||||
<tr class="tr-informatie-kas">
|
||||
<td>Aandachtspunten</td>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</article>
|
||||
</article>
|
||||
<article class="grafiek">
|
||||
<article class="grafiek-innerbox">
|
||||
<h2>Zonlicht</h2>
|
||||
<canvas
|
||||
id="myCanvas" class="canvas-informatie-kas" width="275" height="275"></canvas>
|
||||
</article>
|
||||
</article>
|
||||
</section>
|
||||
</article>
|
||||
<article class="grid-column-2">
|
||||
<article class="grid-2-child">
|
||||
<section class="parent-table">
|
||||
<table class="kas-table-1">
|
||||
<tr>
|
||||
<td>Aantal geplant:</td>
|
||||
<td id="totale_planten">Loading...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Succesvolle Oogst:</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gefaalde Oogst:</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="kas-table-2">
|
||||
<tr>
|
||||
<td>Warmste Maand:</td>
|
||||
<td>n.v.t.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>koudste Maand:</td>
|
||||
<td>December</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gemiddelde Bodemtemp.:</td>
|
||||
<td id="bodem-temperatuur">2˚C</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gemiddelde Uren Zonlicht:</td>
|
||||
<td id="battery_voltage">2u</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="kas-table-3">
|
||||
<tr>
|
||||
<td>Laatste Irrigatie:</td>
|
||||
<td>2u</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aankomende Irrigatie:</td>
|
||||
<td>2u</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Laatste Bemesting</td>
|
||||
<td>2d</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aankomende Bemesting:</td>
|
||||
<td>2w</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</article>
|
||||
</article>
|
||||
</section>
|
||||
</section>
|
||||
<script>
|
||||
// JavaScript-code om gegevens op te halen van het PHP-bestand
|
||||
fetch('get_data.php')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('totale_planten').innerHTML = data.totale_planten;
|
||||
// Voeg andere velden toe op dezelfde manier
|
||||
})
|
||||
.catch(error => console.error('Error:', error));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
# In calculate.py
|
||||
|
||||
|
||||
# Doe je berekeningen hier, vervang 42 door je berekende waarde
|
||||
calculated_value = 42
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mysql.connector #** TYPE IN TERMINAL: "pip install mysql-connector-python"
|
||||
import mysql.connector
|
||||
from mysql.connector import Error
|
||||
|
||||
def database_connect():
|
||||
|
||||
@@ -1,71 +1,36 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from db_connect import database_connect
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
device_256 = None
|
||||
last_seen = None
|
||||
last_battery_voltage = None
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
device_322 = None
|
||||
last_seen = None
|
||||
last_battery_voltage = None
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
for key in data["results"]:
|
||||
if int(key["id"]) == 256:
|
||||
device_256 = int(key["id"])
|
||||
last_seen = int(key["last_seen"])
|
||||
last_battery_voltage = float(key["last_battery_voltage"])
|
||||
# print(f"{device_256}")
|
||||
print(f"Het device {device_256} is voor het laatst geien op: {last_seen} met de voltage als {last_battery_voltage}")
|
||||
|
||||
# time.sleep(300) # Time here is in seconds.
|
||||
elif int(key["id"]) == 322:
|
||||
device_322 = int(key["id"])
|
||||
last_seen = int(key["last_seen"])
|
||||
last_battery_voltage = float(key["last_battery_voltage"])
|
||||
# print(f"{device_256}")
|
||||
print(f"Het device {device_322} is voor het laatst gezien op: {last_seen} met de voltage als {last_battery_voltage}")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.devices (serial_number, name, label, last_seen, last_battery_voltage)
|
||||
VALUES (%s, %s, %s, %s, %s )
|
||||
"""
|
||||
for record in data['results']:
|
||||
serial_number = record.get('serial_number', '')
|
||||
name = record.get('name', '')
|
||||
label = record.get('label', '')
|
||||
last_seen = record.get('last_seen', '')
|
||||
last_battery_voltage = record.get('last_battery_voltage', '')
|
||||
|
||||
print(f"Inserting data: serial_number={serial_number}, name={name}, label={label}, last_seen={last_seen}, last_battery_voltage={last_battery_voltage}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (serial_number, name, label, last_seen, last_battery_voltage))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
print(f"\033[92mMessage received on topic\033[0m {message.topic}: {data}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/devices/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c" # Replace this with your actual access token
|
||||
|
||||
|
||||
# access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c"
|
||||
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/devices"
|
||||
subscribe.callback(on_message, topic)
|
||||
@@ -1,64 +1,25 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from db_connect import database_connect
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
device_322_value = None
|
||||
device_256_value = None
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
for key in data["results"]:
|
||||
if key["device"] == 322:
|
||||
device_322_value = key["value"]
|
||||
elif key["device"] == 256:
|
||||
device_256_value = key["value"]
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
print(f"Device 322 value: {device_322_value}")
|
||||
print(f"Device 256 value: {device_256_value}")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.par_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
print(f"Message received on topic {message.topic}: {data}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/par_events/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c"
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/par_events"
|
||||
subscribe.callback(on_message, topic)
|
||||
@@ -1,64 +1,13 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from db_connect import database_connect
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.relative_humidity_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
print(f"Message received on topic {message.topic}: {data}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/relative_humidity_events/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c"
|
||||
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/relative_humidity"
|
||||
subscribe.callback(on_message, topic)
|
||||
218
src/py/script/samenvoegen_databases.py
Normal file
218
src/py/script/samenvoegen_databases.py
Normal file
@@ -0,0 +1,218 @@
|
||||
import requests
|
||||
import time
|
||||
|
||||
from db_connect import database_connect
|
||||
|
||||
##########################* DEVICES #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.devices (serial_number, name, label, last_seen, last_battery_voltage)
|
||||
VALUES (%s, %s, %s, %s, %s )
|
||||
"""
|
||||
for record in data['results']:
|
||||
serial_number = record.get('serial_number', '')
|
||||
name = record.get('name', '')
|
||||
label = record.get('label', '')
|
||||
last_seen = record.get('last_seen', '')
|
||||
last_battery_voltage = record.get('last_battery_voltage', '')
|
||||
|
||||
print(f"Inserting data: serial_number={serial_number}, name={name}, label={label}, last_seen={last_seen}, last_battery_voltage={last_battery_voltage}")
|
||||
|
||||
mycursor.execute(insert_query, (serial_number, name, label, last_seen, last_battery_voltage))
|
||||
|
||||
mydb.commit()
|
||||
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
|
||||
############################### EINDE ########################
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
##########################* PAR_EVENTS #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.par_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
|
||||
############################### EINDE ########################
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
##########################* RELATIVE_HUMIDITY_EVENTS #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.relative_humidity_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
|
||||
############################### EINDE ########################
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
##########################* SOIL_ELECTRIC_CONDUCTIVITY_EVENTS #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_electric_conductivity_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
|
||||
############################### EINDE ########################
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
##########################* SOIL_TEMPERATURE_EVENTS #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_temperature_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
|
||||
############################### EINDE ########################
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
##########################* SOIL_TEMPERATURE_EVENTS #######################
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_temperature_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
@@ -1,63 +1,13 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from db_connect import database_connect
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
print(f"Message received on topic {message.topic}: {data}")
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_electric_conductivity_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/soil_electric_conductivity_events/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c" # Replace this with your actual access token
|
||||
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/soil_electric_conductivity"
|
||||
subscribe.callback(on_message, topic)
|
||||
@@ -1,66 +1,13 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from db_connect import database_connect
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_temperature_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
print(f"Message received on topic {message.topic}: {data}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/soil_relative_permittivity_events/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c"
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
# fetch_and_display_all(urls, access_token)
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/soil_relative_permittivity"
|
||||
subscribe.callback(on_message, topic)
|
||||
@@ -1,65 +1,13 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
from paho.mqtt import subscribe
|
||||
|
||||
from db_connect import database_connect
|
||||
def on_message(client, userdata, message):
|
||||
payload_str = message.payload.decode("utf-8")
|
||||
data = json.loads(payload_str)
|
||||
|
||||
def fetch_and_display_all(url, access_token, repeat_count=5):
|
||||
for _ in range(repeat_count):
|
||||
print(f"Message received on topic {message.topic}: {data}")
|
||||
|
||||
try:
|
||||
headers = {
|
||||
"Authorization": f"Token {access_token}"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
print(f"Data from {url}:")
|
||||
print(data)
|
||||
load_data(data)
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error fetching data from {url}: {e}")
|
||||
|
||||
print("Waiting for the next retrieval action...")
|
||||
|
||||
time.sleep(1) # Time here is in seconds.
|
||||
|
||||
def load_data(data):
|
||||
mydb = database_connect()
|
||||
if mydb.is_connected():
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
# Here you need to adjust the correct column names and data formats based on the API response
|
||||
insert_query = """
|
||||
INSERT INTO goodgarden.soil_temperature_events (timestamp, gateway_receive_time, device, value)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
"""
|
||||
for record in data['results']:
|
||||
timestamp = record.get('timestamp', '')
|
||||
gateway_receive_time = record.get('gateway_receive_time', '')
|
||||
device = record.get('device', '')
|
||||
value = record.get('value', '')
|
||||
|
||||
print(f"Inserting data: timestamp={timestamp}, gateway_receive_time={gateway_receive_time}, device={device}, value={value}")
|
||||
|
||||
# Execute the query
|
||||
mycursor.execute(insert_query, (timestamp, gateway_receive_time, device, value))
|
||||
|
||||
# Commit the changes
|
||||
mydb.commit()
|
||||
|
||||
# Close cursor and connection
|
||||
mycursor.close()
|
||||
mydb.close()
|
||||
|
||||
print("Data inserted into the database.")
|
||||
if __name__ == "__main__":
|
||||
url = "https://garden.inajar.nl/api/soil_temperature_events/?format=json"
|
||||
access_token = "33bb3b42452306c58ecedc3c86cfae28ba22329c" # Replace this with your actual access token
|
||||
|
||||
# You can change the repeat_count to control how many times you want to repeat the process
|
||||
repeat_count = 10
|
||||
|
||||
fetch_and_display_all(url, access_token, repeat_count)
|
||||
topic = "goodgarden/soil_temperature"
|
||||
subscribe.callback(on_message, topic)
|
||||
@@ -1,4 +1,3 @@
|
||||
/*default colors*/
|
||||
@import url("https://fonts.googleapis.com/css2?family=Akaya+Kanadaka&display=swap");
|
||||
@import url("https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap");
|
||||
h1, h2, h3, h4, h5 {
|
||||
@@ -15,6 +14,7 @@ body {
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
font-family: "Afacad", sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -32,7 +32,7 @@ body .mainContainer .goodgarden-logo {
|
||||
position: absolute;
|
||||
width: 10vw;
|
||||
left: 50%;
|
||||
top: 2.5rem;
|
||||
top: 4.1rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
body .mainContainer .informatie-kas-main-container {
|
||||
@@ -41,6 +41,7 @@ body .mainContainer .informatie-kas-main-container {
|
||||
}
|
||||
body .mainContainer .mainBorder {
|
||||
padding: 1.25rem 1.5rem;
|
||||
padding: 1rem 0;
|
||||
height: 35rem;
|
||||
border: solid 5px rgb(171, 211, 174);
|
||||
border-radius: 40px;
|
||||
@@ -56,6 +57,9 @@ body .mainContainer .mainBorder #sectie-1 {
|
||||
padding: 0 2.5rem 0 1rem;
|
||||
position: relative;
|
||||
}
|
||||
body .mainContainer .mainBorder #sectie-1 h1 {
|
||||
background-color: green;
|
||||
}
|
||||
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht {
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||
border-radius: 40px;
|
||||
@@ -88,6 +92,7 @@ body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox {
|
||||
font-size: 1.25rem;
|
||||
padding: 0 1rem 2.5rem;
|
||||
height: 225px;
|
||||
position: relative;
|
||||
}
|
||||
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox h2 {
|
||||
position: absolute;
|
||||
@@ -138,6 +143,7 @@ body .mainContainer .mainBorder .content .kant-links #planten td article:hover {
|
||||
}
|
||||
body .mainContainer .mainBorder .content .kant-rechts {
|
||||
grid-column: 3;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
body .mainContainer .mainBorder .content .kant-rechts #metingen {
|
||||
border: solid 3px rgb(171, 211, 174);
|
||||
@@ -145,14 +151,15 @@ body .mainContainer .mainBorder .content .kant-rechts #metingen {
|
||||
}
|
||||
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
justify-content: space-between;
|
||||
padding: 0.5rem;
|
||||
padding-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes table {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
body .mainContainer .mainBorder .grid-column-2 {
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||
@@ -169,6 +176,8 @@ body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table {
|
||||
padding: 1.5rem 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 2.5rem;
|
||||
justify-content: space-around;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/*default colors*/
|
||||
|
||||
$primary-color: rgb(171, 211, 174);
|
||||
$secondary-color: rgb(143, 188, 143);
|
||||
|
||||
@@ -10,10 +8,10 @@ $font-titels: "Akaya Kanadaka", system-ui;
|
||||
|
||||
$font-text: "Afacad", sans-serif;
|
||||
|
||||
@mixin flexbox
|
||||
@mixin flexbox-center
|
||||
{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@mixin groene-border
|
||||
@@ -53,7 +51,7 @@ body
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
// font-family: $font-text;
|
||||
font-family: $font-text;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -70,11 +68,10 @@ body
|
||||
|
||||
.goodgarden-logo
|
||||
{
|
||||
// z-index: inherit;
|
||||
position: absolute;
|
||||
width: 10vw;
|
||||
left: 50%;
|
||||
top: 2.5rem;
|
||||
top: 4.1rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
@@ -87,6 +84,7 @@ body
|
||||
.mainBorder
|
||||
{
|
||||
padding: 1.25rem 1.5rem;
|
||||
padding: 1rem 0;
|
||||
height: 35rem;
|
||||
border: solid 5px $primary-color;
|
||||
border-radius: 40px;
|
||||
@@ -105,6 +103,11 @@ body
|
||||
padding: 0 2.5rem 0 1rem;
|
||||
position: relative;
|
||||
|
||||
h1
|
||||
{
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.parent-algemeen-overzicht
|
||||
{
|
||||
@include box-shadow;
|
||||
@@ -119,7 +122,6 @@ body
|
||||
@include inner-border-radius;
|
||||
font-size: 1.25rem;
|
||||
padding: .5rem 1rem;
|
||||
// background-color: red;
|
||||
|
||||
.table-informatie-kas
|
||||
{
|
||||
@@ -131,8 +133,6 @@ body
|
||||
justify-content: space-between;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ body
|
||||
font-size: 1.25rem;
|
||||
padding: 0 1rem 2.5rem;
|
||||
height: 225px;
|
||||
// position: relative;
|
||||
position: relative;
|
||||
|
||||
h2
|
||||
{
|
||||
@@ -170,8 +170,13 @@ body
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD:src/py/static/css/style.scss
|
||||
}
|
||||
|
||||
=======
|
||||
|
||||
}
|
||||
>>>>>>> main:src/css/style.scss
|
||||
.content
|
||||
{
|
||||
display: grid;
|
||||
@@ -191,7 +196,11 @@ body
|
||||
|
||||
td
|
||||
{
|
||||
<<<<<<< HEAD:src/py/static/css/style.scss
|
||||
article
|
||||
=======
|
||||
article
|
||||
>>>>>>> main:src/css/style.scss
|
||||
{
|
||||
height: 7rem;
|
||||
width: 10rem;
|
||||
@@ -227,12 +236,21 @@ body
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD:src/py/static/css/style.scss
|
||||
|
||||
&-rechts
|
||||
{
|
||||
grid-column: 3;
|
||||
// margin-right: 2rem;
|
||||
|
||||
=======
|
||||
|
||||
&-rechts
|
||||
{
|
||||
grid-column: 3;
|
||||
margin-right: 2rem;
|
||||
|
||||
>>>>>>> main:src/css/style.scss
|
||||
#metingen
|
||||
{
|
||||
|
||||
@@ -242,7 +260,11 @@ body
|
||||
#main-waardes
|
||||
{
|
||||
display: flex;
|
||||
<<<<<<< HEAD:src/py/static/css/style.scss
|
||||
justify-content: space-evenly;
|
||||
=======
|
||||
justify-content: space-between;
|
||||
>>>>>>> main:src/css/style.scss
|
||||
padding: .5rem;
|
||||
padding-bottom: 0;
|
||||
width: 100%;
|
||||
@@ -250,15 +272,20 @@ body
|
||||
table
|
||||
{
|
||||
display: flex;
|
||||
<<<<<<< HEAD:src/py/static/css/style.scss
|
||||
justify-content: space-around;
|
||||
// width: 100%;
|
||||
=======
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
>>>>>>> main:src/css/style.scss
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.grid-column-2
|
||||
{
|
||||
@include box-shadow;
|
||||
@@ -278,8 +305,8 @@ body
|
||||
padding: 1.5rem 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// align-items: stretch;
|
||||
// gap: 2.5rem;
|
||||
align-items: stretch;
|
||||
gap: 2.5rem;
|
||||
justify-content: space-around;
|
||||
height: 90%;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user