var logContent = {}; var logNames = { "rtcLog": "RTC CLIENT", "rtmLog": "RTM CLIENT", "signalChannel": "SIGNAL CHANNEL", "chatChannel": "CHAT CHANNEL", "globalErr": "OTHER" } function clear() { $("#tableData tbody").html(""); } function loadFile() { var input, file, fr; if (typeof window.FileReader !== 'function') { alert("Browser not supported."); return; } input = document.getElementById('fileinput'); if (!input) { alert("Can't find fileinput element."); } else if (!input.files) { alert("Browser not supported."); } else if (!input.files[0]) { alert("Select file"); } else { file = input.files[0]; fr = new FileReader(); fr.onload = receivedText; fr.readAsText(file); } function receivedText(e) { const currentFileContent = e.target.result; //allLoadedBalls = lines.replace( /\r?\n/g, " " ).split( " " ); parseLog(currentFileContent); } } function setCurrentLog(logName) { clear(); $("#currentLog").html(logNames[logName]); parseLogSection(logContent[logName]); } function parseLog(content) { console.log(content); try { logContent = JSON.parse(content); } catch(err) { alert("error parsing json"); console.log("parse error", err); return; } console.log(logContent); $("#userId").html(logContent.userId); $("#userName").html(logContent.userName); } function parseLogSection(log) { console.log("PARSE LOG SECTION"); const table = $("#tableData tbody"); for(let i = 0; i < log.length; i++) { console.log(log[i]); // time var t = $(""); var r = $("").html(log[i].time); r.appendTo(t); if(typeof(log[i].data) !== "undefined") { // info type err... var tag = $(""); tag.html(log[i]['data'][0]); tag.appendTo(t); var messageData = log[i]['data'][1]; // meessage tag = $(""); tag.html(messageData[0]); tag.appendTo(t); // extra data tag = $(""); if(messageData.length > 1) { tag.html(JSON.stringify(messageData[1])); } tag.appendTo(t); } t.appendTo(table); } } jQuery(document).ready(function($) { $("#loadFile").click(function() { clear(); loadFile(); }); }); x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586