image/w/logs.html

changeset 84
d01de33231cb
parent 40
71e06f6d80fd
equal deleted inserted replaced
83:0cc064a4921b 84:d01de33231cb
12 12
13 <div id="tmap"></div> 13 <div id="tmap"></div>
14 <table class="directory"> 14 <table class="directory">
15 <thead> 15 <thead>
16 <tr class="directory"> 16 <tr class="directory">
17 <th>Bestand</th> 17 <th align="left">Bestand</th>
18 <th>Grootte</th> 18 <th align="left">Grootte</th>
19 <th>Datum</th> 19 <th align="left">Datum</th>
20 <th>Actie</th> 20 <th align="left">Actie</th>
21 <th>Actie</th> 21 <th align="left">Actie</th>
22 </tr> 22 </tr>
23 </thead> 23 </thead>
24 <tbody id="tbody"> 24 <tbody id="tbody">
25 </tbody> 25 </tbody>
26 </table> 26 </table>
30 <div class="menu"> 30 <div class="menu">
31 <form action="index.html"><input type="submit" class="button" value="Hoofdmenu"></form> 31 <form action="index.html"><input type="submit" class="button" value="Hoofdmenu"></form>
32 </div> 32 </div>
33 33
34 <script> 34 <script>
35
36 function getFileExtension(filename) {
37 return filename.substring(filename.lastIndexOf('.')+1, filename.length) || filename;
38 }
35 39
36 $.getJSON("/logfiles.json", function(data) { 40 $.getJSON("/logfiles.json", function(data) {
37 var folder = data.Dir.map(function(item) { 41 var folder = data.Dir.map(function(item) {
38 return item.Folder; 42 return item.Folder;
39 }); 43 });
60 64
61 var eachrow = "<tr class=\"directory\">" 65 var eachrow = "<tr class=\"directory\">"
62 + "<td>" + obj.File + "</td>" 66 + "<td>" + obj.File + "</td>"
63 + "<td>" + obj.Size + " bytes</td>" 67 + "<td>" + obj.Size + " bytes</td>"
64 + "<td>" + str + "</td>" 68 + "<td>" + str + "</td>"
65 + "<td><a href=\"/log/" + obj.File + "\">Download</a></td>" 69 + "<td><a href=\"/log/" + obj.File + "\">Download</a></td>";
66 + "<td><a href=\"/chart.html?show=/log/" + obj.File + "\">Grafiek</a></td>" 70 if (getFileExtension(obj.File) == 'json') {
67 + "</tr>"; 71 eachrow += "<td><a href=\"/chart.html?show=/log/" + obj.File + "\">Grafiek</a></td>";
72 } else {
73 eachrow += "<td> </td>";
74 }
75 eachrow += "</tr>";
68 $('#tbody').append(eachrow); 76 $('#tbody').append(eachrow);
69 }); 77 });
70 }); 78 });
71 79
72 </script> 80 </script>

mercurial