Browse Source

ajout de la page de LOG

master
heuzef 5 years ago
parent
commit
e57b364e20
2 changed files with 74 additions and 0 deletions
  1. +1
    -0
      ui/allo-gg.log
  2. +73
    -0
      ui/check_services.php

+ 1
- 0
ui/allo-gg.log View File

@@ -0,0 +1 @@
CONTENT

+ 73
- 0
ui/check_services.php View File

@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="fr">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Allo-GG</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="bootstrap.css" media="screen">
</head>

<?php

$etat_status[0]='success';
$etat_status[1]='light';

$porte_status[0]='info';
$porte_status[1]='light';

$sonette_status[0]='danger';
$sonette_status[1]='light';

exec("../scripts/check_services.sh >> allogg.log &");
exec("sleep 3");

?>

<body>
<div class="container" style="text-align:center;">

<?php echo $message[$_GET["msg"]]; ?>

<hr/>
<div class="page-header">
<div class="row">
<div class="col-lg-12">
<a href="index.php"><img src="../logo/allo-gg-logo.png" class="img-fluid" alt="Responsive image"></a>
<br/><br/>
</div>
</div>
</div>

<h2 class="text-primary">Interface de contrôle du module</h2>
<?php $etat = exec("/usr/local/bin/gpio -g read 18"); ?>
<?php $sonette = exec("/usr/local/bin/gpio -g read 17"); ?>
<?php $porte = exec("/usr/local/bin/gpio -g read 4"); ?>

<span class="badge badge-pill badge-<?php echo $etat_status[$etat]; ?>">&nbsp;</span>
&nbsp;
<span class="badge badge-pill badge-<?php echo $porte_status[$porte]; ?>">&nbsp;</span>
&nbsp;
<span class="badge badge-pill badge-<?php echo $sonette_status[$sonette]; ?>">&nbsp;</span>
<hr/>

<div class="row">
<div class="col-lg-12">
<p class="bs-component">

<?php exec(" cat allogg.log &"); ?>

</p>
<hr/>
</div>
</div>

</div>

<script src="jquery.js"></script>
<script src="bootstrap.js"></script>

</body>
</html>

Loading…
Cancel
Save