kopia lustrzana https://github.com/sp9skp/spdxl
rodzic
7f1f810ddb
commit
d2f7661d05
|
@ -3,11 +3,17 @@
|
||||||
if (array_key_exists("config",$_POST)){
|
if (array_key_exists("config",$_POST)){
|
||||||
file_put_contents("conf/dxl_config.sh",str_replace("\r\n","\n",$_POST["config"]));
|
file_put_contents("conf/dxl_config.sh",str_replace("\r\n","\n",$_POST["config"]));
|
||||||
}
|
}
|
||||||
|
if (array_key_exists("restart",$_POST)){
|
||||||
|
touch("/tmp/restart_dxl");
|
||||||
|
}
|
||||||
print("<form method='POST'>");
|
print("<form method='POST'>");
|
||||||
print("<textarea name='config' cols='80' rows='20'>");
|
print("<textarea name='config' cols='80' rows='20'>");
|
||||||
print(file_get_contents("conf/dxl_config.sh"));
|
print(file_get_contents("conf/dxl_config.sh"));
|
||||||
print("</textarea>");
|
print("</textarea>");
|
||||||
print("<input type='submit' name='save_config' value='SAVE'>");
|
print("<input type='submit' name='save_config' value='SAVE'>");
|
||||||
|
print("<input type='submit' name='restart' value='SAVE & RESTART'>");
|
||||||
print("</form>");
|
print("</form>");
|
||||||
|
print("<pre>");
|
||||||
|
@print(file_get_contents("/tmp/restart_log"));
|
||||||
|
print("</pre>");
|
||||||
?>
|
?>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
print("<pre>\n");
|
||||||
|
$sondes=array();
|
||||||
|
$lines=@file("/tmp/sonde.csv");
|
||||||
|
if ($lines) {
|
||||||
|
foreach($lines as $line) $sondes[]=explode(";",$line);
|
||||||
|
|
||||||
|
//sort by altitude, descending
|
||||||
|
usort($sondes, function($a, $b) {
|
||||||
|
return $b[3] - $a[3];
|
||||||
|
});
|
||||||
|
|
||||||
|
//print actual low or lowest
|
||||||
|
foreach($sondes as $l) {
|
||||||
|
if ( ($l[8]+60 > time()) && (((int)$l[3]) < 3000) ){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print($l[0]." ".$l[7]."\n");
|
||||||
|
print($l[1]." ".$l[2]."\n");
|
||||||
|
print($l[3]."m ".$l[5]."m/s\n");
|
||||||
|
}else {
|
||||||
|
print("---\n");
|
||||||
|
print("---\n");
|
||||||
|
print("---\n");
|
||||||
|
}
|
||||||
|
print("\n");
|
||||||
|
print("\n");
|
||||||
|
|
||||||
|
print("</pre>\n");
|
||||||
|
|
||||||
|
?>
|
|
@ -17,7 +17,7 @@ print("<title>spdxl ".$realIP."</title>");
|
||||||
if($p=='s') echo "var page='sondy.php';";
|
if($p=='s') echo "var page='sondy.php';";
|
||||||
if($p=='A') echo "var page='wf.php';";
|
if($p=='A') echo "var page='wf.php';";
|
||||||
if($p=='PS') echo "var page='processes.php';";
|
if($p=='PS') echo "var page='processes.php';";
|
||||||
|
if($p=='D') echo "var page='display.php';";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
function getData(){
|
function getData(){
|
||||||
|
@ -70,6 +70,7 @@ function getData(){
|
||||||
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST2';" value="SDR #2 freq.">
|
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST2';" value="SDR #2 freq.">
|
||||||
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST3';" value="SDR #3 freq.">
|
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST3';" value="SDR #3 freq.">
|
||||||
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST4';" value="SDR #4 freq.">
|
<input style="width:100px" type="button" onClick="location.href='index.php?p=SDRTST4';" value="SDR #4 freq.">
|
||||||
|
<input style="width:100px" type="button" onClick="location.href='index.php?p=D';" value="OLED">
|
||||||
|
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -79,7 +80,7 @@ function getData(){
|
||||||
|
|
||||||
if ($p=="C") require("conf.php");
|
if ($p=="C") require("conf.php");
|
||||||
|
|
||||||
if($p=='0' || $p=='' || $p=='s' ) echo "<p id=\"switch_txt\"></p>";
|
if($p=='0' || $p=='' || $p=='s' || $p=='D' ) echo "<p id=\"switch_txt\"></p>";
|
||||||
if( substr($p,0,6)=="SDRTST" ) include 'sdr.php';
|
if( substr($p,0,6)=="SDRTST" ) include 'sdr.php';
|
||||||
if($p=='A') echo "<p id=\"switch_txt\"></p>";
|
if($p=='A') echo "<p id=\"switch_txt\"></p>";
|
||||||
if($p=='PS') echo "<p id=\"switch_txt\"></p>";
|
if($p=='PS') echo "<p id=\"switch_txt\"></p>";
|
||||||
|
|
|
@ -1,28 +1,19 @@
|
||||||
<div align="center">
|
|
||||||
<table class='procesy'>
|
|
||||||
<tbody class='procesy'>
|
|
||||||
<tr class='proces'><th> Name </th><th> PID </th></tr>
|
|
||||||
<?php
|
<?php
|
||||||
include 'config.php';
|
print("<pre>");
|
||||||
include 'funkcje.php';
|
print("RUNNING:\n");
|
||||||
echo "<tr class='proces'>";
|
$required=array("rtl_tcp","sdrtst","sondeudp","sondemod","udpgate4");
|
||||||
procesRunningPrint("rtl_tcp");
|
$procs=array();
|
||||||
echo "</tr>";
|
exec("ps -C ".implode(",",$required)." -o cmd --noheaders",$procs);
|
||||||
echo "<tr class='proces'>";
|
foreach($procs as $proc){
|
||||||
procesRunningPrint("sdrtst");
|
$p=explode(" ",$proc,2);
|
||||||
echo "</tr>";
|
$cmd=basename($p[0]);
|
||||||
echo "<tr class='proces'>";
|
print($cmd.":\n".$p[1]."\n");
|
||||||
procesRunningPrint("sondeudp");
|
$required=array_diff($required,array($cmd));
|
||||||
echo "</tr>";
|
}
|
||||||
echo "<tr class='proces'>";
|
print("\nABSENT:\n");
|
||||||
procesRunningPrint("sondemod");
|
foreach($required as $cmd){
|
||||||
echo "</tr>";
|
print($cmd."\n");
|
||||||
echo "<tr class='proces'>";
|
}
|
||||||
procesRunningPrint("udpgate4");
|
print("</pre>");
|
||||||
echo "</tr>";
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
Ładowanie…
Reference in New Issue