URI: 
       index.html.erb - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
  HTML git clone git://jay.scot/warvox
   DIR Log
   DIR Files
   DIR Refs
   DIR README
       ---
       index.html.erb (3802B)
       ---
            1 <% if @submitted_jobs.length > 0 %>
            2 
            3 <h1 class='title'>Submitted Jobs</h1>
            4 
            5 <table class='table table-striped table-condensed' width='90%'>
            6   <tr>
            7     <th>ID</th>
            8     <th>Task</th>
            9     <th>Status</th>
           10     <th>Launched</th>
           11     <th>Actions</th>
           12     <th>Project</th>
           13   </tr>
           14 
           15 <% @submitted_jobs.each do |job| %>
           16   <tr>
           17     <td><%= job.id %></td>
           18     <td><%= format_job_details(job) %></td>
           19         <td><%= format_job_status(job) %></td>
           20     <td><%= time_ago_in_words(job.created_at) %> ago</td>
           21 
           22     <td>
           23                 <a class="btn" href="<%= job_path(job) %>" data-confirm="Remove this job?" data-method="delete" rel="nofollow tooltip" title="Remove Job"><i class="fa fa-remove"></i></a>
           24         </td>
           25     <td><%= link_to( h(truncate(job.project.name, :length => 25)), project_path(job.project)) %></td>
           26   </tr>
           27 <% end %>
           28 </table>
           29 <br />
           30 <% end %>
           31 
           32 <% if(@active_jobs.length > 0) %>
           33 
           34 <h1 class='title'>Active Jobs</h1>
           35 
           36 <table class='table table-striped table-condensed' width='90%'>
           37   <tr>
           38     <th>ID</th>
           39     <th>Task</th>
           40     <th>Progress</th>
           41     <th>Rate</th>
           42     <th>Launched</th>
           43     <th>Actions</th>
           44     <th>Project</th>
           45   </tr>
           46 
           47 <% @active_jobs.each do |job| %>
           48   <tr class='active_job_row'>
           49     <td><%= job.id %></td>
           50     <td><%= format_job_details(job) %></td>
           51     <td>
           52                 <div class="progress progress-warning progress-striped progress-bar">
           53                         <div class="bar" style="width: <%= job.progress %>%">
           54                                 <span class='progress_pct'><%= job.progress %>%</span>
           55                         </div>
           56                 </div>
           57         </td>
           58         <td><%= format_job_rate(job) %></td>
           59     <td><%= time_ago_in_words(job.created_at) %> ago</td>
           60     <td>
           61             <% if job.task == "dialer" %>
           62                     <a class="btn" href="<%= view_results_path(job.project,job) %>" rel="tooltip" title="View Current Stats" ><i class="fa fa-eye"></i></a>
           63             <% end %>
           64             <% if job.task == "analysis" and job.details[:scope].to_s != "calls" %>
           65                     <a class="btn" href="<%= view_analyze_path(job.project,job.details[:target_id]) %>" rel="tooltip" title="View Call Analysis"><i class="fa fa-pie-chart"></i></a>
           66             <% end %>
           67                 <a class="btn" href="<%= stop_job_path(job) %>" data-confirm="Terminate this job?" rel="nofollow tooltip" title="Terminate Job"><i class="fa fa-stop"></i></a>
           68         </td>
           69     <td><%= link_to( h(truncate(job.project.name, :length => 25)), project_path(job.project)) %></td>
           70   </tr>
           71 <% end %>
           72 </table>
           73 <br />
           74 
           75 <% end %>
           76 
           77 <% if (@active_jobs.length + @submitted_jobs.length == 0) %>
           78 <h1 class='title'>No Active Jobs</h1>
           79 <% end %>
           80 
           81 <a class="btn" href="<%= new_dialer_job_path %>"><i class="fa fa-phone"></i> <strong>Wardial</strong></a>
           82 
           83 <% if(@inactive_jobs.length > 0) %>
           84 <br/><br/>
           85 <h1 class='title'>Inactive Jobs</h1>
           86 
           87 <%= will_paginate @inactive_jobs, :renderer => BootstrapPagination::Rails %>
           88 <table class='table table-striped table-condensed' width='90%'>
           89   <tr>
           90     <th>ID</th>
           91     <th>Task</th>
           92     <th>Status</th>
           93     <th>Rate</th>
           94     <th>Created</th>
           95     <th>Completed</th>
           96     <th>Project</th>
           97   </tr>
           98 
           99 <% @inactive_jobs.each do |job|
          100         special = ""
          101         case job.status
          102         when "error"
          103                 special = "error"
          104         when "stopped"
          105                 special = "warning"
          106         end
          107 %>
          108   <tr class='<%= special %>'>
          109     <td><%= job.id %></td>
          110     <td><%= format_job_details(job) %></td>
          111         <td><%= format_job_status(job) %></td>
          112         <td><%= format_job_rate(job) %></td>
          113     <td><%= time_ago_in_words(job.created_at) %> ago</td>
          114     <td><%= job.completed_at ? "after " + time_ago_in_words(Time.at(Time.now.to_i - (job.completed_at.to_f - job.created_at.to_f))) : "incomplete" %></td>
          115     <td><%= link_to( h(truncate(job.project.name, :length => 25)), project_path(job.project)) %></td>
          116   </tr>
          117 <% end %>
          118 </table>
          119 <%= will_paginate @inactive_jobs, :renderer => BootstrapPagination::Rails %>
          120 <br />
          121 
          122 <script language="javascript">
          123         setTimeout("location.reload(true);", <%= @reload_interval %>);
          124 </script>
          125 
          126 <% end %>