Skip to content

Commit

Permalink
some bug fixes and some extra styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnyvdbr committed Mar 10, 2016
1 parent d958ec0 commit d48884e
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 63 deletions.
3 changes: 3 additions & 0 deletions www/Images/_notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<file name="IP-cam-icon-w110-flip.png" server="192.168.20.146//home/pi/RaspberryIPCamera/www/" local="130985725779945433" remote="131019224470000000" Dst="1" />
<file name="RaspberryIPCamera-Favicon.jpg" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="130985725779975426" remote="131020013020000000" Dst="1" />
<file name="IP-cam-icon-w110-flip.png" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="130985725779945433" remote="131020013020000000" Dst="1" />
<file name="RaspberryIPCamera-Favicon.jpg" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="130985725779975426" remote="116445240590000000" Dst="1" />
<file name="IP-cam-icon-w110-flip.png" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="130985725779945433" remote="116445240620000000" Dst="1" />
<file name="commercial1.PNG" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131007670327084744" remote="131020803350000000" Dst="1" />
</dwsync>
2 changes: 1 addition & 1 deletion www/RaspberryIPCameraSettings.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SoftwareVersion = "v1.5 Beta"
SoftwareVersion = "v1.6 Beta"
IPAssignment = "DHCP"
ntpclient = "enabled"
IPAddress = ""
Expand Down
116 changes: 88 additions & 28 deletions www/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="css/background.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>
<body id="even-stops">
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
Expand Down Expand Up @@ -56,7 +57,7 @@
</nav>

<!-- InstanceBeginEditable name="body" -->
<?php date_default_timezone_set(trim(file_get_contents("/etc/timezone"),"\n"));?>
<?php date_default_timezone_set(trim(file_get_contents("/etc/timezone"),"\n"));?>
<?php $configsettings = parse_ini_file("/home/pi/RaspberryIPCamera/www/RaspberryIPCameraSettings.ini");?>
<?php $camerasettings = parse_ini_file("/etc/uv4l/uv4l-raspicam.conf");?>

