-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.php
executable file
·358 lines (287 loc) · 15 KB
/
index.php
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?php
require('config.inc.php');
require('boot.inc.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Better Than Nothing Web Interface for Dishy">
<meta name="author" content="Chuck Lavoie">
<title>Better Than Nothing Web Interface</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Bootstrap core JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!-- Charts.js -->
<script src="https://www.chartjs.org/dist/2.9.4/Chart.min.js"></script>
<script src="https://www.chartjs.org/samples/latest/utils.js"></script>
<!-- Sparklines -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-sparklines/2.1.2/jquery.sparkline.min.js"></script>
<!-- Custom styles for this template -->
<link rel="stylesheet" href="css/site.css"></link>
<script>
var maxGraphS = <?php echo $_CONFIG["max_graph_seconds"]; ?>;
var ping_range_map = $.range_map({
'1:59': '#28a745',
'60:149': '#ffc107',
'150:1000': 'red'
})
var ping_range_map2 = $.range_map({
'1:59': 'red'
})
var speedtesthistory_range_map = ['#ec77f9','#7a6fbb'];
// PING
const sparklineconfig = {
type: 'bar',
height: '50',
barWidth: '3',
disableInteraction: false,
resize: false,
barSpacing: '0',
chartRangeMax:300,
colorMap: ping_range_map,
barColor: '#7ace4c'
}
// DOWN
const sparklineconfig2 = {
type: 'line',
height: '50',
barWidth: '1',
disableInteraction: true,
resize: false,
fillColor: 'transparent',
barSpacing: '0',
chartRangeMax: 150,
lineColor: '#ec77f9',
spotColor: false,
spotRadius: 0
}
// UP
const sparklineconfig3 = {
type: 'line',
height: '50',
barWidth: '1',
disableInteraction: true,
resize: false,
fillColor: 'transparent',
barSpacing: '0',
chartRangeMax: 150,
lineColor: '#7a6fbb',
spotColor: false,
spotRadius: 0
}
// SPEEDTEST HISTORY
const sparklineconfig4 = {
type: 'bar',
height: '50',
barWidth: '4',
disableInteraction: false,
resize: false,
barSpacing: '0',
chartRangeMax:150,
stackedBarColor: speedtesthistory_range_map
}
</script>
</head>
<body>
<div class="container" id="main_container">
<!-- HEADER -->
<div class="row">
<div class="col col-4">
<span class="fa-stack float-right" style="position: absolute; top: 15px; left: 120px; font-size: 18px;">
<i class="fas fa-satellite fa-stack-1x"></i>
<i class="fas fa-ban fa-stack-2x fade" style="color:Tomato" id="nosat"></i>
</span>
<div style="position: absolute; top: 50px; left: 110px;" class="" id="obstruction_icon">
<i class="fas fa-tree" style="font-size: 28px;"></i>
</div>
<img src="img/sl.png" id="starlinklogo" style="margin-top: 0px;">
<span class="badge badge-pill badge-success" id="state">CONNECTED</span>
</div>
<div class="col col-8">
<div style="position: absolute; top: 10px; right: 10px;"><a href="javascript://" onClick="pause_it()" id="pause_button" class="nocolor"><i class="fa fa-pause"></i> </a></div>
<span class="badge badge-pill badge-primary" style="position: absolute; bottom: 50px; right: 10px;" onClick="location='?<?php echo time(); ?>'">BETA</span>
<h1 id="username2" style="position: absolute; bottom: -5px; right: 10px;">CHUCK<strong>TSI</strong></h1>
<div style="position: absolute; bottom: 45px; right: 70px;"><small style="width: 100%;"><em>"Better Than Nothing"</em></small></div>
</div>
</div>
<!-- THROUGHPUT -->
<div class="row border-top" style="margin-top: 10px;" id="throughput">
<div class="col-12 <?php echo $_CONFIG['styles']['bg_bars']; ?>">
<div style="white-space: nowrap;" class="section_title">
<i class="fa fa-info-circle"></i> <strong>INFO</strong>
<div id="sw_rev" class="float-right" style="font-size: 10px; color: #b5b5b5"></div>
</div>
</div>
</div>
<div class="row" style="font-size: 90%; margin-top: 10px;">
<div class="col-3 text-right"><strong>UPTIME</strong></div>
<div class="col-3 text-left"><span id="uptimeS" class="moreinfo" moreinfo="help-method.html" style=""></span></a></div>
<div class="col-3 text-right"><strong>SNR</strong> </div>
<div class="col-3 text-left"><span id="snr" style=""></span>/9</div>
<div class="col-3 text-right"><strong>METHOD</strong></div>
<div class="col-3 text-left"><span id="gmethod" style=""></span> <a href="javascript://" onClick="openmodal('html','help-method.html');"><sup>?</sup></a></div>
<div class="col-3 text-right"><strong></strong> </div>
<div class="col-3 text-left"><span id="" style=""></span></div>
</div>
<!-- LATENCY -->
<div class="row border-top" style="margin-top: 20px;">
<div class="col-12 <?php echo $_CONFIG['styles']['bg_bars']; ?>">
<div style="white-space: nowrap;" class="section_title">
<i class="fa fa-arrows-alt-h"></i> <strong>LATENCY</strong>
<small><a href="javascript://" onClick="resetvar('peakPingTracker');" style="float: right; margin-top: 2px;" >RESET PEAK: <span id="jspingpeak"></span></a></small>
</div>
</div>
</div>
<div class="row border-bottom" style="font-size: 90%; margin-top: 10px;">
<div class="col-3 text-right"><strong>NOW</strong> </div>
<div class="col-3 text-left"><div id="latency">--- ms</div></div>
<div class="col-3 text-right"><strong>3 MIN AVG</strong> </div>
<div class="col-3 text-left"><div id="avglatency">--- ms</div></div>
<div class="col-12 text-left">
<div style="height: 50px; position: relative;">
<div id="sparklinedash" style="opacity: 0.5; position: absolute; z-index: 1; height: 50px;">
<span class="bar"></span>
</div>
</div>
</div>
</div>
<!-- THROUGHPUT -->
<div class="row border-top" style="margin-top: 20px;">
<div class="col-12 <?php echo $_CONFIG['styles']['bg_bars']; ?>">
<div style="white-space: nowrap;" class="section_title">
<i class="fa fa-file-import"></i> <strong>THROUGHPUT</strong>
<small><a href="javascript://" onClick="resetajax('peak');" style="float: right; margin-top: 2px;" >RESET PEAK: <span id="jspingpeak"></span></a></small>
</div>
</div>
</div>
<div class="row border-bottom" style="font-size: 90%; margin-top: 10px;">
<div class="col-3 text-right"><strong style="color: #7a6fbb">DOWN</strong></div>
<div class="col-4 text-left"><span id="downloadlinkthru" style=""></span></div>
<div class="col-1 text-right"><strong>PK</strong> </div>
<div class="col-4 text-left"><span id="maxthroughputdown" style=""></span></div>
</div>
<div class="row border-bottom" style="font-size: 90%;">
<div class="col-3 text-right"><strong style="color: #ec77f9;">UP</strong></div>
<div class="col-4 text-left"><span id="uploadlinkthru"></span></div>
<div class="col-1 text-right"><strong>PK</strong> </div>
<div class="col-4 text-left"><span id="maxthroughputup"></span></div>
</div>
<div class="row border-bottom">
<div class="col-12 text-left">
<div style="height: 50px; position: relative;">
<div id="sparklinedash2" style="position: absolute; z-index: 2; height: 50px;">
<span class="line"></span>
</div>
<div id="sparklinedash3" style="position: absolute; z-index: 2; height: 50px;">
<span class="line"></span>
</div>
</div>
</div>
</div>
<!-- SPEEDTEST -->
<div class="row border-top" style="margin-top: 20px;">
<div class="col-12 <?php echo $_CONFIG['styles']['bg_bars']; ?>">
<div style="white-space: nowrap;" class="section_title">
<i class="fa fa-running"></i><strong> SPEED TEST RESULTS:</strong>
</div>
</div>
</div>
<div class="row" style="font-size: 90%; margin-top: 10px;">
<div class="col-3 text-right"><div style="white-space: nowrap;"><strong style="color: #7a6fbb">DOWN</strong></div> </div>
<div class="col-4 text-left"><span id="downloadtest" style=""></span></div>
<div class="col-1 text-right"><div style="white-space: nowrap;"><strong style="color: #ec77f9;">UP</strong></div> </div>
<div class="col-4 text-left"><span id="uploadtest"></span></div>
<div class="col-3 text-right"><div style="white-space: nowrap;"><strong> AVG</strong></div> </div>
<div class="col-4 text-left"><span id="downloadtestavg" style=""></span></div>
<div class="col-1 text-right"><div style="white-space: nowrap;"><strong>AVG:</strong></div> </div>
<div class="col-4 text-left"><span id="uploadtestavg"></span></div>
</div>
<div class="row " style="font-size: 90%;">
<div class="col-3 text-right"><div style="white-space: nowrap;"><strong> LASTRUN</strong></div> </div>
<div class="col-9 text-left"><small><span style="white-space: nowrap;" id="speedtest" style=""></span> | Runs every 15 mins | .:| Total Tests: <strong><span id="total_speed_tests"></span></strong>|:. </small> </div>
<div class="col-3 text-right"> </div>
<div class="col-9">
<small class="text-muted">
HISTORY
(<a href="<?php echo $_CONFIG["web_data_path"].'/'.$_CONFIG['results']['speed_test_history_basename']; ?>">DOWNLOAD CSV</a>)
(<a href="javascript://" onClick="$('#history_speed_test_graph_container').toggle();">TOGGLE GRAPH</a>)
</small>
</div>
<!--<div class="col-12 col-lg-12"><small><i class="fa fa-clock"></i> <span style="white-space: nowrap;" id="nextspeedtest" style=""></span></small></div>-->
</div>
<div class="row" style="margin-top: 20px;" id="history_speed_test_graph_container">
<div class="col-12 text-left">
<div style="height: 50px; position: relative; opacity: 0.9;">
<div id="sparklinedash4" style="position: absolute; z-index: 2; height: 50px;">
<span class="line"></span>
</div>
</div>
</div>
<div class="col-2 border-top border-right border-left text-left"><small><?php echo date("gA",strtotime('-24 hours')); ?></small></div>
<div class="col-2 border-top border-right text-center"><small><?php echo date("gA",strtotime('-19 hours')); ?></small></div>
<div class="col-2 border-top border-right text-center"><small><?php echo date("gA",strtotime('-14 hours')); ?></small></div>
<div class="col-2 border-top border-right text-center"><small><?php echo date("gA",strtotime('-9 hours')); ?></small></div>
<div class="col-2 border-top border-right text-center"><small><?php echo date("gA",strtotime('-4 hours')); ?></small></div>
<div class="col-2 border-top text-right border-right"><small>NOW</small></div>
</div>
<!-- OBSTRUCTIONS -->
<div class="row border-top" style="margin-top: 20px;">
<div class="col-12 <?php echo $_CONFIG['styles']['bg_bars']; ?>">
<div style="white-space: nowrap;" class="section_title">
<i class="fa fa-tree"></i><strong> OBSTRUCTIONS</strong>
<small><a href="javascript://" onClick="resetajax('obs');" style="float: right; margin-top: 2px;" >RESET CHANGES</a></small>
</div>
</div>
</div>
<div class="row border-bottom" style="font-size: 90%; margin-top: 10px;">
<div class="col-3 text-right"><div style="white-space: nowrap;"><strong> FRACTION</strong></div> </div>
<div class="col-2 text-left"><span id="fractionObstructed" style=""></span></div>
<div class="col-7" style="white-space: nowrap;"><strong> DOWNTIME:</strong> <span id="last24hObstructedS" style=""></span></div>
<!--<br><div style="margin-top: -5px; font-size: 10px;"> due to obstructions in the last 24 hours</div>-->
<div class="col-3 text-right"><div style="white-space: nowrap;"><strong> CHANGES</strong></div></div>
<div class="col-7 text-left"><span id="fractionObstructedCount" style=""></span>
<a href="javascript://" onClick="play_obstructions()" id="pause_obs_playback_button" title="Playback changes" class="badge badge-pill badge-info"><i class="fa fa-play" style="font-size: 10px;"></i> </a>
<a href="<?php echo $_CONFIG["web_data_path"].'/'.$_CONFIG['results']['obstruction_log_basename']; ?>" title="Download CSV" class="badge badge-pill badge-info"><i class="fa fa-download" style="font-size: 10px;"></i> </a>
<a href="javascript://" onClick="live_obstructions()" id="live_obs_button" class="badge badge-pill badge-success fade">RETURN TO LIVE VIEW</a>
</div>
</div>
<div class="progress fade" style="margin-top: 10px;" id="playback_obs_perc_container">
<div id="playback_obs_perc" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div style="position: absolute; font-size: 14px !important;" id="obsdatetime" style=""></div>
<div class="row" style="margin-top: 20px;">
<div class="col-12">
<div id="canvas-holder" style="width: 800px; margin-left: -150px;">
<canvas id="chart-area"></canvas>
</div>
</div>
</div>
</div>
<!-- Modal Used For Info -->
<div class="row">
<div class="modal fade" id="onlyModal" tabindex="-1" aria-labelledby="onlyModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" id="modal-content">
</div>
</div>
</div>
</div>
</div>
</body>
<script>
var ajax_speedtest_url = "<?php echo $_CONFIG['ajax']['speed_test']; ?>";
var ajax_speedtest_history_url = "<?php echo $_CONFIG['ajax']['speed_test_history']; ?>";
var ajax_dishy_url = "<?php echo $_CONFIG['ajax']['dishy']; ?>";
</script>
<script src="js/site.js"></script>
</html>