- Add LDC Web Status Checker

- Update Themes
This commit is contained in:
Vincent BRIDIER 2020-05-18 16:14:26 +02:00
parent af8894d810
commit 79eee76784
4 changed files with 97 additions and 11 deletions

View file

@ -0,0 +1,85 @@
<?php
/*
* Command Name: LDC Web Status Checker
* Description: Envoi des infos Serveur/Laravel vers LDC Web
* Version: 1.0
* Author: Vincent BRIDIER
* Author URI: vincent.bridier@ldc.fr
*/
namespace App\Console\Commands;
use Illuminate\Console\Command;
class LDCWebStatusChecker extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ldcweb:statuschecker';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Envoi des infos Serveur/Laravel vers LDC Web';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$data = [];
$data['uuid'] = env('PROJECT_UUID');
// Sitemap.xml ?
if (file_exists(public_path() . '/sitemap.xml')) {
$data['sitemap'] = 'true';
}else{
$data['sitemap'] = 'false';
}
// Robots.txt ?
if (file_exists(public_path() . '/robots.txt')) {
$data['robots'] = 'true';
}else{
$data['robots'] = 'false';
}
//Check logs
$data['logs'] = 0;
$patherror = storage_path('/logs');
$files = glob($patherror.'/laravel-*.log');
if(count($files) > 0){
foreach ($files as $file) {
$data['logs'] = $data['logs'] + filesize($file);
}
}
$data['code']['version'] = app()->version();
// Send by cURL
$url = 'http://ldc-web.test/api/status-checker';
$ch = curl_init($url);
$payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)];
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
}
}

File diff suppressed because one or more lines are too long

View file

@ -254,7 +254,7 @@ header {
& .box {
display: flex;
justify-content: space-around;
background-color: $egg;
/*background-color: $egg;*/
color: $egg_blue;
font-family: MyriadProCond;
font-size: 20px;
@ -475,7 +475,7 @@ header {
font-family: MyriadProItalic;
}
&.disabled {
background-color: #777;
background-color: #777;
}
}
}

View file

@ -13,25 +13,26 @@
<form action="/find-my-box" method="POST">
@csrf
<div class="item">
<label>Date de consommation<br>recommandée (DCR) <span>A</span> :</label>
<input type="text" name="date" placeholder="JJ/MM" pattern="[0-9]{2}/[0-9]{2}" required>
</div>
<div class="item">
<label>Code du producteur <span>B</span> :</label>
<label>Code du producteur <span>A</span> :</label>
<input type="text" name="code" placeholder="Ex. 1FRJBB01" required>
</div>
<div class="item">
<label>Date de consommation<br>recommandée (DCR) <span>B</span> :</label>
<input type="text" name="date" placeholder="JJ/MM" pattern="[0-9]{2}/[0-9]{2}" required>
</div>
<input type="submit" value="Valider">
</form>
</div>
<div class="footer">
<p>Informations sur votre boîte :</p>
<div class="box">
<p>Pondu le<br><span class="date">14/12</span></p>
<img src="/loue/img/oeuf.png" alt="Oeuf" width="70%">
{{--<p>Pondu le<br><span class="date">14/12</span></p>
<p>À cons. de préf. avant le
<br><span class="date">11/01</span><span class="step">A</span>
<br><span class="prod">1FR0PD01</span><span class="step">B</span>
</p>
</p>--}}
</div>
</div>
</div>