forked from ea1jay/tetrasvxdashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
382 lines (346 loc) · 11 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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// do not touch these includes!
include "config/config.php";
include "include/tools.php";
include "include/functions.php";
include "include/init.php";
include "version.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="">
<meta name="author" content="">
<meta http-equiv="refresh" content="<?php echo REFRESHAFTER?>">
<title>Tetra DMO Repeater Dashboard for <?php echo getConfigItem(SVXLOGICSECTION, "CALLSIGN", $configs);?></title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
.green
{
background-color: #4CAF50;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.blue
{
background-color: blue;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.red
{
background-color: red;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.black
{
background-color: black;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.magenta
{
background-color: magenta;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.cyan
{
background-color: cyan;
border: none;
color: black;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
.yellow
{
background-color: yellow;
border: none;
color: black;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
width:120px;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top">
<div class="container">
<a class="navbar-brand" href="#">HAM Tetra Repeater Dashboard - <?php echo getConfigItem(SVXLOGICSECTION, "CALLSIGN", $configs); ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="log.php">Log</a>
</li>
<li class="nav-item">
<a class="nav-link" href="editdash.php">Edit Dash Config</a>
</li>
<li class="nav-item">
<a class="nav-link" href="editconfig.php">Edit SVX Config</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mailto:<?php echo CONTACTEMAIL ?>">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<?php checkSetup(); ?>
<div class="container-fluid">
<div class="row">
<?php
include "include/sysinfo.php";
include "include/disk.php";
?>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-6">
<?php include "include/txstatus.php"; ?>
</div>
<div class="col-6">
<?php include "include/status.php"; ?>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-6">
<?php include "include/tgstatus.php"; ?>
</div>
<div class="col-6">
<?php include "include/lastheard.php"; ?>
</div>
</div>
</div>
<?php
if(array_key_exists('button1', $_POST)) {
button1();
}
if(array_key_exists('button2', $_POST)) {
button2();
}
if(array_key_exists('button3', $_POST)) {
button3();
}
if(array_key_exists('button4', $_POST)) {
button4();
}
if(array_key_exists('button5', $_POST)) {
button5();
}
if(array_key_exists('button6', $_POST)) {
button6();
}
if(array_key_exists('button7', $_POST)) {
button7();
}
if(array_key_exists('button8', $_POST)) {
button8();
}
if(array_key_exists('button9', $_POST)) {
button9();
}
if(array_key_exists('button10', $_POST)) {
button10();
}
if(array_key_exists('button11', $_POST)) {
button11();
}
if(array_key_exists('button12', $_POST)) {
button12();
}
function button1() {
$exec= "echo '" . KEY1[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button2() {
$exec= "echo '" . KEY2[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button3() {
$exec= "echo '" . KEY3[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button4() {
$exec= "echo '" . KEY4[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button5() {
$exec= "echo '" . KEY5[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button6() {
$exec= "echo '" . KEY6[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button7() {
$exec= "echo '" . KEY7[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button8() {
$exec= "echo '" . KEY8[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button9() {
$exec= "echo '" . KEY9[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button10() {
$exec= "echo '" . KEY10[1] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}
function button11() {
$exec= "sudo service svxlink stop";
exec($exec,$output);
echo "REPEATER STOPPED !!!";
}
function button12() {
$exec= "sudo service svxlink start";
exec($exec,$output);
header("Refresh:0");
echo "REPEATER STARTED !!!";
}
?>
<br>
<td><b><center>CONTROL BOARD</center></b></td>
<br>
<form method="post">
<center>
<input type="submit" name="button1"
class=<?php echo KEY1[2] ?> value=<?php echo KEY1[0] ?> />
<input type="submit" name="button2"
class=<?php echo KEY2[2] ?> value=<?php echo KEY2[0] ?> />
<input type="submit" name="button3"
class=<?php echo KEY3[2] ?> value=<?php echo KEY3[0] ?> />
<input type="submit" name="button4"
class=<?php echo KEY4[2] ?> value=<?php echo KEY4[0] ?> />
<input type="submit" name="button5"
class=<?php echo KEY5[2] ?> value=<?php echo KEY5[0] ?> />
<input type="submit" name="button6"
class=<?php echo KEY6[2] ?> value=<?php echo KEY6[0] ?> />
<input type="submit" name="button7"
class=<?php echo KEY7[2] ?> value=<?php echo KEY7[0] ?> />
<input type="submit" name="button8"
class=<?php echo KEY8[2] ?> value=<?php echo KEY8[0] ?> />
<input type="submit" name="button9"
class=<?php echo KEY9[2] ?> value=<?php echo KEY9[0] ?> />
<input type="submit" name="button10"
class=<?php echo KEY10[2] ?> value=<?php echo KEY10[0] ?> /><br><br>
<?php $stop = getStop($loglines) ; $stopParts = explode(" ", $stop); echo ' Last time stopped: ' . $stopParts[0] . ' ' . $stopParts[1];?>
<input type="submit" name="button11"
class="red" value="REPE STOP" />
<input type="submit" name="button12"
class="red" value="REPE START" /><?php $boot = getBoot($loglines) ; $bootParts = explode(" ", $boot); echo " Last time started: " . $bootParts[0] . " " . $bootParts[1];?><br>
</center>
</form>
<form action="" method="POST">
<center>
<br><label for="mydtmf">Send DTMF command (must end with #):</label>
<input type="text" id="mydtmf" name="mydtmf">
<input type="submit" class="buttonnegro"><br>
</center>
<br><br>
</form>
<?php
if (isset($_POST["mydtmf"])){
$exec= "echo '" . $_POST['mydtmf'] . "' > /tmp/svxlink_dtmf";
exec($exec,$output);
echo "<meta http-equiv='refresh' content='0'>";
}?>
<footer class="footer-copyright">
<span class="navbar navbar-dark bg-dark fixed-bottom text-muted">
<div class="container-fluid">
<span class="float:left;">
<?php
$lastReload = new DateTime();
$lastReload->setTimezone(new DateTimeZone(TIMEZONE));
echo "Tetra Dashboard ".VERSION." | Last Reload ".$lastReload->format('Y-m-d, H:i:s')." (".TIMEZONE.")";
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
?>
</span>
<span class="float:right;">
<strong>Made with love by EA2CQ based on KC1AWV's SVXLink Dashboard</strong>
</span>
</div>
</span>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<Pureknob Gauge Javascript -->
<script src="dist/js/pureknob.js" type="text/javascript"></script>
</body>
</html>