Website changes
This commit is contained in:
@@ -29,6 +29,15 @@
|
||||
</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>
|
||||
<script src="GaugGroup.js"></script>
|
||||
<script src="graph-classes.js"></script>
|
||||
|
@@ -12,6 +12,14 @@
|
||||
justify-content: left;
|
||||
} */
|
||||
|
||||
.nav-button {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
#editNode{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -21,13 +29,14 @@
|
||||
/* border: 20px solid orange; */
|
||||
}
|
||||
|
||||
/* #editNode {
|
||||
#editNode {
|
||||
margin-top: 1%;
|
||||
width: 98vw;
|
||||
height: 20vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
/* flex-direction: column; Keep as column
|
||||
/* justify-content: ;
|
||||
/* justify-content: ; */
|
||||
align-items: center;
|
||||
|
||||
background-color: #333;
|
||||
@@ -39,7 +48,7 @@
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
float: top;
|
||||
} */
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
|
@@ -8,8 +8,6 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<button id="settings" onclick="settings()">Settings</button>
|
||||
<div id="editNode">
|
||||
|
@@ -17,26 +17,30 @@ function settings() {
|
||||
updateNode.style.display = "block";
|
||||
locationInput.value = "";
|
||||
nameInput.value = "";
|
||||
|
||||
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);
|
||||
})
|
||||
getNodeInfo();
|
||||
|
||||
} else {
|
||||
updateNode.style.display = "none";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getNodeInfo() {
|
||||
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) {
|
||||
var i, L = select.options.length - 1;
|
||||
for (i = L; i >= 0; i--) {
|
||||
@@ -71,6 +75,7 @@ function changeText() {
|
||||
var text = document.getElementById('text');
|
||||
|
||||
text.innerHTML = "Changes made"
|
||||
getNodeInfo();
|
||||
}
|
||||
|
||||
function updateNodeInfo(node, newNodeName, newNodeLocation) {
|
||||
|
Reference in New Issue
Block a user