Data added for the second house

Rafael
jaume-nualart 7 months ago
parent 6ef7246103
commit f26c07dc3a
  1. 2
      web-html/config/datamap.js
  2. 4
      web-html/dash.html
  3. 7
      web-html/home.html
  4. BIN
      web-html/imgs/housepilgratan_map.png
  5. 122
      web-html/js/dash.js
  6. 0
      web-html/js/home.js

@ -34,7 +34,7 @@ var PROJECTS =
"hname": "Hus Pilgayan",
"type": "house", // normal= a standard house.
"subtitle": `At Pilgatan, we have about 120 sensors as well. It is only Temperature+Humidity sensors. The sensors are connected to two sensor cards, similarly as it is in Charlie. Here, the data files start with v1- and v6- for floor 1 and floor 6, respectively.`,
"image": "imgs/housepilgatan.jpg",
"image": "imgs/housepilgatan.png",
"map": "imgs/housepilgatan_map.png",
"map_url": "https://maps.app.goo.gl/HHj2Xua5doRufLQF6",
"families": [

@ -1051,9 +1051,7 @@
<!-- //////////////////////////////////////// -->
<!-- FIXME GRID static data -->
<script src="./DATA/projects/house1/grid/MY_TempCond_MP1_5.js"></script>
<!-- rich text editor -->
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>

@ -18,6 +18,7 @@
margin: 1rem;
}
.card-img-top {
max-height:110px;
width:150px;
}
</style>
@ -28,7 +29,7 @@
<!-- JS local & config-->
<script src="./config/config.js"></script>
<script src="./config/datamap.js"></script>
<script src="./js/static.js"></script>
<script src="./js/home.js"></script>
<title>TräHus data fkexiboard by Infravis.se</title>
@ -57,8 +58,8 @@
<div class="col-sm-6">
<div class="card">
<div class="card-body">
<img src="${houses.image}" class="card-img-top" alt="...">
<img src="${houses.map}" class="card-img-top" alt="...">
<a href="${houses.images}" target="picture of ${houses.hname}"><img src="${houses.image}" class="card-img-top" alt="..."></a>
<a href="${houses.map_url}" target="map of ${houses.hname}"><img src="${houses.map}" class="card-img-top" alt="..."></a>
<h5 class="${houses.name}">${houses.hname}</h5>
<p class="card-text">${houses.subtitle}</p>
<p>Open dashboard

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

