forked from dhartmann1979/SVXLink-Dash-V2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodeInfo.php
167 lines (157 loc) · 6.69 KB
/
nodeInfo.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
<?php
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
include_once 'include/config.php';
include_once 'include/tools.php';
$svxConfigFile = '/etc/svxlink/svxlink.conf';
if (fopen($svxConfigFile, 'r')) {
$svxconfig = parse_ini_file($svxConfigFile, true, INI_SCANNER_RAW);
$callsign = $svxconfig['ReflectorLogic']['CALLSIGN'];
$fmnetwork = $svxconfig['ReflectorLogic']['FMNET'];
$tgUri = $svxconfig['ReflectorLogic']['TG_URI'];
$node_password = $svxconfig['ReflectorLogic']['AUTH_KEY'];
$node_user = $callsign;}
else { $callsign="NOCALL";
$fmnetwork="not registered";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
<head>
<meta name="robots" content="index" />
<meta name="robots" content="follow" />
<meta name="language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="SVXLink" />
<meta name="Author" content="ON3URE, G4NAB, SP2ONG, SP0DZ" />
<meta name="Description" content="Dashboard for SVXLink by ON3URE, G4NAB, SP2ONG, SP0DZ" />
<meta name="KeyWords" content="SVXLink,ON3URE, G4NAB, SP2ONG, SP0DZ" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="shortcut icon" href="images/favicon.ico" sizes="16x16 32x32" type="image/png">
<?php echo ("<title>" . $callsign ." ". $fmnetwork . " Dashboard</title>"); ?>
<?php include_once "include/browserdetect.php"; ?>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/functions.js"></script>
<script type="text/javascript" src="scripts/pcm-player.min.js"></script>
<script type="text/javascript">
$.ajaxSetup({ cache: false });
</script>
<link href="css/featherlight.css" type="text/css" rel="stylesheet" />
<script src="scripts/featherlight.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="">
</head>
<body style="background-color: #e1e1e1;font: 11pt arial, sans-serif;">
<center>
<fieldset style="box-shadow:5px 5px 20px #999; background-color:#f1f1f1; width:0px;margin-top:15px;margin-left:0px;margin-right:5px;font-size:13px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
<div class="container">
<div class="header">
<div class="parent">
<div class="img" style="padding-left:30px"><img src="images/svxlink.ico" /></div>
<div class="text"style="padding-right:230px">
<center><p style="margin-top:5px;margin-bottom:0px;">
<span style="font-size: 32px;letter-spacing:4px;font-family: "sans-serif", sans-serif;font-weight:500;color:PaleBlue"><?php echo $callsign; ?></span>
<p style="margin-top:0px;margin-bottom:0px;">
<span style="font-size: 18px;letter-spacing:4px;font-family: "sans-serif", sans-serif;font-weight:500;color:PaleBlue"><?php echo $fmnetwork; ?></span>
</p></center>
</div></div>
</div>
<?php include_once __DIR__."/include/top_menu.php"; ?>
<div class="content"><center>
<div style="margin-top:0px;">
</div></center>
</div>
<?php
if (isProcessRunning('node')) {
echo ' <button class="button link" onclick="playAudioToggle(8080, this)"><b> <img src=images/speaker.png alt="" style="vertical-align:middle"> RX Monitor </b></button><br><br>';
}
?>
<?php
if (MENUBUTTON=="TOP") {
include_once __DIR__."/include/buttons.php";
}
?>
<?php
if($_GET['id']=="svxlink") {
//shell_exec("cd ");
$edit_file = "/etc/svxlink/svxlink.conf";
}
elseif($_GET['id']=="gpio") {
//shell_exec("cd ");
$edit_file = "/etc/svxlink/gpio.conf";
}
elseif($_GET['id']=="echolink"){
//shell_exec("cd ");
$edit_file = "/etc/svxlink/svxlink.d/ModuleEchoLink.conf";
}
elseif($_GET['id']=="metarinfo"){
//shell_exec("cd ");
$edit_file = "/etc/svxlink/svxlink.d/ModuleMetarInfo.conf";
}
elseif($_GET['id']=="nodeInfo"){
$edit_file = "/etc/svxlink/node_info.json";
}
// check if form has been submitted
//$filename = by choice;
/*
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"."editor.php";
if (isset($_POST['text']))
{
// save the text contents
file_put_contents($file, $_POST['text']);
// redirect to form again
header(sprintf('Location: %s', $url));
printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
exit();
}
*/
// read the textfile
//$text = file_get_contents($file);
?>
<?php
echo '<table style="margin-bottom:0px;border:0; border-collapse:collapse; cellspacing:0; cellpadding:0; background-color:#f1f1f1;"><tr style="border:none;background-color:#f1f1f1;">';
echo '<td width="200px" valign="top" class="hide" style="height:auto;border:0;background-color:#f1f1f1;">';
echo '<div class="nav" style="margin-bottom:1px;margin-top:1px;">'."\n";
echo '<script type="text/javascript">'."\n";
echo 'function reloadStatusInfo(){'."\n";
echo ' $("#statusInfo").load("include/status.php",function(){ setTimeout(reloadStatusInfo,3000) });'."\n";
echo '}'."\n";
echo 'setTimeout(reloadStatusInfo,3000);'."\n";
echo '$(window).trigger(\'resize\');'."\n";
echo '</script>'."\n";
echo '<div id="statusInfo" style="margin-bottom:30px;">'."\n";
include 'include/status.php';
echo '</div>'."\n";
echo '</div>'."\n";
echo '</td>'."\n";
echo '<td valign="middle" style="height:495px; width=640px; text-align: center; border:none; background-color:#f1f1f1;">';
echo '<iframe src="/nodeInfo?file=' . $edit_file . '" width="625px" height="490px" title="EDIT"></iframe>';
echo '</td>';
?>
</tr></table>
<?php
echo '<div class="content2">'."\n";
echo '<script type="text/javascript">'."\n";
echo 'function reloadSysInfo(){'."\n";
echo ' $("#sysInfo").load("include/system.php",function(){ setTimeout(reloadSysInfo,15000) });'."\n";
echo '}'."\n";
echo 'setTimeout(reloadSysInfo,15000);'."\n";
echo '$(window).trigger(\'resize\');'."\n";
echo '</script>'."\n";
echo '<div id="sysInfo">'."\n";
include 'include/system.php';
echo '</div>'."\n";
echo '</div>'."\n";
?>
<?php
if (MENUBUTTON=="BOTTOM") {
include_once __DIR__."/include/buttons.php"; }
?>
<center><span title="Dashboard" style="font: 7pt arial, sans-serif;">SvxLink Dashboard ON3URE, G4NAB, SP2ONG, SP0DZ <?php $cdate=date("Y"); if ($cdate > "2021") {$cdate="2021-".date("Y");} echo $cdate; ?>
</div>
</fieldset>
<br>
</body>
</html>