More cleanup - warvox - Unnamed repository; edit this file 'description' to nam… | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 68988e60dc7b735eefff34b15c68fbe2bc4c8195 | |
parent 1eb0514c444c003aed9062a5b9eea10c65b27f00 | |
Author: HD Moore <[email protected]> | |
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(-) | |
--- | |
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/asse… | |
@@ -146,8 +146,9 @@ body { | |
} | |
.progress_pct { | |
- color: @darkGray; | |
+ color: @red; | |
margin-left: 10px; | |
+ font-weight: bold; | |
} | |
.task_args_formatted { | |
diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controll… | |
@@ -1,6 +1,9 @@ | |
class JobsController < ApplicationController | |
def index | |
+ | |
+ @reload_interval = 20000 | |
+ | |
@submitted_jobs = Job.where(:status => ['submitted', 'scheduled'], :… | |
@active_jobs = Job.where(:status => 'running', :completed_at => nil) | |
@inactive_jobs = Job.where('status NOT IN (?) OR completed_at IS NULL'… | |
@@ -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 } | |
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(@p… | |
+ <a class="btn btn-mini" href="<%= view_matches_path(ca… | |
<% end %> | |
</td> | |
</tr> | |
diff --git a/app/views/analyze/view_matches.html.erb b/app/views/analyze/view_m… | |
@@ -78,7 +78,7 @@ | |
</td> | |
<td> | |
<% if call.fprint and call.fprint.length > 0 %> | |
- <a class="btn btn-mini" href="<%= view_matches_path(@p… | |
+ <a class="btn btn-mini" href="<%= view_matches_path(ca… | |
<% end %> | |
</td> | |
</tr> | |
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.pr… | |
<% end %> | |
<% if job.task == "analysis" %> | |
- <a class="btn btn-mini" href="<%= view_analyze_path(job.pr… | |
+ <a class="btn btn-mini" href="<%= view_analyze_path(job.pr… | |
<% end %> | |
<a class="btn btn-mini" href="<%= stop_job_path(job) %>" data-… | |
</td> | |
@@ -112,7 +112,7 @@ | |
<br /> | |
<script language="javascript"> | |
- setTimeout("location.reload(true);", 20000); | |
+ setTimeout("location.reload(true);", <%= @reload_interval %>); | |
</script> | |
<% end %> | |
diff --git a/app/views/jobs/new_dialer.html.erb b/app/views/jobs/new_dialer.htm… | |
@@ -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 => … | |
<%= f.input :project, :as => :select %> | |
diff --git a/app/views/jobs/view_results.html.erb b/app/views/jobs/view_results… | |
@@ -1,7 +1,7 @@ | |
<% if @results.length > 0 %> | |
-<h1 class='title'>Dial Results for Job <%[email protected]%></h1> | |
+<h1 class='title'>Call Results for Scan #<%[email protected]%></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> | |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/applica… | |
@@ -58,7 +58,7 @@ | |
h(truncate(@project.na… | |
' <i class="icon-chevr… | |
</li> | |
- <%= menu_item "Results", results_path(@project… | |
+ <%= menu_item "Scans", results_path(@project) … | |
<%= menu_item "Analysis", analyze_path(@projec… | |
<% end %> | |
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 => :r… | |
- match '/projects/:project_id/results/:id' => 'jobs#view_results', :as … | |
- match '/projects/:project_id/results/:id/analyze' => 'jobs#analyze_job',… | |
- match '/projects/:project_id/results/:id/reanalyze' => 'jobs#reanalyze_job… | |
+ match '/projects/:project_id/scans' => 'jobs#results', :as => :res… | |
+ match '/projects/:project_id/scans/:id' => 'jobs#view_results', :as =>… | |
+ match '/projects/:project_id/scans/:id/analyze' => 'jobs#analyze_job', :… | |
+ match '/projects/:project_id/scans/:id/reanalyze' => 'jobs#reanalyze_job',… | |
match '/projects/:project_id/analyze' => 'analyze#index', :as =>… | |
match '/call/:result_id.:type' => 'analyze#resource', :as … |