Skip to content

Commit

Permalink
chore: unused code and comments
Browse files Browse the repository at this point in the history
Signed-off-by: joshuaunity <[email protected]>
  • Loading branch information
joshuaunity committed Oct 22, 2024
1 parent eaecbf5 commit 8989953
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flexmeasures/ui/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
});
}

// even lister to refresh graph
// event listener to refresh graph
document.addEventListener('refreshGraph', async function() {
await embedAndLoad(chartSpecsPath + 'event_starts_after=' + storeStartDate.toISOString() + '&event_ends_before=' + storeEndDate.toISOString() + '&', elementId, datasetName, previousResult, storeStartDate, storeEndDate);
})
Expand Down
18 changes: 9 additions & 9 deletions flexmeasures/ui/templates/crud/asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ <h5 class="modal-title">Edit Dashboard Graphs</h5>
<div class="modal-body">
<div class="row">
<div class="col">
<!-- Left: Asset List -->
<div class="list-container">

<div class="list-container">
<div id="dataList" class="row"></div>
</div>
</div>
Expand Down Expand Up @@ -471,24 +471,24 @@ <h5 class="modal-title">Edit Dashboard Graphs</h5>
rawJSON = rawJSON.replace(/'/g, '"');
let data = JSON.parse(rawJSON);
let assets = [];
let sensorCache = {}; // Cache to store fetched sensor details
let editingIndex = null; // Track the index of the item being edited
let sensorCache = {};
let editingIndex = null;

async function getSensor(id) {
if (sensorCache[id]) {
return sensorCache[id]; // Return from cache if already fetched
return sensorCache[id];
}
const apiUrl = window.location.origin + "/api/v3_0/sensors/" + id;
const response = await fetch(apiUrl);
const sensor = await response.json();
sensorCache[id] = sensor; // Store fetched sensor in cache
sensorCache[id] = sensor;
return sensor;
}

// Function to render the data list
async function renderData() {
const dataList = document.getElementById("dataList");
dataList.innerHTML = ""; // Clear the existing data
dataList.innerHTML = "";

for (const [index, item] of data.entries()) {
const col = document.createElement("div");
Expand Down Expand Up @@ -681,8 +681,8 @@ <h5 class="card-title">${asset.name}</h5>
// Add sensor to the data list
function addSensorToList(id) {
const newAsset = {
title: "No Title", // Default title
sensors: [id], // Sensor array containing the asset's ID
title: "No Title",
sensors: [id],
};
data.push(newAsset);
renderData();
Expand Down

0 comments on commit 8989953

Please sign in to comment.