Changeset 685 for ether_statistics/web


Ignore:
Timestamp:
12/05/12 15:42:48 (11 years ago)
Author:
*
Message:

statistiques, clean, log4j

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/project/statistics-script.jsp

    r668 r685  
    9191    createAllSlides: function() 
    9292    { 
    93         this.leftTopSlide = new DragSlide( {id:"leftTop", parent:this.parent, width:"170", height:"200", top:"140px", left:"53px", 
     93        this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, width:"700", height:"480", top:"150px", left:"38px", 
    9494            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    9595 
    96         this.leftMiddleSlide = new DragSlide( {id:"leftMiddleSlide", parent:this.parent, width:"170", height:"100", top:"355px", left:"53px", 
     96        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"175px", left:"750px", 
    9797            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    98         this.leftMiddleSlide.setTitle( '<spring:message code="statistics.data"/>' ); 
    99  
    100         this.leftBottomSlide = new DragSlide( {id:"leftBottomSlide", parent:this.parent, width:"170", height:"100", top:"470px", left:"53px", 
    101             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    102         this.leftBottomSlide.setTitle( '<spring:message code="statistics.duration"/>' ); 
    103  
    104         this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, width:"430", height:"430", top:"140px", left:"245px", 
    105             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    106  
    107         this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px", 
    108             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    109  
    110         this.rightLoginSlide = new DragSlide( {id:"loginRight", parent:this.parent, width:"200", height:"25", top:"170px", left:"697px", 
    111             specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
     98 
     99        this.loginSlide = new DragSlide( {id:"loginMiddle", parent:this.parent, width:"150", height:"25", top:"115px", left:"39px", 
     100            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", activeDbClick:"None"} ); 
    112101    }, 
    113102 
    114103    createRightSlide: function() 
    115104    { 
    116         this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px", 
     105//        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px", 
     106//            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
     107        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"175px", left:"750px", 
    117108            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    118109    }, 
     
    168159    handleDataByLogo: function( result ) 
    169160    { 
    170         this.changeLeftTopSlide(); 
    171         this.changeLeftMiddleSlide(); 
    172         this.changeLeftBottomSlide(); 
    173         this.displayVisitEvolution(); 
     161        this.displaySummary(); 
    174162    }, 
    175163 
     
    187175        $( "#login" ).animate( { 
    188176            top:'47px', 
    189             left:'126px' 
     177            left:'577px' 
    190178        }, 2000, function() 
    191179        { 
     
    214202            // User 
    215203            if( this.jSONUser.name ) 
    216                 this.rightLoginSlide.setTitle( this.jSONUser.name ); 
     204                this.loginSlide.setTitle( this.jSONUser.name ); 
    217205            else 
    218                 this.rightLoginSlide.setTitle( '<spring:message code="label.unknown"/>' ); 
     206                this.loginSlide.setTitle( '<spring:message code="label.unknown"/>' ); 
    219207            $( "#logout_button" ).css( "visibility", "visible" ); 
     208 
     209            // Awstats button 
     210            if( "ADMINISTRATOR" == this.jSONUser.role ) 
     211            { 
     212                this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"120", height:"25", top:"114px", left:"197px", 
     213                    specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", 
     214                    title:'<spring:message code="label.awstats"/>&nbsp;&nbsp;', activeDbClick:"None"} ); 
     215                this.awstatsSlide.getDivContainer().dblclick( jQuery.proxy( this.displayAwstatsStatistics, this ) ); 
     216            } 
    220217 
    221218            // Logo 
     
    330327        var printContent = new PrintContent(); 
    331328        printContent.addContent( $( "#title" ).clone() ); 
    332         printContent.addContent( this.leftTopSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
    333         printContent.addContent( this.leftMiddleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
    334         printContent.addContent( this.leftBottomSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
    335329        printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=120px"} ) ); 
    336330        printContent.displayPrintPreview(); 
     
    456450    }, 
    457451 
    458     changeLeftTopSlide: function() 
    459     { 
    460         this.leftTopSlide.setTitle( '<spring:message code="title"/> : ' + this.selectedLogo.id ); 
    461         this.leftTopSlide.setContent( 
    462                 "<spring:message code="statistics.online"/> : 2006/05/08<BR/>" + 
    463                         "<span class='text1'><spring:message code="statistics.since"/> : 2009/05/08<BR/><BR/></span>" + 
    464                         "<spring:message code="statistics.user.registered"/> : 1500<BR/>" + 
    465                         "<spring:message code="statistics.visit"/> : 150<BR/>" ); 
    466     }, 
    467  
    468     changeLeftMiddleSlide: function() 
    469     { 
    470         this.leftMiddleSlide.setContent( "<spring:message code="statistics.data.download"/> : 15001<BR/><spring:message code="statistics.data.download.size"/> : 50To<BR/>" ); 
    471     }, 
    472  
    473     changeLeftBottomSlide: function() 
    474     { 
    475         this.leftBottomSlide.setContent( "<spring:message code="statistics.duration.total"/> : 15001''<BR/><spring:message code="statistics.duration.average"/> : 50''<BR/>" ); 
    476     }, 
    477  
    478452    changeRightSlide: function() 
    479453    { 
    480454        this.rightSlide.setTitle( '<spring:message code="label.actions"/>' ); 
    481455        this.rightSlide.getDivContent().empty(); 
    482         new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitEvolution, this )} ); 
    483         new Button( {value:"<spring:message code="statistics.user.registered"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayRegisteredUserEvolution, this )} ); 
    484         new Button( {value:"<spring:message code="statistics.user.connected"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayConnectedUserEvolution, this )} ); 
    485         new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownloadEvolution, this )} ); 
    486         new Button( {value:"<spring:message code="statistics.map.distribution"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMapDistribution, this )} ); 
     456        new Button( {value:"<spring:message code="statistics.summary"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displaySummary, this )} ); 
     457        new Button( {value:"<spring:message code="statistics.monthly"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMonthly, this )} ); 
     458        new Button( {value:"<spring:message code="statistics.daily"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaily, this )} ); 
     459        new Button( {value:"<spring:message code="statistics.daysofweek"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDaysOfWeek, this )} ); 
     460        new Button( {value:"<spring:message code="statistics.hours"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayHours, this )} ); 
     461        new Button( {value:"<spring:message code="statistics.visit.duration"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitDuration, this )} ); 
     462 
     463        new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisit, this )} ); 
     464        new Button( {value:"<spring:message code="statistics.domain"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDomainCountry, this )} ); 
     465        new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownload, this )} ); 
     466 
    487467        new Button( {value:"<spring:message code="label.print"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button print-preview", onClick:jQuery.proxy( this.onClickPrint, this )} ); 
    488468    }, 
    489469 
    490     changeMiddleSlide: function( titleEvolution, titleDistribution ) 
    491     { 
    492         if( this.isSelectedLogoEther ) 
    493             this.middleSlide.setTitle( '<spring:message code="statistics.evolution.distribution"/> : ' + this.selectedLogo.id ); 
    494         else 
    495             this.middleSlide.setTitle( '<spring:message code="statistics.evolution"/> : ' + this.selectedLogo.id ); 
     470    changeMiddleSlide: function( title, url ) 
     471    { 
     472        this.middleSlide.setTitle( this.selectedLogo.id + ' : ' + title ); 
    496473        this.middleSlide.getDivContent().empty(); 
    497474 
    498         var linechart = $( document.createElement( "div" ) ); 
    499         linechart.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
    500         linechart.attr( {id:"wijlinechart"} ); 
    501         this.middleSlide.getDivContent().append( linechart ); 
    502  
    503         var donut = $( document.createElement( "div" ) ); 
    504         donut.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
    505         donut.attr( {id:"wijpiechart"} ); 
    506         this.middleSlide.getDivContent().append( donut ); 
    507  
    508         this.createLinechart( titleEvolution ); 
    509         if( this.isSelectedLogoEther ) 
    510             this.createDonut( titleDistribution ); 
    511     }, 
    512  
    513     changeMiddleSlideForMap: function() 
    514     { 
    515         this.middleSlide.setTitle( '<spring:message code="statistics.map.distribution"/> : ' + this.selectedLogo.id ); 
    516         this.middleSlide.getDivContent().empty(); 
     475        this.middleSlide.getDivContent().load( url + this.selectedLogo.id ); 
    517476    }, 
    518477 
    519478 
    520479    // STATISTICS ******************************************************** 
    521     createDonut: function( title ) 
    522     { 
    523         $( "#wijpiechart" ).wijpiechart( { 
    524             height: 210, 
    525             width: 400, 
    526             radius: 140, 
    527             legend: { visible: true }, 
    528             hint: { 
    529                 content: function () 
    530                 { 
    531                     return this.data.label + " : " + Globalize.format( this.value / this.total, "p2" ); 
    532                 } 
    533             }, 
    534             header: { 
    535                 text: title 
    536             }, 
    537             seriesList: [ 
    538                 { 
    539                     label: "MacBook Pro", 
    540                     legendEntry: true, 
    541                     data: 46.78, 
    542                     offset: 0 
    543                 }, 
    544                 { 
    545                     label: "iMac", 
    546                     legendEntry: true, 
    547                     data: 23.18, 
    548                     offset: 0 
    549                 }, 
    550                 { 
    551                     label: "MacBook", 
    552                     legendEntry: true, 
    553                     data: 20.25, 
    554                     offset: 0 
    555                 }, 
    556                 { 
    557                     label: "Mac Pro", 
    558                     legendEntry: true, 
    559                     data: 5.41, 
    560                     offset: 0 
    561                 }, 
    562                 { 
    563                     label: "Mac mini", 
    564                     legendEntry: true, 
    565                     data: 3.44, 
    566                     offset: 0 
    567                 } 
    568             ], 
    569             seriesStyles: [ 
    570                 { 
    571                     fill: "180-rgb(195,255,0)-rgb(175,229,0)", stroke: "rgb(175,229,0)", "stroke-width": 1.5 
    572                 }, 
    573                 { 
    574                     fill: "90-rgb(142,222,67)-rgb(127,199,60)", stroke: "rgb(127,199,60)", "stroke-width": 1.5 
    575                 }, 
    576                 { 
    577                     fill: "90-rgb(106,171,167)-rgb(95,153,150)", stroke: "rgb(95,153,150)", "stroke-width": 1.5 
    578                 }, 
    579                 { 
    580                     fill: "90-rgb(70,106,133)-rgb(62,95,119)", stroke: "rgb(62,95,119)", "stroke-width": 1.5 
    581                 }, 
    582                 { 
    583                     fill: "90-rgb(166,166,166)-rgb(149,149,149)", stroke: "rgb(149,149,149)", "stroke-width": 1.5 
    584                 } 
    585             ] 
    586         } ); 
    587     }, 
    588  
    589     createLinechart: function( title ) 
    590     { 
    591         $( "#wijlinechart" ).wijlinechart( { 
    592             height: 200, 
    593             width: 400, 
    594             axis: { 
    595                 y: { 
    596                     origin: 0 
    597                 } 
    598             }, 
    599             showChartLabels: false, 
    600             header: { 
    601                 text: title 
    602             }, 
    603             hint: { 
    604                 content: function () 
    605                 { 
    606                     return this.data.lineSeries.label + '\n' + this.x + '\n' + this.y + ''; 
    607                 }, 
    608                 contentStyle: { "font-size": 10 }, 
    609                 offsetY: -10 
    610             }, 
    611             legend: { 
    612                 visible: false 
    613             }, 
    614             seriesList: [ 
    615                 { 
    616                     label: "", 
    617                     legendEntry: true, 
    618                     data: { 
    619                         x: this.xArray, 
    620                         y: this.yArray 
    621                     }, 
    622                     markers: { 
    623                         visible: true, 
    624                         type: "circle" 
    625                     } 
    626                 } 
    627             ] 
    628         } ); 
    629     }, 
    630  
    631     displayVisitEvolution: function() 
    632     { 
    633         this.changeMiddleSlide( '<spring:message code="statistics.evolution.visit"/>', '<spring:message code="statistics.distribution.visit"/>' ); 
    634     }, 
    635  
    636     displayRegisteredUserEvolution: function() 
    637     { 
    638         this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.registered"/>', '<spring:message code="statistics.distribution.user.registered"/>' ); 
    639     }, 
    640  
    641     displayConnectedUserEvolution: function() 
    642     { 
    643         this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.connected"/>', '<spring:message code="statistics.distribution.user.connected"/>' ); 
    644     }, 
    645  
    646     displayDownloadEvolution: function() 
    647     { 
    648         this.changeMiddleSlide( '<spring:message code="statistics.evolution.download"/>', '<spring:message code="statistics.distribution.download"/>' ); 
    649     }, 
    650  
    651     displayMapDistribution: function() 
    652     { 
    653         this.changeMiddleSlideForMap(); 
     480    displaySummary: function() 
     481    { 
     482        this.changeMiddleSlide( '<spring:message code="statistics.summary"/>', <%=WebHelper.getProperty(request, "url.summary")%> ); 
     483    }, 
     484 
     485    displayMonthly: function() 
     486    { 
     487        this.changeMiddleSlide( '<spring:message code="statistics.monthly"/>', <%=WebHelper.getProperty(request, "url.monthly")%> ); 
     488    }, 
     489 
     490    displayDaily: function() 
     491    { 
     492        this.changeMiddleSlide( '<spring:message code="statistics.daily"/>', <%=WebHelper.getProperty(request, "url.daily")%> ); 
     493    }, 
     494 
     495    displayDaysOfWeek: function() 
     496    { 
     497        this.changeMiddleSlide( '<spring:message code="statistics.daysofweek"/>', <%=WebHelper.getProperty(request, "url.daysofweek")%> ); 
     498    }, 
     499 
     500    displayHours: function() 
     501    { 
     502        this.changeMiddleSlide( '<spring:message code="statistics.hours"/>', <%=WebHelper.getProperty(request, "url.hours")%> ); 
     503    }, 
     504 
     505    displayVisitDuration: function() 
     506    { 
     507        this.changeMiddleSlide( '<spring:message code="statistics.visit.duration"/>', <%=WebHelper.getProperty(request, "url.sessions")%> ); 
     508    }, 
     509 
     510    displayVisit: function() 
     511    { 
     512        this.changeMiddleSlide( '<spring:message code="statistics.visit"/>', <%=WebHelper.getProperty(request, "url.visited.pages")%> ); 
     513    }, 
     514 
     515    displayDomainCountry: function() 
     516    { 
     517        this.changeMiddleSlide( '<spring:message code="statistics.domain"/>', <%=WebHelper.getProperty(request, "url.domains")%> ); 
     518    }, 
     519 
     520    displayDownload: function() 
     521    { 
     522        this.changeMiddleSlide( '<spring:message code="statistics.data.download"/>', <%=WebHelper.getProperty(request, "url.downloads")%> ); 
     523    }, 
     524 
     525    displayAwstatsStatistics: function() 
     526    { 
     527        window.open( "http://www.pole-ether.fr/cgi-bin/awstats/awstats.pl?config=" + this.selectedLogo.id ); 
    654528    } 
    655529 
Note: See TracChangeset for help on using the changeset viewer.