-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewer.html
164 lines (128 loc) · 5.23 KB
/
viewer.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<link rel="stylesheet" href="assets/jquery-ui.css">
<link rel="stylesheet" href="assets/owl.carousel.min.css">
<link rel="stylesheet" href="assets/owl.theme.default.min.css">
<script src="assets/jquery.min.js"></script>
<script src="assets/jquery-ui.min.js"></script>
<script src="assets/owl.carousel.min.js"></script>
<script>
$(function() {
$("#datepicker").datepicker({minDate: (new Date(2016, 1, 24)), maxDate: (new Date(Date.now()))});
//$("#datepicker").datepicker({minDate: (new Date(2016, 1, 24)), maxDate: (new Date(2016, 11, 20))});
});
</script>
<style type="text/css">
.item {
background-color: #ecf0f1;
}
.item > p {
text-align: center;
margin: auto;
}
</style>
</head>
<body>
<div class="container">
<h1>GSA Graph Viewer</h1>
<hr />
<div id="notifications"></div>
<div id="selectDate">
<p>Please select a start date for the graph!</p>
<form id="dateForm" method="post">
Date: <input type="text" id="datepicker">
<input type="submit" name="">
</form>
</div>
<hr />
<div>
<h2>Queries per Minute <button id="button1" type="button">🔒 Sync Others</button></h2>
<div id="queriesperminute" class="owl-carousel owl-theme"></div>
</div>
<hr />
<h2>Average Search Latency <button id="button2" type="button">🔒 Sync Others</button></h2>
<div id="averagesearchlatency" class="owl-carousel owl-theme"></div>
<hr />
<h2>Sum URLs Crawled <button id="button3" type="button">🔒 Sync Others</button></h2>
<div id="sumurlscrawled" class="owl-carousel owl-theme"></div>
<hr />
<h2>Sum URLs Available <button id="button4" type="button">🔒 Sync Others</button></h2>
<div id="sumurlsavailable" class="owl-carousel owl-theme"></div>
</div>
<script>
$("#dateForm").submit(function(event){
var selectedDate = $("#datepicker").datepicker('getDate');
var now = new Date(Date.now());
//var now = new Date(2016, 11, 20);
console.log(selectedDate);
$("#notifications").append("<p><strong>Start Date:</strong> " + selectedDate + "<br><strong>End Date:</strong> " + now + "</p>");
$("#selectDate").remove();
for (var d = selectedDate; d <= now; d.setDate(d.getDate() + 1)) {
var mm = ((d.getMonth() + 1) >= 10) ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
var dd = ((d.getDate()) >= 10) ? (d.getDate()) : '0' + (d.getDate());
var yyyy = d.getFullYear();
var date = yyyy.toString() + mm.toString() + dd.toString();
var tdate = dd + "/" + mm + "/" + yyyy;
$("#queriesperminute").prepend("<div class='item'><img src='graphs/queriesperminutegraph-"+ date + ".png' alt='" + date + "' /><p><strong>" + tdate + "</strong></p></div>");
$("#averagesearchlatency").prepend("<div class='item'><img src='graphs/gws_avg_search_latency_graph-"+ date + ".png' alt='" + date + "' /><p><strong>" + tdate + "</strong></p></div>");
$("#sumurlscrawled").prepend("<div class='item'><img src='graphs/sumurlscrawledgraph-"+ date + ".png' alt='" + date + "' /><p><strong>" + tdate + "</strong></p></div>");
$("#sumurlsavailable").prepend("<div class='item'><img src='graphs/sumurlsavailablegraph-"+ date + ".png' alt='" + date + "' /><p><strong>" + tdate + "</strong></p></div>");
}
$(function() {
var owl = $('.owl-carousel');
owl.owlCarousel ({
rtl:true,
nav: true,
items: 4,
loop: false,
margin: 10,
});
});
event.preventDefault();
});
$('#button1').click(function() {
var index = $('#queriesperminute div.active').index();
var owl1 = $('#queriesperminute');
var owl2 = $('#averagesearchlatency');
var owl3 = $('#sumurlscrawled');
var owl4 = $('#sumurlsavailable');
owl2.trigger('to.owl.carousel', [index,300,true]);
owl3.trigger('to.owl.carousel', [index,300,true]);
owl4.trigger('to.owl.carousel', [index,300,true]);
});
$('#button2').click(function() {
var index = $('#averagesearchlatency div.active').index();
var owl1 = $('#queriesperminute');
var owl2 = $('#averagesearchlatency');
var owl3 = $('#sumurlscrawled');
var owl4 = $('#sumurlsavailable');
owl1.trigger('to.owl.carousel', [index,300,true]);
owl3.trigger('to.owl.carousel', [index,300,true]);
owl4.trigger('to.owl.carousel', [index,300,true]);
});
$('#button3').click(function() {
var index = $('#sumurlscrawled div.active').index();
var owl1 = $('#queriesperminute');
var owl2 = $('#averagesearchlatency');
var owl3 = $('#sumurlscrawled');
var owl4 = $('#sumurlsavailable');
owl1.trigger('to.owl.carousel', [index,300,true]);
owl2.trigger('to.owl.carousel', [index,300,true]);
owl4.trigger('to.owl.carousel', [index,300,true]);
});
$('#button4').click(function() {
var index = $('#sumurlsavailable div.active').index();
var owl1 = $('#queriesperminute');
var owl2 = $('#averagesearchlatency');
var owl3 = $('#sumurlscrawled');
var owl4 = $('#sumurlsavailable');
owl1.trigger('to.owl.carousel', [index,300,true]);
owl2.trigger('to.owl.carousel', [index,300,true]);
owl3.trigger('to.owl.carousel', [index,300,true]);
});
</script>
</body>
</html>