display elenco files

This commit is contained in:
Marco Locatelli
2021-04-02 16:35:33 +02:00
parent 1d8b5cbd39
commit 0fb8e95b35
+17 -21
View File
@@ -6,18 +6,14 @@
var intTime=200;
// fix visualizzazioni
fixDisplay();
fixFileTable();
// avvio timer
var timeout = setTimeout(dataRefresh, intTime);
var fileTable = [
{
"File Name": "-",
"File Size": "0",
"Date": "2021/04/02 15:01:23"
},
{
"File Name": "-",
"File Size": "0",
"Date": "2021/04/02 15:01:23"
"name": "-",
"size": "0",
"date": "2021/04/02 15:01:23"
}
]
@@ -96,7 +92,7 @@
,data: ""
})
// fix file
UpdateFileTable(fileTable);
fixFileTable();
};
// Funzione stopLog: fa chiamata per settare a 0 il LOG:STATUS
@@ -108,12 +104,20 @@
})
// fix file
UpdateFileTable(fileTable);
fixFileTable();
};
function fixFileTable(){
// scarico i dati aggioranti
$.ajax({url: "/api/v1/files/list", success: function(result){
fileTable = result.fileTable;
// fix file
UpdateFileTable(fileTable);
}});
}
function UpdateFileTable(fileTable) {
// EXTRACT VALUE FOR HTML HEADER.
// ('Book ID', 'Book Name', 'Category' and 'Price')
var col = [];
@@ -190,7 +194,6 @@
<br>
<strong>File Write period: </strong> <span id="WriteFrequency"></span> ms
</div>
<!--pulsanti start log e stop log-->
<div class="text-center mx-2 my-2">
<button type="button" class="btn btn-success" onclick="startLog()">Start Log</button>
<button type="button" class="btn btn-danger" onclick="stopLog()">Stop Log</button>
@@ -208,16 +211,9 @@
<div class="input-group-text mb-3">
<span>Session: &nbsp;</span> <span id="LastSessionName"></span>
</div>
<!-- To Do: display contenuto cartella /data e dimensione files -->
<input type="button" class="btn btn-sm btn-info" onclick="UpdateFileTable(fileTable)" value="Reload" />
<p id="showData"></p>
</div>
<p class="text-center" id="showData"></p>
</div>
</div>
</div>
</main>
{% endblock %}