Skip to content

Commit e1afdd5

Browse files
committed
Prettyprint mods in browser
1 parent 9571c1e commit e1afdd5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ ipc.on("setServers", function(event, data){
3030
for(let key2 in data[key]) {
3131
// run some special rules depending on the name of the field
3232
if(key2 == "time"){
33+
// print time in seconds instead of unix time
3334
html += "<td>seen "+Math.floor((Date.now()-data[key][key2])/100)/10+"s ago</td>";
35+
} else if (key2 == "mods"){
36+
// Make modlist look nice
37+
html += "<td>"
38+
for(let i = 0;i<data[key].mods.length;i++){
39+
// print one mod per line
40+
html += data[key].mods[i].modName + "\n"
41+
}
42+
html += "</td>"
3443
} else {
3544
html += "<td>"+data[key][key2]+"</td>"
3645
}

0 commit comments

Comments
 (0)