|
1 <!DOCTYPE html> |
|
2 <html lang="en"> |
|
3 <head> |
|
4 <title>Brew Logfiles</title> |
|
5 <meta charset="utf-8" /> |
|
6 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
|
7 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
|
8 <script src="js/jquery-1.12.4.min.js"></script> |
|
9 <link rel="stylesheet" href="app/styles/web.css"> |
|
10 </head> |
|
11 <body> |
|
12 |
|
13 <div id="tmap"></div> |
|
14 <table class="directory"> |
|
15 <thead> |
|
16 <tr class="directory"> |
|
17 <th>Bestand</th> |
|
18 <th>Grootte</th> |
|
19 <th>Datum</th> |
|
20 <th>Actie</th> |
|
21 <th>Actie</th> |
|
22 </tr> |
|
23 </thead> |
|
24 <tbody id="tbody"> |
|
25 </tbody> |
|
26 </table> |
|
27 |
|
28 |
|
29 <br> |
|
30 <form action="index.html"><input type="submit" class="button" value="Hoofdmenu"></form> |
|
31 |
|
32 <script> |
|
33 |
|
34 $.getJSON("/logfiles.json", function(data) { |
|
35 var folder = data.Dir.map(function(item) { |
|
36 return item.Folder; |
|
37 }); |
|
38 |
|
39 $('#tmap').append([folder]); |
|
40 |
|
41 $.each(data.Dir[0].Files, function(idx, obj) { |
|
42 var ct = new Date(); |
|
43 ct.setTime(obj.Date * 1000); |
|
44 var str = ""; |
|
45 |
|
46 if (ct.getDate() < 10) |
|
47 str += "0"; |
|
48 str += ct.getDate() + "-"; |
|
49 if (ct.getMonth() < 9) |
|
50 str += "0"; |
|
51 str += (ct.getMonth() + 1) + "-" + ct.getFullYear() + " "; |
|
52 if (ct.getHours() < 10) |
|
53 str += "0"; |
|
54 str += ct.getHours() + ":"; |
|
55 if (ct.getMinutes() < 10) |
|
56 str += "0"; |
|
57 str += ct.getMinutes(); |
|
58 |
|
59 var eachrow = "<tr class=\"directory\">" |
|
60 + "<td>" + obj.File + "</td>" |
|
61 + "<td>" + obj.Size + " bytes</td>" |
|
62 + "<td>" + str + "</td>" |
|
63 + "<td><a href=\"/log/" + obj.File + "\">Download</a></td>" |
|
64 + "<td><a href=\"/chart.html?show=/log/" + obj.File + "\">Grafiek</a></td>" |
|
65 + "</tr>"; |
|
66 $('#tbody').append(eachrow); |
|
67 }); |
|
68 }); |
|
69 |
|
70 </script> |
|
71 |
|
72 </body> |
|
73 </html> |
|
74 |