Commit 566559d4912951eea016f6bdd0890d9de65178b5
Merge branch 'master' of https://archives.plil.fr/grouille/IMA3_P10
Showing
3 changed files
with
18 additions
and
20 deletions
Show diff stats
site/reception.php
... | ... | @@ -46,31 +46,29 @@ if(isset($_POST['sensor'])) |
46 | 46 | |
47 | 47 | if(!$err) |
48 | 48 | { |
49 | - if(file_put_contents('upload/inventaire.ini', $ini)!=NULL) | |
50 | - { | |
51 | - $upload = load($_FILES['fichier']['tmp_name'], $_FILES['fichier']['name']); | |
52 | - if($upload) | |
49 | + file_put_contents('upload/inventaire.ini', $ini); | |
50 | + $upload = load($_FILES['fichier']['tmp_name'], $_FILES['fichier']['name']); | |
51 | + if($upload) | |
52 | + { | |
53 | + $message = "Upload du fichier réussi !"; | |
54 | + $color = "alert-success"; | |
55 | + $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; | |
56 | + if(shell_exec($cmd)==NULL) | |
53 | 57 | { |
54 | - $message = "Upload du fichier réussi !"; | |
55 | - $color = "alert-success"; | |
56 | - $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; | |
57 | - /*if(shell_exec($cmd)==NULL) | |
58 | - { | |
59 | - // gestion de l'erreur | |
60 | - $message = $message." Ansible est lancé !"; | |
61 | - } | |
62 | - else | |
63 | - { | |
64 | - $message = $message." Echec du lancement d'Ansible !"; | |
65 | - $color = "alert-danger"; | |
66 | - }*/ | |
58 | + // gestion de l'erreur | |
59 | + $message = $message." Ansible est lancé !"; | |
67 | 60 | } |
68 | 61 | else |
69 | 62 | { |
70 | - $message = "Erreur lors du transfert du fichier..."; | |
63 | + $message = $message." Echec du lancement d'Ansible !"; | |
71 | 64 | $color = "alert-danger"; |
72 | 65 | } |
73 | 66 | } |
67 | + else | |
68 | + { | |
69 | + $message = "Erreur lors du transfert du fichier..."; | |
70 | + $color = "alert-danger"; | |
71 | + } | |
74 | 72 | } |
75 | 73 | else |
76 | 74 | { | ... | ... |
site/reponse.php
site/tableau.php
1 | 1 | <div class="row"> |
2 | 2 | <div class="col-4 col-md-4 offset-4 offset-md-4"> |
3 | - <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1> | |
3 | + <h1 style="margin-bottom:20px; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1> | |
4 | 4 | <table class="table table-striped table-bordered"> |
5 | 5 | <tbody> |
6 | 6 | <tr> | ... | ... |