More updates - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 4128340993deb6db8c6af78b4e26d68a89b4349c
(DIR) parent d673045b330dc7019a2345aaa7677f1a63d8d4cc
(HTM) Author: HD Moore <hd_moore@rapid7.com>
Date: Thu, 3 Jan 2013 00:50:11 -0600
More updates
Diffstat:
M app/assets/stylesheets/bootstrap_a… | 4 ++++
M app/controllers/jobs_controller.rb | 13 ++++++++++---
M app/helpers/application_helper.rb | 4 ++--
M app/views/analyze/index.html.erb | 54 +------------------------------
D app/views/calls/view.html.erb | 58 ------------------------------
M app/views/jobs/index.html.erb | 8 ++++----
M app/views/jobs/results.html.erb | 47 ++++++++++++++++++++++---------
7 files changed, 55 insertions(+), 133 deletions(-)
---
(DIR) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -39,6 +39,10 @@ body {
@navbarBackgroundHighlight: #4A1C04;
+.stooltip {
+ border-bottom: 1px dotted @blue;
+}
+
.progress_pct {
color: @darkGray;
margin-left: 10px;
(DIR) diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb
@@ -30,12 +30,19 @@ class JobsController < ApplicationController
end
def view_results
- @job = Job.find(params[:id])
- @calls = @job.calls.paginate(
+ @job = Job.find(params[:id])
+ @results = @job.calls.paginate(
:page => params[:page],
- :order => 'id DESC',
+ :order => 'number ASC',
:per_page => 30
)
+
+ @call_results = {
+ :Timeout => @job.calls.count(:conditions => { :answered => false }),
+ :Busy => @job.calls.count(:conditions => { :busy => true }),
+ :Answered => @job.calls.count(:conditions => { :answered => true }),
+ }
+
end
def new_dialer
(DIR) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
@@ -32,7 +32,7 @@ module ApplicationHelper
ttip << raw("<div class='task_args_val'>") + h(v.to_s) + raw(" </div>")
end
ttip << raw("</div>\n")
- outp = raw("<a href='#' rel='tooltip' title=\"#{ttip}\" data-html='true'>#{h job.task.capitalize}</a>")
+ outp = raw("<span rel='tooltip' title=\"#{ttip}\" data-html='true' class='stooltip'>#{h job.task.capitalize}</span>")
outp
rescue ::Exception => e
job.status.to_s.capitalize
@@ -43,7 +43,7 @@ module ApplicationHelper
case job.status
when 'error'
ttip = h(job.error.to_s)
- outp = raw("<a href='#' rel='tooltip' title=\"#{ttip}\" data-html='true'>#{h job.status.capitalize}</a>")
+ outp = raw("<span rel='tooltip' title=\"#{ttip}\" data-html='true' class='stooltip'>#{h job.status.capitalize}</span>")
outp
else
job.status.to_s.capitalize
(DIR) diff --git a/app/views/analyze/index.html.erb b/app/views/analyze/index.html.erb
@@ -1,53 +1 @@
-<% if @jobs.length > 0 %>
-<h1 class='title'>Analyzed Jobs</h1>
-
-<%= raw(will_paginate @jobs) %>
-<table class='table table-striped table-bordered' width='90%'>
- <thead>
- <tr>
- <th>ID</th>
- <th>Range</th>
- <th>CallerID</th>
- <th>Connected</th>
- <th>Date</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
-
-<% @jobs.sort{|a,b| b.id <=> a.id}.each do |job| %>
- <tr>
- <td><%=h job.id %></td>
- <td><%=h job.range %></td>
- <td><%=h job.cid_mask %></td>
- <td><%=h (
- job.calls.where("analysis_completed_at IS NOT NULL").count.to_s +
- "/" +
- job.calls.count.to_s
- )%></td>
- <td><%=h job.started_at.localtime.strftime("%Y-%m-%d %H:%M:%S") %></td>
-
- <td>
-
- <% if job.calls.where("analysis_completed_at IS NOT NULL").count > 0 %>
- <a class="btn btn-mini" href="<%= analyze_call_path(job) %>"><i class="icon-eye-open"></i></a>
- <a class="btn btn-mini" href="<%= reanalyze_call_path(job) %>" data-confirm="Reprocess this job?" rel="nofollow"><i class="icon-refresh"></i></a>
- <% else %>
- <a class="btn btn-mini" href="<%= analyze_call_path(job) %>"><i class="icon-bolt"></i></a>
- <% end %>
-
- <a class="btn btn-mini" href="<%= call_path(job) %>" data-confirm="Delete all data for this job?" data-method="delete" rel="nofollow"><i class="icon-trash"></i></a>
- </td>
- </tr>
-
-<% end %>
-</tbody>
-</table>
-
-<%= raw(will_paginate @jobs) %>
-
-<% else %>
-
-<h1 class='title'>No Analyzed Jobs</h1>
-
-<% end %>
+<h1 class='title'>Analysis</h1>
(DIR) diff --git a/app/views/calls/view.html.erb b/app/views/calls/view.html.erb
@@ -1,58 +0,0 @@
-<% if @calls %>
-
-
-<h1 class='title'>Dial Results for Job <%=@calls[0].job_id%></h1>
-
-<%= raw(will_paginate @calls) %>
-<table width='100%' align='center' border=0 cellspacing=0 cellpadding=6>
-<tr>
- <td align='center'>
- <%= render :partial => 'shared/graphs/call_results' %>
- </td>
-</tr>
-</table>
-
-<br/>
-
-<table class='table table-striped table-bordered' width='90%' id='results'>
- <thead>
- <tr>
- <th>Number</th>
- <th>CallerID</th>
- <th>Provider</th>
- <th>Completed</th>
- <th>Busy</th>
- <th>Seconds</th>
- <th>Ring Time</th>
- </tr>
- </thead>
- <tbody>
-<% for call in @calls.sort{|a,b| a.number <=> b.number } %>
- <tr>
- <td><%= call.number %></td>
- <td><%= call.cid %></td>
- <td><%= call.provider.name %></td>
- <td><%= call.completed %></td>
- <td><%= call.busy %></td>
- <td><%= call.seconds %></td>
- <td><%= call.ringtime.to_i %></td>
- </tr>
-<% end %>
- </tbody>
-</table>
-<%= raw(will_paginate @calls) %>
-
-<% else %>
-
-<h1 class='title'>No Dial Results</h1>
-
-<% end %>
-<br />
-
-<%= javascript_tag do %>
-// For fixed width containers
-$('#results').dataTable({
- "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
- "sPaginationType": "bootstrap"
-});
-<% end %>
(DIR) diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb
@@ -2,7 +2,7 @@
<h1 class='title'>Submitted Jobs</h1>
-<table class='table table-striped table-bordered' width='90%'>
+<table class='table table-striped table-condensed' width='90%'>
<tr>
<th>ID</th>
<th>Task</th>
@@ -31,7 +31,7 @@
<h1 class='title'>Active Jobs</h1>
-<table class='table table-striped table-bordered' width='90%'>
+<table class='table table-striped table-condensed' width='90%'>
<tr>
<th>ID</th>
<th>Task</th>
@@ -66,14 +66,14 @@
<h1 class='title'>No Active Jobs</h1>
<% end %>
-<a class="btn" href="<%= new_dialer_job_path %>"><i class="icon-plus"></i> Start Job </a>
+<a class="btn" href="<%= new_dialer_job_path %>"><i class="icon-plus"></i> New Scan </a>
<% if(@inactive_jobs.length > 0) %>
<br/><br/>
<h1 class='title'>Inactive Jobs</h1>
<%= raw(will_paginate @inactive_jobs) %>
-<table class='table table-striped table-bordered' width='90%'>
+<table class='table table-striped table-condensed' width='90%'>
<tr>
<th>ID</th>
<th>Task</th>
(DIR) diff --git a/app/views/jobs/results.html.erb b/app/views/jobs/results.html.erb
@@ -1,15 +1,16 @@
<% if @jobs.length > 0 %>
-<h1 class='title'>Completed Jobs</h1>
+<h1 class='title'>Scan Results</h1>
<%= will_paginate @jobs, :renderer => BootstrapPagination::Rails %>
-<table class='table table-striped table-bordered' width='90%'>
+<table class='table table-striped table-condensed' width='90%'>
<thead>
<tr>
<th>ID</th>
- <th>Range</th>
- <th>CallerID</th>
- <th>Connected</th>
- <th>Date</th>
+ <th>Type</th>
+ <th>Details</th>
+ <th>Answered</th>
+ <th>Analyzed</th>
+ <th>Launched</th>
<th>User</th>
<th>Actions</th>
</tr>
@@ -20,26 +21,46 @@
cnt_dialed = job.calls.count.to_i
cnt_answered = job.calls.where("answered = ? and busy = ?", true, false).count.to_i
+ cnt_analyzed = job.calls.where("analysis_completed_at IS NOT NULL").count.to_i
pct_answered = 0
+ pct_analyzed = 0
unless cnt_dialed == 0
pct_answered = ((cnt_answered.to_f / cnt_dialed.to_f) * 100).to_i
end
+ unless cnt_answered == 0
+ pct_analyzed = ((cnt_analyzed.to_f / cnt_answered.to_f) * 100).to_i
+ end
%>
<tr>
<td><%= job.id %></td>
- <td><%= job.details[:range].to_s %></td>
- <td><%= job.details[:cid_mask].to_s %></td>
- <td><span rel="tooltip" title="<%= pct_answered %>% answered"><%= cnt_answered %> / <%= cnt_dialed %></span></td>
+ <td><%= format_job_details(job) %></td>
+ <td>
+ <% if job.task == "dialer" %>
+ <%= job.details[:range].to_s %> /
+ <%= job.details[:cid_mask].to_s %>
+ <% end %>
+ <span rel="tooltip" class="stooltip" title="<%= job.details[:directory].to_s %>">
+ <%= truncate(job.details[:directory].to_s, :length => 15) %>
+ <% if job.task == "importer" %>
+
+ <% end %>
+ </td>
+ <td><span rel="tooltip" class="stooltip" title="<%= pct_answered %>% answered"><%= cnt_answered %> / <%= cnt_dialed %></span></td>
+ <td><span rel="tooltip" class="stooltip" title="<%= pct_analyzed %>% analyzed"><%= cnt_analyzed%></span></td>
- <td><%= job.created_at.strftime("%Y-%m-%d %H:%M:%s") %></td>
+ <td><%= job.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
<td><%= job.created_by %></td>
<td>
<a class="btn btn-mini" href="<%= view_results_path(@project,job) %>" rel="tooltip" title="View Call Connections" ><i class="icon-zoom-in"></i></a>
- <% if job.calls.where("analysis_completed_at IS NOT NULL").count > 0 %>
+ <% if cnt_analyzed > 0 %>
<a class="btn btn-mini" href="<%= view_analyze_path(@project,job) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
- <a class="btn btn-mini" href="<%= reanalyze_job_path(@project,job) %>" data-confirm="Reprocess this job?" rel="nofollow tooltip" title="Rerun Call Analysis"><i class="icon-refresh"></i></a>
+ <% if pct_analyzed == 100 %>
+ <a class="btn btn-mini" href="<%= reanalyze_job_path(@project,job) %>" data-confirm="Reprocess this job?" rel="nofollow tooltip" title="Rerun Call Analysis"><i class="icon-refresh"></i></a>
+ <% else %>
+ <a class="btn btn-mini" href="<%= analyze_job_path(@project,job) %>" data-confirm="Continue to process this job?" rel="nofollow tooltip" title="Finish Call Analysis"><i class="icon-cog"></i></a>
+ <% end %>
<% else %>
<a class="btn btn-mini" href="<%= analyze_job_path(@project,job) %>" data-confirm="Analyze this job?" rel="nofollow tooltip" title="Run Call Analysis"><i class="icon-cog"></i></a>
<% end %>
@@ -61,4 +82,4 @@
<% end %>
-<a class="btn" href="<%= new_dialer_job_path %>"><i class="icon-plus"></i> Start Job </a>
+<a class="btn" href="<%= new_dialer_job_path %>"><i class="icon-plus"></i> New Scan </a>