1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Use status class

This commit is contained in:
Joe Haig 2016-08-15 12:25:20 +00:00
parent c391314ef9
commit f730aa1ffb

View File

@ -6,6 +6,8 @@
*/ */
function DisplayDashboard(){ function DisplayDashboard(){
$status = new StatusMessages();
exec( 'ifconfig wlan0', $return ); exec( 'ifconfig wlan0', $return );
exec( 'iwconfig wlan0', $return ); exec( 'iwconfig wlan0', $return );
@ -43,12 +45,10 @@ function DisplayDashboard(){
$strFrequency = $result[1]; $strFrequency = $result[1];
if(strpos( $strWlan0, "UP" ) !== false && strpos( $strWlan0, "RUNNING" ) !== false ) { if(strpos( $strWlan0, "UP" ) !== false && strpos( $strWlan0, "RUNNING" ) !== false ) {
$status = '<div class="alert alert-success alert-dismissable">Interface is up $status->addMessage('Interface is up', 'success');
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
$wlan0up = true; $wlan0up = true;
} else { } else {
$status = '<div class="alert alert-warning alert-dismissable">Interface is down $status->addMessage('Interface is down', 'warning');
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
} }
if( isset($_POST['ifdown_wlan0']) ) { if( isset($_POST['ifdown_wlan0']) ) {
@ -72,7 +72,7 @@ function DisplayDashboard(){
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"><i class="fa fa-dashboard fa-fw"></i> Dashboard </div> <div class="panel-heading"><i class="fa fa-dashboard fa-fw"></i> Dashboard </div>
<div class="panel-body"> <div class="panel-body">
<p><?php echo $status; ?></p> <p><?php $status->showMessages(); ?></p>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="panel panel-default"> <div class="panel panel-default">