Fix refresh for embedded csv

When we don't have files, refresh from the embedded CSV's

Change-Id: I6fef7426b2feda2cf8505c261eecdcc6bd6c9285
This commit is contained in:
Ian Wienand 2021-10-22 18:48:58 +11:00
parent fe415871fd
commit 358c6a7f7f
2 changed files with 20 additions and 4 deletions

View File

@ -590,8 +590,16 @@ function change_granularity(granularity, aggr_function) {
function refresh() { function refresh() {
d3.select('#dashboard').html(""); d3.select('#dashboard').html("");
d3.select('#focus').html(""); d3.select('#focus').html("");
for (i in gFiles) { if (gFiles.length > 0) {
processFile(gFiles[i]); for (let i = 0; i < gFiles.length; ++i) {
processFile(gFiles[i]);
}
} else {
// If we don't have any files, refresh from the
// embedded CSV's directly
for (let i = 0; i < gCSVs.length; ++i) {
processCSV(gCSVs[i], "csv " + i)
}
} }
} }

View File

@ -567,8 +567,16 @@ function change_granularity(granularity, aggr_function) {
function refresh() { function refresh() {
d3.select('#dashboard').html(""); d3.select('#dashboard').html("");
d3.select('#focus').html(""); d3.select('#focus').html("");
for (i in gFiles) { if (gFiles.length > 0) {
processFile(gFiles[i]); for (let i = 0; i < gFiles.length; ++i) {
processFile(gFiles[i]);
}
} else {
// If we don't have any files, refresh from the
// embedded CSV's directly
for (let i = 0; i < gCSVs.length; ++i) {
processCSV(gCSVs[i], "csv " + i)
}
} }
} }