-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
101 lines (91 loc) · 2.41 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{%!SITE-TITLE!%}</title>
<link rel="stylesheet" href="../static/datatables/datatables.min.css">
<link rel="stylesheet" href="../static/main.css">
</head>
<body>
<script>
/* we have JS, load incoming */
document.body.classList.add("loading");
</script>
<div class="loader">
Loading...
</div>
<article>
<main>
<header>
<h1>{%!TABLE-TITLE!%}</h1>
</header>
{%!DESCRIPTION!%}
<table class="display">
{%!TABLE-CONTENTS!%}
</table>
</main>
<aside>
<header>
<h2>Input Details</h2>
</header>
<ul>
<li>Input: <var>{%!INPUT!%}</var></li>
<li>Tag name: <var>{%!TAG!%}</var></li>
<li>Scanned tags: {%!TAG-COUNT!%}</li>
<li>Unique tag contents: {%!UNIQUE-COUNT!%}</li>
<li>Start time: {%!START-TIME!%}</li>
<li>End time: {%!END-TIME!%}</li>
<li>Time taken: {%!RUNTIME!%}</li>
</ul>
</aside>
<footer>
Generated using <a href="https://github.com/AudunVN/tag-content-counter">Tag Content Counter <img class="badge" src="https://img.shields.io/github/stars/AudunVN/tag-content-counter?style=social"></a> by <a href="https://github.com/AudunVN">Space (AudunVN)</a>
</footer>
</article>
<script src="../static/datatables/datatables.min.js"></script>
<script>
$(document).ready(function() {
let outputFile = window.location.pathname.split("/").pop().slice(0, -5);
$.getJSON(`${outputFile}.json`, function(output) {
let counters = Object.entries(output.counters);
$("main table").DataTable({
dom: '<"dt-actions"fB><"dt-pages"il>rtp',
buttons: [
{
extend: 'copy',
text: 'Copy page',
exportOptions: {
modifier: {
page: 'current'
}
}
}, 'csv', 'excel'
],
language: {
search: "Search",
paginate: {
previous: "❮",
next: "❯"
},
aria: {
paginate: {
previous: "Previous page",
next: "Next page"
}
}
},
data: counters,
deferRender: true,
responsive: true,
order: [[ 1, "desc" ]],
pageLength: 25,
"initComplete": function(settings, json) {
document.body.classList.remove("loading");
}
});
});
});
</script>
</body>
</html>