{% extends '@CadolesCore/base.html.twig' %} {% block beforepage %}
{% endblock %} {% block pagewrapper %} {%if by is defined %}

{% if by=="acad" %} {% else %} {% endif %} {{byname}} {%if ssby is defined and ssby!="all" %}
{{ssby}} {% endif %}

{% endif %} {%if totalservers is defined %}

Serveurs = {{ totalservers }}

{% endif %} {%if totalapplications is defined %}

Applications = {{ totalapplications }}

{% endif %}
{% if totalbyapplications is defined %} {% if totalbyacademies is defined %}
{%else%}
{%endif%}

Applications Installées

{% endif %} {% if totalbyacademies is defined %} {% if totalbyapplications is defined %}
{%else%}
{%endif%}

Serveurs par Académies

{% endif %}

Serveurs par Module

Serveurs par Version

Serveurs par Secteurs

Serveurs par Natures

{% if by is defined and app.user %} {% for server in servers %} {% for serverapplication in server.serverapplications %} {% if server.etab and ((by=="acad" and (ssby=="all" or ssby==serverapplication.application.name)) or (by=="application" and serverapplication.application.name==byname)) %} {% endif %} {% endfor %} {% endfor %}
UAI Nom Adresse Ville Secteur Nature URL Module Version Application Paquet
{{server.etab.numerouai}} {{server.etab.appellationofficielle}} {{server.etab.adresseuai}} {{server.etab.libellecommune}} {{server.etab.secteurpublicprivelibe}} {{server.etab.natureuailibe}} {{server.url}} {{server.module}} {{server.version}} {{serverapplication.application.name}} {{serverapplication.version}}
{% endif %} {% endblock %} {% block localjavascript %} // On initialise la latitude et la longitude de Paris (centre de la carte) var lat = 48.852969; var lon = 2.349903; var macarte = null; // Fonction d'initialisation de la carte function initMap() { // Créer l'objet "macarte" et l'insèrer dans l'élément HTML qui a l'ID "map" macarte = L.map('mapid').setView([lat, lon], 3); // Leaflet ne récupère pas les cartes (tiles) sur un serveur par défaut. Nous devons lui préciser où nous souhaitons les récupérer. Ici, openstreetmap.fr L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', { // Il est toujours bien de laisser le lien vers la source des données attribution: 'données © OpenStreetMap/ODbL - rendu OSM France', minZoom: 1, maxZoom: 20 }).addTo(macarte); } $(document).ready(function() { initMap(); marker=[]; {% for etab in etabs %} {% if not etab.servers is empty and not etab.latitude is null%} var marker = L.marker([{{ etab.latitude }}, {{ etab.longitude }}]).addTo(macarte); html ="

Etablissement

"; {% if(etab.id!=-100) %} html+="UAI = {{etab.numerouai}}
"; html+="Nom = {{etab.appellationofficielle}}
"; html+="Adresse = {{etab.adresseuai}} {{etab.codecommune}} {{etab.libellecommune}}
"; html+="Académie = {{etab.libelleacademie}}
"; html+="Secteur = {{etab.secteurpublicprivelibe}}
"; html+="Nature = {{etab.natureuailibe}}
"; {% else %} html+="Non Localisé
"; {% endif %} html+="
"; {% for server in etab.servers %} html+="Serveur id = {{ server.id}}
"; {% endfor %} marker.bindPopup(html); {% endif %} {% endfor %} //== byAcademie {% if totalbyacademies is defined %} var byacademie = Morris.Donut({ element: 'byacademie-chart', data: [ {% for total in totalbyacademies %} {'label':'{{ total.label }}','value':{{ total.total }}}, {% endfor %} ], resize: true }); byacademie.options.data.forEach(function(label, i) { {% if byname is defined %} var url = "{{ path("cadoles_core_acad",{"acad":"xx","application":byname}) }}"; {% else %} var url = "{{ path("cadoles_core_acad",{"acad":"xx"}) }}"; {% endif %} var url = url.replace("xx",label['label']); var legendItem = $('').html( ""+label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', byacademie.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '5px'); $('#byacademie-legend').append(legendItem) }); {% endif %} //== byNature var bynature = Morris.Donut({ element: 'bynature-chart', data: [ {% for total in totalbynatures %} {'label':'{{ total.label }}','value':{{ total.total }}}, {% endfor %} ], resize: true }); bynature.options.data.forEach(function(label, i) { var legendItem = $('').html( label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', bynature.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '5px'); $('#bynature-legend').append(legendItem) }); //== bySecteur var bysecteur = Morris.Donut({ element: 'bysecteur-chart', data: [ {% for total in totalbysecteurs %} {'label':'{{ total.label }}','value':{{ total.total }}}, {% endfor %} ], resize: true }); bysecteur.options.data.forEach(function(label, i) { var legendItem = $('').html( label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', bysecteur.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '5px'); $('#bysecteur-legend').append(legendItem) }); //== byModule var bymodule = Morris.Donut({ element: 'bymodule-chart', data: [ {% for total in totalbymodules %} {'label':'{{ total.label }}','value':{{ total.total }}}, {% endfor %} ], resize: true }); bymodule.options.data.forEach(function(label, i) { var legendItem = $('').html( label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', bymodule.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '5px'); $('#bymodule-legend').append(legendItem) }); //== byVersion var byversion = Morris.Donut({ element: 'byversion-chart', data: [ {% for total in totalbyversions %} {'label':'{{ total.label }}','value':{{ total.total }}}, {% endfor %} ], resize: true }); byversion.options.data.forEach(function(label, i) { var legendItem = $('').html( label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', byversion.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '5px'); $('#byversion-legend').append(legendItem) }); //== byApplication {% if totalbyapplications is defined %} var byapplication = Morris.Donut({ element: 'byapplication-chart', data: [ {% for total in totalbyapplications %} { 'label':'{{ total.label }}', 'value':{{ total.total }}, }, {% endfor %} ], resize: true }); byapplication.options.data.forEach(function(label, i) { {% if byname is defined %} var url = "{{ path("cadoles_core_acad",{"acad":byname,"application":"xx"}) }}"; {% else %} var url = "{{ path("cadoles_core_application",{"application":"xx"}) }}"; {% endif %} var url = url.replace("xx",label['label']); var legendItem = $('').html( ""+label['label'] + " ( " +label['value'] + " )" ).prepend(' '); legendItem.find('span') .css('backgroundColor', byapplication.options.colors[i]) .css('width', '20px') .css('display', 'inline-block') .css('margin', '0px 5px 5px 0px'); $('#byapplication-legend').append(legendItem) }); {% endif %} //= Table $('.table').DataTable({ columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ], responsive: true, iDisplayLength: 25, order: [[ 1, "asc" ]], dom: 'Blfrtip', buttons: ['csv'] }); }); function showModal(id) { var url="{{ path('cadoles_core_server',{id:'xx'})}}"; url=url.replace('xx',id); console.log("pouet"); $("#mymodal .modal-title").html("Informations Serveur"); $("#mymodal #framemodal").attr("src",url); $("#mymodal").modal('show'); } {% endblock %}