Expand All @@ -69,13 +70,23 @@
<?php
if($camerasettings['encoding'] == "mjpeg") {
echo('<img class="img-responsive img-rounded center-block" src="http://user:uv4luser1@');
echo trim(shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
if (preg_match('/^up/',shell_exec("cat /sys/class/net/eth0/operstate"))) {
echo trim(shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
}
else {
echo trim(shell_exec("ifconfig wlan0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
}
echo(':8080/stream/video.mjpeg" alt=""/>');
}

if($camerasettings['encoding'] == "h264") {
echo('<p class="text-center">The IP Camera is currently running in RTSP server mode and can be accessed by an external RTSP player (VLC, mplayer, Synology Surveillance station, etc ...) via below mrl.</p><p class="text-center"><mark>rtsp://');
echo trim(shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
if (preg_match('/^up/',shell_exec("cat /sys/class/net/eth0/operstate"))) {
echo trim(shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
}
else {
echo trim(shell_exec("ifconfig wlan0 | awk '/inet / { print $2 }' | sed 's/addr://'"));
}
echo(':8554</mark>');
}
?>
Expand All @@ -94,30 +105,79 @@
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . $configsettings['SoftwareVersion'];?></p></div>
</div><!--end panel-body-->
</div><!--end panel-->
</div> <!-- /row -->
<div class="row">
<div class="panel panel-default">
<div class="panel-heading"><h4 class="text-center">Network Settings</h4></div><!--end panel heading-->
<div class="panel-body">
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address Assignment:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . $configsettings['IPAssignment'];?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Cable Connection Status:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /sys/class/net/eth0/operstate");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Mac Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /sys/class/net/eth0/address");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Subnet Mask:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig eth0 | awk '/Mask:/{ print $4;} ' | sed 's/Mask://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Default Gateway:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ip route | awk '/default/ { print $3 }'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Primary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=1 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Secondary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=2 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
</div><!--end panel-body-->
</div><!--end panel-->
</div> <!-- /row -->
</div> <!-- row -->

<div id="lanstatus" <?php if (!preg_match('/^up/',shell_exec("cat /sys/class/net/eth0/operstate"))) {echo('style="display:none"');}?>
<div class="row">
<div class="panel panel-default">
<div class="panel-heading"><h4 class="text-center">Network Settings</h4></div><!--end panel heading-->
<div class="panel-body">
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address Assignment:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . $configsettings['IPAssignment'];?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Cable Connection Status:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /sys/class/net/eth0/operstate");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Mac Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /sys/class/net/eth0/address");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Subnet Mask:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig eth0 | awk '/Mask:/{ print $4;} ' | sed 's/Mask://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Default Gateway:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ip route | awk '/default/ { print $3 }'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Primary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=1 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Secondary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=2 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
</div><!--end panel-body-->
</div><!--end panel-->
</div> <!-- /row -->
</div> <!-- end div lanstatus -->

<div id="wifistatus" <?php if (preg_match('/^up/',shell_exec("cat /sys/class/net/eth0/operstate"))) {echo('style="display:none"');}?>
<div class="row">
<div class="panel panel-default">
<div class="panel-heading"><h4 class="text-center">Wifi Settings</h4></div><!--end panel heading-->
<div class="panel-body">
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address Assignment:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . $configsettings['IPAssignment'];?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Wifi Adapter Status:</strong></p></div>
<div class="col-sm-6">
<p class="text-center bg-info">
<?php
echo "&nbsp;";
if (preg_match('/^up/',shell_exec("cat /sys/class/net/wlan0/operstate"))) {
echo "up";
}
else {
echo "No wireless adapter found.";
}
?>
</p>
</div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Mac Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /sys/class/net/wlan0/address");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>IP Address:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig wlan0 | awk '/inet / { print $2 }' | sed 's/addr://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Subnet Mask:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ifconfig wlan0 | awk '/Mask:/{ print $4;} ' | sed 's/Mask://'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Default Gateway:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("ip route | awk '/default/ { print $3 }'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Primary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=1 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><strong>Secondary DNS Server:</strong></p></div>
<div class="col-sm-6"><p class="text-center bg-info"><?php echo "&nbsp;" . shell_exec("cat /etc/resolv.conf | awk -v n=2 '/^nameserver/{l++} (l==n){print}' | sed -e 's/nameserver //g'");?></p></div>
</div><!--end panel-body-->
</div><!--end panel-->
</div> <!-- /row -->
</div> <!-- end div wifistatus -->








</div> <!-- /container -->
<!-- InstanceEndEditable -->

Expand Down
3 changes: 2 additions & 1 deletion www/Templates/Site-Template.dwt.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="../css/background.css" rel="stylesheet" type="text/css">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
<body id="even-stops">
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
Expand Down
1 change: 1 addition & 0 deletions www/Templates/_notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<dwsync>
<file name="Site-Template.dwt.php" server="192.168.20.138//home/pi/RaspberryIPCamera/www/" local="130973398334464198" remote="130973398620000000" Dst="1" />
<file name="Site-Template.dwt.php" server="192.168.20.147//home/pi/RaspberryIPCamera/www/" local="131000037050154782" remote="131000112300000000" Dst="1" />
<file name="Site-Template.dwt.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020790577327091" remote="131020791450000000" Dst="1" />
</dwsync>
17 changes: 15 additions & 2 deletions www/_notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,20 @@
<file name="Login.php" server="192.168.20.146//home/pi/RaspberryIPCamera/www/" local="131019302320356420" remote="131019289680000000" Dst="1" />
<file name="logout.php" server="192.168.20.146//home/pi/RaspberryIPCamera/www/" local="131000037052410092" remote="131019278600000000" Dst="1" />
<file name="RaspberryIPCameraSettings.ini" server="192.168.20.146//home/pi/RaspberryIPCamera/www/" local="131014028339926647" remote="131019278600000000" Dst="1" />
<file name="Login.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020024104201369" remote="131020024100000000" Dst="1" />
<file name="Login.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020024359247596" remote="131020712570000000" Dst="1" />
<file name="logincheck.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020024359317592" remote="131020216830000000" Dst="1" />
<file name="Status.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020216604472428" remote="131020216830000000" Dst="1" />
<file name="Status.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020792514707669" remote="131020792540000000" Dst="1" />
<file name="network-settings.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020790596222329" remote="131020791450000000" Dst="1" />
<file name="functions.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131019892080000000" remote="131019892080000000" Dst="1" />
<file name="camera-settings-array.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131007670327274219" remote="131020759950000000" Dst="1" />
<file name="camera-settings.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020790595182331" remote="131020791450000000" Dst="1" />
<file name="Status.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131020766657821067" remote="116445243770000000" Dst="1" />
<file name="logincheck.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131020024359317592" remote="116445240590000000" Dst="1" />
<file name="functions.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131019892080000000" remote="131019892080000000" Dst="1" />
<file name="camera-settings-array.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131007670327274219" remote="116445241970000000" Dst="1" />
<file name="camera-settings.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131020766840207366" remote="116445243760000000" Dst="1" />
<file name="network-settings.php" server="192.168.20.9//home/pi/RaspberryIPCamera/www/" local="131019892080000000" remote="131019892080000000" Dst="1" />
<file name="RaspberryIPCameraSettings.ini" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131020767691626644" remote="131020791450000000" Dst="1" />
<file name="bootstrap-3.3.6-dist.zip" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="130985725781200622" remote="131020803350000000" Dst="1" />
<file name="logout.php" server="192.168.20.133//home/pi/RaspberryIPCamera/www/" local="131000037052410092" remote="131020803350000000" Dst="1" />
</dwsync>
Loading

0 comments on commit d48884e

Please sign in to comment.