diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/courbe_oms_gf_1an.png | bin | 0 -> 107909 bytes | |||
-rw-r--r-- | static/courbe_oms_gf_5ans.png | bin | 0 -> 107527 bytes | |||
-rw-r--r-- | static/requetes.js | 31 | ||||
-rw-r--r-- | static/style.css | 4 |
4 files changed, 28 insertions, 7 deletions
diff --git a/static/courbe_oms_gf_1an.png b/static/courbe_oms_gf_1an.png new file mode 100644 index 0000000..49a5d3e --- /dev/null +++ b/static/courbe_oms_gf_1an.png | |||
Binary files differ | |||
diff --git a/static/courbe_oms_gf_5ans.png b/static/courbe_oms_gf_5ans.png new file mode 100644 index 0000000..61c2d28 --- /dev/null +++ b/static/courbe_oms_gf_5ans.png | |||
Binary files differ | |||
diff --git a/static/requetes.js b/static/requetes.js index 9da579c..072e880 100644 --- a/static/requetes.js +++ b/static/requetes.js | |||
@@ -10,22 +10,39 @@ function appelle_image() | |||
10 | { | 10 | { |
11 | if (this.readyState == 4 && this.status == 200) { | 11 | if (this.readyState == 4 && this.status == 200) { |
12 | // on récupère les différents champs de la réponse | 12 | // on récupère les différents champs de la réponse |
13 | var result = this.response.result ; | ||
13 | var image = this.response.image ; | 14 | var image = this.response.image ; |
14 | var liste_warnings = this.response.messages | 15 | var liste_warnings = this.response.messages |
15 | var texte = this.response.export_txt; | 16 | var texte = this.response.export_txt; |
16 | // On affiche l'image | ||
17 | document.getElementById('courbe').src = 'data:image/png;base64,'+(image); | ||
18 | document.getElementById('sectioncourbe').style.display = "block"; | ||
19 | |||
20 | // on affiche l'export des données | 17 | // on affiche l'export des données |
21 | document.getElementById('export').innerHTML = texte; | 18 | document.getElementById('export').innerHTML = texte; |
22 | document.getElementById('sectionexport').style.display = "block"; | 19 | document.getElementById('sectionexport').style.display = "block"; |
23 | 20 | ||
24 | // Si y'a eu des warnings, faut les afficher | 21 | if(result == "success") |
25 | if(liste_warnings.length != 0) | ||
26 | { | 22 | { |
23 | // On affiche l'image | ||
24 | document.getElementById('courbe').src = 'data:image/png;base64,'+(image); | ||
25 | document.getElementById('sectioncourbe').style.display = "block"; | ||
26 | |||
27 | |||
28 | // Si y'a eu des warnings, faut les afficher | ||
29 | if(liste_warnings.length != 0) | ||
30 | { | ||
31 | // afficher la liste des warnings | ||
32 | var elem_div = document.getElementById('courbe_warnings') ; | ||
33 | elem_div.style.display = "block" ; | ||
34 | var ul = elem_div.children[1] ; | ||
35 | for(i=0; i<liste_warnings.length; i++) { | ||
36 | var li = document.createElement("li"); | ||
37 | li.appendChild(document.createTextNode(liste_warnings[i])); | ||
38 | ul.appendChild(li); | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | else{ // si la génération de l'image a merdé | ||
43 | |||
27 | // afficher la liste des warnings | 44 | // afficher la liste des warnings |
28 | var elem_div = document.getElementById('courbe_warnings') ; | 45 | var elem_div = document.getElementById('courbe_erreurs') ; |
29 | elem_div.style.display = "block" ; | 46 | elem_div.style.display = "block" ; |
30 | var ul = elem_div.children[1] ; | 47 | var ul = elem_div.children[1] ; |
31 | for(i=0; i<liste_warnings.length; i++) { | 48 | for(i=0; i<liste_warnings.length; i++) { |
diff --git a/static/style.css b/static/style.css index 3216d34..3113832 100644 --- a/static/style.css +++ b/static/style.css | |||
@@ -18,3 +18,7 @@ body { | |||
18 | #courbe_warnings { | 18 | #courbe_warnings { |
19 | display: none; | 19 | display: none; |
20 | } | 20 | } |
21 | |||
22 | #courbe_erreurs { | ||
23 | display: none; | ||
24 | } | ||