_call_results.html.erb - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
 (HTM) git clone git://jay.scot/warvox
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       _call_results.html.erb (1438B)
       ---
            1 <%
            2 
            3 graph_id = "g" + rand(0x1000000).to_s
            4 line_data = raw("")
            5 
            6 line_data << raw("{ name: 'Timeout', data: [ #{@call_results[:Timeout].to_i.to_s } ] }, ")
            7 line_data << raw("{ name: 'Busy', data: [ #{@call_results[:Busy].to_i.to_s } ] }, ")
            8 line_data << raw("{ name: 'Answered', data: [ #{@call_results[:Answered].to_i.to_s } ] }, ")
            9 
           10 %>
           11 
           12 <div id="<%= graph_id %>"></div>
           13 
           14 <%= javascript_tag do %>
           15     $(document).ready(function() {
           16           chart = new Highcharts.Chart({
           17             chart: {
           18                 renderTo: '<%= graph_id %>',
           19                 type: 'bar',
           20                 height: 150
           21             },
           22             title: {
           23                 text: 'Call Results'
           24             },
           25             xAxis: {
           26                 categories: ['Calls']
           27             },
           28             yAxis: {
           29                 min: 0,
           30                 title: {
           31                     text: 'Calls by Result'
           32                 }
           33             },
           34             legend: {
           35                 backgroundColor: '#FFFFFF',
           36                 reversed: true
           37             },
           38             tooltip: {
           39                 formatter: function() {
           40                     return ''+
           41                         this.series.name +': '+ this.y +'';
           42                 }
           43             },
           44             plotOptions: {
           45                 series: {
           46                     stacking: 'normal',
           47                     animation : false
           48                 }
           49             },
           50             series: [ <%= line_data %> ]
           51         });
           52     });
           53 <% end %>