More cleanup - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 68988e60dc7b735eefff34b15c68fbe2bc4c8195
(DIR) parent 1eb0514c444c003aed9062a5b9eea10c65b27f00
(HTM) Author: HD Moore <hd_moore@rapid7.com>
Date: Sun, 6 Jan 2013 03:08:37 -0600
More cleanup
Diffstat:
M app/assets/stylesheets/bootstrap_a… | 3 ++-
M app/controllers/jobs_controller.rb | 11 +++++++++++
M app/views/analyze/view.html.erb | 4 ++--
M app/views/analyze/view_matches.htm… | 2 +-
M app/views/jobs/index.html.erb | 4 ++--
M app/views/jobs/new_dialer.html.erb | 2 +-
M app/views/jobs/view_results.html.e… | 6 +++---
M app/views/layouts/application.html… | 2 +-
M config/routes.rb | 12 ++++--------
9 files changed, 27 insertions(+), 19 deletions(-)
---
(DIR) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -146,8 +146,9 @@ body {
}
.progress_pct {
- color: @darkGray;
+ color: @red;
margin-left: 10px;
+ font-weight: bold;
}
.task_args_formatted {
(DIR) diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb
@@ -1,6 +1,9 @@
class JobsController < ApplicationController
def index
+
+ @reload_interval = 20000
+
@submitted_jobs = Job.where(:status => ['submitted', 'scheduled'], :completed_at => nil)
@active_jobs = Job.where(:status => 'running', :completed_at => nil)
@inactive_jobs = Job.where('status NOT IN (?) OR completed_at IS NULL', ['submitted', 'scheduled', 'running']).paginate(
@@ -9,6 +12,14 @@ class JobsController < ApplicationController
:per_page => 30
)
+ if @active_jobs.length > 0
+ @reload_interval = 5000
+ end
+
+ if @submitted_jobs.length > 0
+ @reload_interval = 1000
+ end
+
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @active_jobs + @submitted_jobs }
(DIR) diff --git a/app/views/analyze/view.html.erb b/app/views/analyze/view.html.erb
@@ -1,4 +1,4 @@
-<h1 class='title'>Analysis of Job ID <%= @job_id %></h1>
+<h1 class='title'>Analysis of Scan #<%= @job_id %></h1>
<table width='100%' align='center' border=0 cellspacing=0 cellpadding=6>
<tr>
@@ -38,7 +38,7 @@
</td>
<td>
<% if call.fprint and call.fprint.length > 0 %>
- <a class="btn btn-mini" href="<%= view_matches_path(@project, call.job_id, call.id) %>" rel="tooltip" title="Search for Matches"><i class="icon-search"></i></a>
+ <a class="btn btn-mini" href="<%= view_matches_path(call.project_id, call.job_id, call.id) %>" rel="tooltip" title="Search for Matches"><i class="icon-search"></i></a>
<% end %>
</td>
</tr>
(DIR) diff --git a/app/views/analyze/view_matches.html.erb b/app/views/analyze/view_matches.html.erb
@@ -78,7 +78,7 @@
</td>
<td>
<% if call.fprint and call.fprint.length > 0 %>
- <a class="btn btn-mini" href="<%= view_matches_path(@project, call.job_id, call.id) %>" rel="tooltip" title="Search for Matches"><i class="icon-search"></i></a>
+ <a class="btn btn-mini" href="<%= view_matches_path(call.project_id, call.job_id, call.id) %>" rel="tooltip" title="Search for Matches"><i class="icon-search"></i></a>
<% end %>
</td>
</tr>
(DIR) diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb
@@ -57,7 +57,7 @@
<a class="btn btn-mini" href="<%= view_results_path(job.project,job) %>" rel="tooltip" title="View Current Stats" ><i class="icon-zoom-in"></i></a>
<% end %>
<% if job.task == "analysis" %>
- <a class="btn btn-mini" href="<%= view_analyze_path(job.project,job) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
+ <a class="btn btn-mini" href="<%= view_analyze_path(job.project,job.details[:target_id]||job.id) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
<% end %>
<a class="btn btn-mini" href="<%= stop_job_path(job) %>" data-confirm="Terminate this job?" rel="nofollow tooltip" title="Terminate Job"><i class="icon-stop"></i></a>
</td>
@@ -112,7 +112,7 @@
<br />
<script language="javascript">
- setTimeout("location.reload(true);", 20000);
+ setTimeout("location.reload(true);", <%= @reload_interval %>);
</script>
<% end %>
(DIR) diff --git a/app/views/jobs/new_dialer.html.erb b/app/views/jobs/new_dialer.html.erb
@@ -1,4 +1,4 @@
-<h1 class='title'>Dialer Job</h1>
+<h1 class='title'>Phone Scan</h1>
<%= semantic_form_for(@job, :url => dialer_job_path, :html => { :multipart => true, :method => :put }) do |f| %>
<%= f.input :project, :as => :select %>
(DIR) diff --git a/app/views/jobs/view_results.html.erb b/app/views/jobs/view_results.html.erb
@@ -1,7 +1,7 @@
<% if @results.length > 0 %>
-<h1 class='title'>Dial Results for Job <%=@job.id%></h1>
+<h1 class='title'>Call Results for Scan #<%=@job.id%></h1>
<table width='100%' align='center' border=0 cellspacing=0 cellpadding=6>
@@ -20,7 +20,7 @@
<thead>
<tr>
<th>Number</th>
- <th>CallerID</th>
+ <th>Source CID</th>
<th>Provider</th>
<th>Answered</th>
<th>Busy</th>
@@ -34,7 +34,7 @@
<td><%= call.number %></td>
<td><%= call.caller_id %></td>
<td><%= call.provider.name %></td>
- <td><%= call.answered %></td>
+ <td><%= call.answered ? "Yes" : "No" %></td>
<td><%= call.busy %></td>
<td><%= call.audio_length %></td>
<td><%= call.ring_length %></td>
(DIR) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
@@ -58,7 +58,7 @@
h(truncate(@project.name, :length => 20)) +
' <i class="icon-chevron-right icon-white"></i>'), project_path(@project), :class => 'project-title') %>
</li>
- <%= menu_item "Results", results_path(@project) %>
+ <%= menu_item "Scans", results_path(@project) %>
<%= menu_item "Analysis", analyze_path(@project)%>
<% end %>
(DIR) diff --git a/config/routes.rb b/config/routes.rb
@@ -1,9 +1,5 @@
Web::Application.routes.draw do
-
-
-
-
match "login" => "user_sessions#new", :as => "login"
match "logout" => "user_sessions#destroy", :as => "logout"
@@ -18,10 +14,10 @@ Web::Application.routes.draw do
match '/jobs/analyzer' => 'jobs#analyzer', :as => :analyzer_job
match '/jobs/:id/stop' => 'jobs#stop', :as => :stop_job
- match '/projects/:project_id/results' => 'jobs#results', :as => :results
- match '/projects/:project_id/results/:id' => 'jobs#view_results', :as => :view_results
- match '/projects/:project_id/results/:id/analyze' => 'jobs#analyze_job', :as => :analyze_job
- match '/projects/:project_id/results/:id/reanalyze' => 'jobs#reanalyze_job', :as => :reanalyze_job
+ match '/projects/:project_id/scans' => 'jobs#results', :as => :results
+ match '/projects/:project_id/scans/:id' => 'jobs#view_results', :as => :view_results
+ match '/projects/:project_id/scans/:id/analyze' => 'jobs#analyze_job', :as => :analyze_job
+ match '/projects/:project_id/scans/:id/reanalyze' => 'jobs#reanalyze_job', :as => :reanalyze_job
match '/projects/:project_id/analyze' => 'analyze#index', :as => :analyze
match '/call/:result_id.:type' => 'analyze#resource', :as => :resource_analyze