Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59
This commit is contained in:
@@ -25,10 +25,10 @@ function createCheckBox(id, label) {
|
|||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
handleData(data);
|
nodeInputs(data);
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleData(JSONdata) {
|
function nodeInputs(JSONdata) {
|
||||||
select = document.getElementById('node-input');
|
select = document.getElementById('node-input');
|
||||||
|
|
||||||
console.log(JSONdata);
|
console.log(JSONdata);
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="styles/graph-styles.css">
|
<link rel="stylesheet" href="styles/graph-styles.css">
|
||||||
@@ -20,16 +21,15 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="graphs.html" class="nav-link">Graphs</a>
|
<a href="graphs.html" class="nav-link">Graphs</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings.html" class="nav-link">Settings</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="graph-classes.js"></script>
|
<script src="graph-classes.js"></script>
|
||||||
<script src="graph-main.js"></script>
|
<script src="graph-main.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -22,16 +22,25 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="graphs.html" class="nav-link">Graphs</a>
|
<a href="graphs.html" class="nav-link">Graphs</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings.html" class="nav-link">Settings</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<button class="nav-button" onclick="settings()">Change node names ⌄</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="editNode">
|
||||||
|
<p id="text">Status updating</p>
|
||||||
|
<select id="mySelect"></select>
|
||||||
|
<textarea maxlength="44" id="inputName"></textarea>
|
||||||
|
<textarea maxlength="44" id="inputLocation"></textarea>
|
||||||
|
<button id="button" onclick="changeText()">Change Information</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="GaugGroup.js"></script>
|
<script src="GaugGroup.js"></script>
|
||||||
<script src="graph-classes.js"></script>
|
<script src="graph-classes.js"></script>
|
||||||
|
@@ -141,4 +141,4 @@ function toggleGraph(nodeId) {
|
|||||||
} else {
|
} else {
|
||||||
console.error('No element found with id: liveGraph' + nodeId);
|
console.error('No element found with id: liveGraph' + nodeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,9 +20,6 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="graphs.html" class="nav-link">Graphs</a>
|
<a href="graphs.html" class="nav-link">Graphs</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings.html" class="nav-link">Settings</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
<!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="styles/settings-styles.css">
|
|
||||||
<title>Gauges</title>
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<nav class="navbar">
|
|
||||||
<ul class="navbar-nav">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.html" class="nav-link">Dashboard</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="graphs.html" class="nav-link">Graphs</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings.html" class="nav-link">Settings</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="questions-dashboard.html" class="nav-link">Questions</a>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<script src="main.js"></script>
|
|
||||||
<script src="GaugGroup.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,8 +1,6 @@
|
|||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -12,226 +10,223 @@
|
|||||||
justify-content: left;
|
justify-content: left;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
#editNode{
|
.nav-button {
|
||||||
display: flex;
|
background-color: #333;
|
||||||
justify-content: center;
|
color: #fff;
|
||||||
/* align-items: center; */
|
border: none;
|
||||||
/* flex-direction: column; */
|
cursor: pointer;
|
||||||
/* border-radius: 5%; */
|
font-size: 17px;
|
||||||
/* border: 20px solid orange; */
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* #editNode {
|
#editNode {
|
||||||
width: 98vw;
|
margin-top: 1%;
|
||||||
height: 20vh;
|
width: 98vw;
|
||||||
display: flex;
|
height: 20vh;
|
||||||
justify-content: center;
|
display: flex;
|
||||||
/* flex-direction: column; Keep as column
|
justify-content: center;
|
||||||
/* justify-content: ;
|
/* flex-direction: column; Keep as column
|
||||||
align-items: center;
|
/* justify-content: ; */
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
border: 2px solid #333;
|
border: 2px solid #333;
|
||||||
clear: both;
|
clear: both;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
float: top;
|
float: top;
|
||||||
} */
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 8vh;
|
margin-top: 8vh;
|
||||||
flex-direction: column;
|
background-color: #f0f0f0;
|
||||||
background-color: #bfbfbf;
|
flex-direction: column;
|
||||||
align-items: center;
|
background-color: #afafaf;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gaugeGroup {
|
.gaugeGroup {
|
||||||
width: 98vw;
|
margin-top: 2vh;
|
||||||
height: auto;
|
width: 98vw;
|
||||||
display: flex;
|
height: auto;
|
||||||
flex-direction: column; /* Keep as column */
|
display: flex;
|
||||||
justify-content: flex-start;
|
flex-direction: column; /* Keep as column */
|
||||||
background-color: #9f9f9f;
|
justify-content: flex-start;
|
||||||
color: #fff;
|
background-color: #333;
|
||||||
padding: 10px;
|
color: #fff;
|
||||||
border-radius: 50px;
|
padding: 10px;
|
||||||
border: 2px solid #CC2936;
|
border-radius: 50px;
|
||||||
clear: both;
|
border: 2px solid #333;
|
||||||
margin-bottom: 10px;
|
clear: both;
|
||||||
position: relative;
|
margin-bottom: 10px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.groupTitle {
|
.groupTitle {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Node {
|
.Node {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Sensorvalues {
|
.Sensorvalues {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 15%;
|
width: 15%;
|
||||||
height: 110%;
|
height: 110%;
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
color: #333;
|
color: #333;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 3vh; /* Increase bottom padding */
|
padding-top: 3vh; /* Increase bottom padding */
|
||||||
}
|
}
|
||||||
|
|
||||||
.gaugeContainer {
|
.gaugeContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80%; /* Increase the height from 70% to 80% */
|
height: 80%; /* Increase the height from 70% to 80% */
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
height: 5vh;
|
height: 5vh;
|
||||||
margin-bottom: 1vh;
|
margin-bottom: 1vh;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.gaugeImage {
|
.gaugeImage {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: 140%;
|
max-height: 120%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
position: absolute; /* Make the image position absolute */
|
position: absolute; /* Make the image position absolute */
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1; /* Make the image display below the needle */
|
z-index: 1; /* Make the image display below the needle */
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gaugeValue, .gaugeText {
|
.gaugeValue,
|
||||||
width: 100%;
|
.gaugeText {
|
||||||
text-align: center;
|
width: 100%;
|
||||||
font-size: 24px;
|
text-align: center;
|
||||||
z-index: 2;
|
font-size: 24px;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gaugeText {
|
.gaugeText {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1.4vw;
|
font-size: 1.4vw;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -1.4vw; /* Adjust this value to move the text further down */
|
top: -1.4vw; /* Adjust this value to move the text further down */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrowimg {
|
.arrowimg {
|
||||||
width: 3vh;
|
width: 3vh;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0.5vw;
|
top: 0.5vw;
|
||||||
right: 1.2vw;
|
right: 1.2vw;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.valueContainer {
|
.valueContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#valueText {
|
#valueText {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.needle {
|
.needle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -10%; /* Lower the needle to the bottom */
|
bottom: -10%; /* Lower the needle to the bottom */
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
transform-origin: bottom;
|
transform-origin: bottom;
|
||||||
z-index: 3; /* Make the needle display above the image */
|
z-index: 3; /* Make the needle display above the image */
|
||||||
transition: transform 0.1s ease-out;
|
transition: transform 0.1s ease-out;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentContainer {
|
.contentContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row; /* Layout children side by side */
|
flex-direction: row; /* Layout children side by side */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
background-color: #bfbfbf;
|
background-color: #333;
|
||||||
border-bottom: 2px solid #CC2936;
|
height: 60px;
|
||||||
height: 60px;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
padding: 0 20px;
|
||||||
padding: 0 20px;
|
position: fixed; /* Fix the navbar at the top of the page */
|
||||||
position: fixed; /* Fix the navbar at the top of the page */
|
top: 0; /* Position it at the very top */
|
||||||
top: 0; /* Position it at the very top */
|
width: 100%; /* Make it span the full width of the page */
|
||||||
width: 100%; /* Make it span the full width of the page */
|
z-index: 1000; /* Make sure it's above all other elements */
|
||||||
z-index: 1000; /* Make sure it's above all other elements */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-nav {
|
.navbar-nav {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center; /* Center the links horizontally */
|
justify-content: center; /* Center the links horizontally */
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%; /* Make it span the full width of the navbar */
|
width: 100%; /* Make it span the full width of the navbar */
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plotly-container {
|
.plotly-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
float: bottom;
|
float: bottom;
|
||||||
padding: 1vw;
|
padding: 1vw;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.js-plotly-plot {
|
.js-plotly-plot {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabled {
|
.disabled {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
}
|
||||||
}
|
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button id="settings" onclick="settings()">Settings</button>
|
<button id="settings" onclick="settings()">Settings</button>
|
||||||
<div id="editNode">
|
<div id="editNode">
|
||||||
|
@@ -17,26 +17,30 @@ function settings() {
|
|||||||
updateNode.style.display = "block";
|
updateNode.style.display = "block";
|
||||||
locationInput.value = "";
|
locationInput.value = "";
|
||||||
nameInput.value = "";
|
nameInput.value = "";
|
||||||
|
getInfoNode();
|
||||||
fetch(apiGetAllNode)
|
|
||||||
.then(response => {
|
|
||||||
if (!response.ok) {
|
|
||||||
document.getElementById('text').innerHTML = "Error: Network response was not ok";
|
|
||||||
throw new Error('Network response was not ok');
|
|
||||||
}
|
|
||||||
document.getElementById('text').innerHTML = "Fetching data";
|
|
||||||
return response.json();
|
|
||||||
})
|
|
||||||
.then(data => {
|
|
||||||
document.getElementById('text').innerHTML = "Data fetched";
|
|
||||||
handleData(data);
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
updateNode.style.display = "none";
|
updateNode.style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getInfoNode() {
|
||||||
|
fetch(apiGetAllNode)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
document.getElementById('text').innerHTML = "Error: Network response was not ok";
|
||||||
|
throw new Error('Network response was not ok');
|
||||||
|
}
|
||||||
|
document.getElementById('text').innerHTML = "Fetching data";
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
document.getElementById('text').innerHTML = "Data fetched";
|
||||||
|
handleData(data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function handleData(JSONdata) {
|
function handleData(JSONdata) {
|
||||||
var i, L = select.options.length - 1;
|
var i, L = select.options.length - 1;
|
||||||
for (i = L; i >= 0; i--) {
|
for (i = L; i >= 0; i--) {
|
||||||
@@ -71,6 +75,7 @@ function changeText() {
|
|||||||
var text = document.getElementById('text');
|
var text = document.getElementById('text');
|
||||||
|
|
||||||
text.innerHTML = "Changes made"
|
text.innerHTML = "Changes made"
|
||||||
|
getInfoNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNodeInfo(node, newNodeName, newNodeLocation) {
|
function updateNodeInfo(node, newNodeName, newNodeLocation) {
|
||||||
|
Reference in New Issue
Block a user