Upsize buttons - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR commit 876a89b6d4cde9a8e6df003f1aa0c08565040afc
DIR parent 68988e60dc7b735eefff34b15c68fbe2bc4c8195
HTML Author: HD Moore <hd_moore@rapid7.com>
Date: Sun, 6 Jan 2013 03:46:43 -0600
Upsize buttons
Diffstat:
M app/views/analyze/view.html.erb | 2 +-
M app/views/analyze/view_matches.htm… | 2 +-
M app/views/calls/index.html.erb | 10 +++++-----
M app/views/jobs/index.html.erb | 12 ++++++++----
M app/views/jobs/results.html.erb | 12 ++++++------
M app/views/projects/index.html.erb | 4 ++--
M app/views/providers/index.html.erb | 4 ++--
M lib/warvox/jobs/analysis.rb | 25 ++++++++++++++++++++-----
8 files changed, 45 insertions(+), 26 deletions(-)
---
DIR diff --git a/app/views/analyze/view.html.erb b/app/views/analyze/view.html.erb
@@ -38,7 +38,7 @@
</td>
<td>
<% if call.fprint and call.fprint.length > 0 %>
- <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>
+ <a class="btn" 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(call.project_id, call.job_id, call.id) %>" rel="tooltip" title="Search for Matches"><i class="icon-search"></i></a>
+ <a class="btn" 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/calls/index.html.erb b/app/views/calls/index.html.erb
@@ -28,16 +28,16 @@
<td><%= job.started_at.localtime.strftime("%Y-%m-%d %H:%M:%S") %></td>
<td>
- <a class="btn btn-mini" href="<%= view_call_path(@project,job) %>" rel="tooltip" title="View Call Connections" ><i class="icon-bar-chart"></i></a>
+ <a class="btn" href="<%= view_call_path(@project,job) %>" rel="tooltip" title="View Call Connections" ><i class="icon-bar-chart"></i></a>
<% if job.calls.where("analysis_completed_at IS NOT NULL").count > 0 %>
- <a class="btn btn-mini" href="<%= analyze_call_path(@project,job) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
- <a class="btn btn-mini" href="<%= reanalyze_call_path(@project,job) %>" data-confirm="Reprocess this job?" rel="nofollow tooltip" title="Rerun Call Analysis"><i class="icon-refresh"></i></a>
+ <a class="btn" href="<%= analyze_call_path(@project,job) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
+ <a class="btn" href="<%= reanalyze_call_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_call_path(@project,job) %>" data-confirm="Analyze this job?" rel="nofollow tooltip" title="Run Call Analysis"><i class="icon-bolt"></i></a>
+ <a class="btn" href="<%= analyze_call_path(@project,job) %>" data-confirm="Analyze this job?" rel="nofollow tooltip" title="Run Call Analysis"><i class="icon-bolt"></i></a>
<% end %>
- <a class="btn btn-mini" href="<%= call_path(@project,job) %>" data-confirm="Delete all data for this job?" data-method="delete" rel="nofollow tooltip" title="Delete Call Data"><i class="icon-trash"></i></a>
+ <a class="btn" href="<%= call_path(@project,job) %>" data-confirm="Delete all data for this job?" data-method="delete" rel="nofollow tooltip" title="Delete Call Data"><i class="icon-trash"></i></a>
</td>
</tr>
DIR diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb
@@ -9,6 +9,7 @@
<th>Status</th>
<th>Launched</th>
<th>Actions</th>
+ <th>Project</th>
</tr>
<% @submitted_jobs.each do |job| %>
@@ -19,8 +20,9 @@
<td><%= job.created_at.localtime.strftime("%Y-%m-%d %H:%M:%S %Z") %></td>
<td>
- <a class="btn btn-mini" href="<%= job_path(job) %>" data-confirm="Remove this job?" data-method="delete" rel="nofollow tooltip" title="Remove Job"><i class="icon-trash"></i></a>
+ <a class="btn" href="<%= job_path(job) %>" data-confirm="Remove this job?" data-method="delete" rel="nofollow tooltip" title="Remove Job"><i class="icon-trash"></i></a>
</td>
+ <td><%= link_to( h(truncate(job.project.name, :length => 25)), project_path(job.project)) %></td>
</tr>
<% end %>
</table>
@@ -38,6 +40,7 @@
<th>Progress</th>
<th>Launched</th>
<th>Actions</th>
+ <th>Project</th>
</tr>
<% @active_jobs.each do |job| %>
@@ -54,13 +57,14 @@
<td><%= job.created_at.localtime.strftime("%Y-%m-%d %H:%M:%S %Z") %></td>
<td>
<% if job.task == "dialer" %>
- <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>
+ <a class="btn" 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.details[:target_id]||job.id) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></i></a>
+ <a class="btn" 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>
+ <a class="btn" href="<%= stop_job_path(job) %>" data-confirm="Terminate this job?" rel="nofollow tooltip" title="Terminate Job"><i class="icon-stop"></i></a>
</td>
+ <td><%= link_to( h(truncate(job.project.name, :length => 25)), project_path(job.project)) %></td>
</tr>
<% end %>
</table>
DIR diff --git a/app/views/jobs/results.html.erb b/app/views/jobs/results.html.erb
@@ -52,22 +52,22 @@
<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>
+ <a class="btn" href="<%= view_results_path(@project,job) %>" rel="tooltip" title="View Call Connections" ><i class="icon-zoom-in"></i></a>
<% 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" href="<%= view_analyze_path(@project,job) %>" rel="tooltip" title="View Call Analysis"><i class="icon-eye-open"></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>
+ <a class="btn" 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>
+ <a class="btn" 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 %>
<% if cnt_answered > 0 %>
- <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>
+ <a class="btn" 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 %>
<% end %>
- <a class="btn btn-mini" href="<%= job_path(job) %>" data-confirm="Delete all data for this job?" data-method="delete" rel="nofollow tooltip" title="Delete Call Data"><i class="icon-trash"></i></a>
+ <a class="btn" href="<%= job_path(job) %>" data-confirm="Delete all data for this job?" data-method="delete" rel="nofollow tooltip" title="Delete Call Data"><i class="icon-trash"></i></a>
</td>
</tr>
DIR diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
@@ -25,8 +25,8 @@
<td><%= project.calls.where('analysis_completed_at IS NOT NULL').count %></td>
<td><%= project.updated_at.localtime.strftime("%Y-%m-%d %H:%M:%S") %></td>
<td>
- <a class="btn btn-mini" href="<%= edit_project_path(project) %>"rel="tooltip" title="Update Project Information"><i class="icon-pencil"></i></a>
- <a class="btn btn-mini" href="<%= project_path(project) %>" data-confirm="Delete this project?" data-method="delete" rel="nofollow tooltip" title="Delete Project"><i class="icon-trash"></i></a>
+ <a class="btn" href="<%= edit_project_path(project) %>"rel="tooltip" title="Update Project Information"><i class="icon-pencil"></i></a>
+ <a class="btn" href="<%= project_path(project) %>" data-confirm="Delete this project?" data-method="delete" rel="nofollow tooltip" title="Delete Project"><i class="icon-trash"></i></a>
</td>
</tr>
DIR diff --git a/app/views/providers/index.html.erb b/app/views/providers/index.html.erb
@@ -25,8 +25,8 @@
<td><%= provider.user %></td>
<td><%= provider.lines %></td>
<td>
- <a class="btn btn-mini" href="<%= edit_provider_path(provider) %>"rel="tooltip" title="Update Provider Information"><i class="icon-pencil"></i></a>
- <a class="btn btn-mini" href="<%= provider_path(provider) %>" data-confirm="Remove this provider?" data-method="delete" rel="nofollow tooltip" title="Remove Provider"><i class="icon-trash"></i></a>
+ <a class="btn" href="<%= edit_provider_path(provider) %>"rel="tooltip" title="Update Provider Information"><i class="icon-pencil"></i></a>
+ <a class="btn" href="<%= provider_path(provider) %>" data-confirm="Remove this provider?" data-method="delete" rel="nofollow tooltip" title="Remove Provider"><i class="icon-trash"></i></a>
</td>
</tr>
<% end %>
DIR diff --git a/lib/warvox/jobs/analysis.rb b/lib/warvox/jobs/analysis.rb
@@ -65,6 +65,12 @@ class Analysis < Base
end
case @conf[:scope]
+ when 'call'
+ if @conf[:force]
+ query = {:id => @conf[:target_id], :answered => true, :busy => false}
+ else
+ query = {:id => @conf[:target_id], :answered => true, :busy => false, :analysis_started_at => nil}
+ end
when 'job'
if @conf[:force]
query = {:job_id => @conf[:target_id], :answered => true, :busy => false}
@@ -85,8 +91,6 @@ class Analysis < Base
end
end
-
-
# Build a list of call IDs, as find_each() gets confused if the DB changes mid-iteration
calls = Call.where(query).map{|c| c.id }
@@ -152,7 +156,7 @@ class Analysis < Base
fd.write(mr.audio)
end
- pfd = IO.popen("#{bin} '#{tmp.path}' '#{ dr.number.gsub(/[^0-9a-zA-Z\-\+]+/, '') }'")
+ pfd = IO.popen("nice #{bin} '#{tmp.path}' '#{ dr.number.gsub(/[^0-9a-zA-Z\-\+]+/, '') }'")
out = Marshal.load(pfd.read) rescue nil
pfd.close
@@ -315,6 +319,9 @@ class Analysis < Base
# Plot samples to a graph
plotter = Tempfile.new("gnuplot")
+
+ plotter.puts("set autoscale")
+ plotter.puts("set yrange [-15000:15000]")
plotter.puts("set ylabel \"Signal\"")
plotter.puts("set xlabel \"Seconds\"")
plotter.puts("set terminal png medium size 640,480 transparent")
@@ -323,6 +330,10 @@ class Analysis < Base
plotter.puts("set output \"#{png_big_dots.path}\"")
plotter.puts("plot \"#{datfile.path}\" using 1:2 title \"#{num}\" with dots")
+
+ plotter.puts("unset yrange")
+ plotter.puts("set autoscale")
+ plotter.puts("set xrange [0:4000]")
plotter.puts("set terminal png medium size 640,480 transparent")
plotter.puts("set ylabel \"Power\"")
plotter.puts("set xlabel \"Frequency\"")
@@ -330,6 +341,9 @@ class Analysis < Base
plotter.puts("plot \"#{frefile.path}\" using 1:2 title \"#{num} - Peak #{maxf.round}hz\" with lines")
+ plotter.puts("unset xrange")
+ plotter.puts("set autoscale")
+ plotter.puts("set yrange [-15000:15000]")
plotter.puts("unset border")
plotter.puts("unset xtics")
plotter.puts("unset ytics")
@@ -339,9 +353,11 @@ class Analysis < Base
plotter.puts("set format x ''")
plotter.puts("set format y ''")
plotter.puts("set output \"#{png_sig.path}\"")
- plotter.puts("set style line 1 lt 1 lw 3 pt 3 linecolor rgb \"gray\"")
plotter.puts("plot \"#{datfile.path}\" using 1:2 notitle with lines")
+ plotter.puts("unset yrange")
+ plotter.puts("set autoscale")
+ plotter.puts("set xrange [0:4000]")
plotter.puts("unset border")
plotter.puts("unset xtics")
plotter.puts("unset ytics")
@@ -351,7 +367,6 @@ class Analysis < Base
plotter.puts("set format x ''")
plotter.puts("set format y ''")
plotter.puts("set output \"#{png_sig_freq.path}\"")
- plotter.puts("set style line 1 lt 1 lw 3 pt 3 linecolor rgb \"gray\"")
plotter.puts("plot \"#{frefile.path}\" using 1:2 notitle with lines")
plotter.flush