function load() { filelist(); getFile("eviltwin.txt", function (res) { document.getElementById("eviltwinpath").value = res; }); getFile("log.json", function (res) { var array = JSON.parse(res) var logDiv = document.getElementById("log"); logDiv.innerHTML = "SSID Password"; for (let index = 0; index < array.length; index++) { logDiv.innerHTML += "" + array[index].ssid + "" + array[index].pass + ""; } }); getFile("fsinfo", function (res) { document.getElementById("fsinfo").innerHTML = res; }); } function format() { getFile("format", function (res) { var out; if (res == "OK") out = "Format Success. Restarting..."; else out = "Format failed!!!" alert(out); }); } function filelist() { getFile("filecli?cmd=listfile", function (res) { var array = JSON.parse(res) var listView = document.getElementById("fileList"); for (let index = 0; index < array.length; index++) { listView.innerHTML += "" + array[index].name + "" + array[index].size + ""; } }); } function deleteFile(filePath) { getFile("filecli?cmd=" + filePath, function (res) { if (res == "OK"){ alert("Success delete file : " + filePath); window.location.reload(); }else{ alert("Failed delete file"); } }); }