@ -193,12 +193,12 @@ function openPopupCanvas(button) {
var fileName = currentURL.substring(currentURL.lastIndexOf('/') + 1);
// Get the list of projects
var count = 0; var myNumber;
var count = 0; var myNumber = 0;
const projectList = [];
PROJECTS.items.forEach((houses) => {
projectList.push(houses.xname);
// get the number/order of the config selected element
if (houses.xname = myParam) {myNumber = count;}
if (houses.xname == myParam) {myNumber = count;}
count++;
});
@ -265,8 +265,8 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions;
<p>${myHouse.subtitle}</p>
</div>
<div class="col-md-6">
<img src="${myHouse.image}" class="card-img-top img-fluid imgshadow" alt="...">
<img src="${myHouse.map}" class="card-img-top img-fluid imgshadow" alt="...">
<a href="${myHouse.image}" target="picture of ${myHouse.hname}"><img src="${myHouse.image}" class="card-img-top img-fluid imgshadow" alt="..."></a>
<a href="${myHouse.map_url}" target="map of ${myHouse.hname}"><img src="${myHouse.map}" class="card-img-top img-fluid imgshadow" alt="..."></<>
</div>
</div>
</div>`;
@ -342,7 +342,6 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions;
var parts = inDay.split("/");
var day = `${parts[2]}-${parts[1]}-${parts[0]}`;
var myTitle = document.getElementById("PDTitle").value;
var family = document.getElementById("PDFamSensor").value;
var type = document.getElementById("PDParameter").value;
// Building API query
@ -357,6 +356,7 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions;
var inYear = inWeek.split("/");
var year = inYear[2];
var family = document.getElementById("PWFamSensor").value;
var myTitle = document.getElementById("PWTitle").value;
var type = document.getElementById("PWParameter").value;
// BUILDING API query
var apiUrl = "parallel/weekly?family="+family+"&type="+type+"&year="+year+"&week="+week;
@ -370,6 +370,7 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions;
var month = parseInt(parts[0], 10); // Parse the month as an integer
var year = parseInt(parts[1], 10); // Parse the year as an integer
var family = document.getElementById("PMFamSensor").value;
var myTitle = document.getElementById("PMTitle").value;
var type = document.getElementById("PMParameter").value;
// BUILDING API query
var apiUrl = "parallel/monthly?family="+family+"&type="+type+"&year="+year+"&month="+month;
@ -380,6 +381,7 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions;
case "PY":
var year = document.getElementById("PYYear").value;
var family = document.getElementById("PYFamSensor").value;
var myTitle = document.getElementById("PYTitle").value;
var type = document.getElementById("PYParameter").value;
// BUILDING API query
var apiUrl = "parallel/yearly?family="+family+"&type="+type+"&year="+year;
@ -994,60 +996,77 @@ function do_horizon_row(data, myid, title, myDates) {
////////////////////////////////
// SAVE DASHBOARF :: export diagrams + texts to the API
function getApiUrls() {
var apiUrlsLeft = {};
var apiUrlsCenter = {};
var apiUrlsRight = {};
document.querySelectorAll('#col-left div').forEach(function(element) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerHTML = clone.innerHTML.trim();
apiUrlsLeft[id] = innerHTML;
} else if (apiUrl) {
apiUrlsLeft[id] = apiUrl;
}
var apiUrlsLeft = [];
var apiUrlsCenter = [];
var apiUrlsRight = [];
document.querySelectorAll('#col-left div').forEach(function(element, index) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
var order = apiUrlsCenter.length;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerText = clone.innerText.trim();
apiUrlsLeft.push({ order: order, id: id, text: innerText, api_url: null });
} else if (apiUrl) {
var h2Element = element.querySelector('h2');
text = h2Element ? h2Element.innerText.trim() : '';
apiUrlsLeft.push({ order: order, id: id, text: text, api_url: apiUrl });
}
});
document.querySelectorAll('#col-center div').forEach(function(element) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerHTML = clone.innerHTML.trim();
apiUrlsCenter[id] = innerHTML;
} else if (apiUrl) {
apiUrlsCenter[id] = apiUrl;
}
document.querySelectorAll('#col-center div').forEach(function(element, index) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
var text = element.innerHTML.trim(); // Assuming the text is the innerHTML of the element
var order = apiUrlsCenter.length;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerText = clone.innerText.trim();
apiUrlsCenter.push({ order: order, id: id, text: innerText, api_url: null });
} else if (apiUrl) {
var h2Element = element.querySelector('h2');
text = h2Element ? h2Element.myLen.trim() : '';
apiUrlsCenter.push({ order: order, id: id, text: text, api_url: apiUrl });
}
});
document.querySelectorAll('#col-right div').forEach(function(element) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerHTML = clone.innerHTML.trim();
apiUrlsRight[id] = innerHTML;
} else if (apiUrl) {
apiUrlsRight[id] = apiUrl;
}
document.querySelectorAll('#col-right div').forEach(function(element, index) {
var apiUrl = element.getAttribute('apiurl');
var id = element.id;
var text = element.innerHTML.trim(); // Assuming the text is the innerHTML of the element
var order = apiUrlsCenter.length;
if (apiUrl === 'txt') {
var clone = element.cloneNode(true);
clone.querySelectorAll('span').forEach(function(span) {
span.parentNode.removeChild(span);
});
var innerText = clone.innerText.trim();
apiUrlsRight.push({ order: order, id: id, text: innerText, api_url: null });
} else if (apiUrl) {
var h2Element = element.querySelector('h2');
text = h2Element ? h2Element.innerText.trim() : '';
apiUrlsRight.push({ order: order, id: id, text: text, api_url: apiUrl });
}
});
// Similar modifications for #col-center and #col-right
var result = {
"col-left": apiUrlsLeft,
"col-center": apiUrlsCenter,
"col-right": apiUrlsRight
"name": myHouse.xname,
"description": myHouse.subtitle,
"col-left": apiUrlsLeft,
"col-center": apiUrlsCenter,
"col-right": apiUrlsRight
};
return alert(JSON.stringify(result));
@ -1056,6 +1075,7 @@ function getApiUrls() {
///////////////////////////////
// Template 3 columns 100%
const colLeft = document.getElementById("col-left");

Loading…
Cancel
Save