diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb
index 974489f..b619ec0 100644
--- a/app/controllers/admin/base_controller.rb
+++ b/app/controllers/admin/base_controller.rb
@@ -1,42 +1,42 @@
class Admin::BaseController < ApplicationController
before_action :require_admin, except: [:login]
# GET /admin
# POST /admin
def index
@client_ids = Client.pluck(:ClientId)
get_charts
@global_stats = GlobalStats.new.stats
- @jobs = Job.includes(:file_set, :logs, :client).
+ @jobs = Job.includes(:file_set, :client).
where('EndTime > ?', days_ago.days.ago).
order(EndTime: :desc)
render 'admin/index'
end
# GET /admin/login
def login
render 'admin/login'
end
# GET /admin/raiser
# Raises an exception on demand, for sentry testing
def raiser
raise 'Error on Demand'
end
protected
def get_charts
@job_status = ChartGenerator.job_statuses(@client_ids, days_ago)
@job_stats = ChartGenerator.job_stats(@client_ids, days_ago - 1)
end
def require_admin
return if current_user.try(:has_admin_access?)
flash[:alert] = 'You need to log in first'
redirect_to admin_login_path
end
end
diff --git a/app/views/admin/clients/_recent_job.html.erb b/app/views/admin/clients/_recent_job.html.erb
index e5f5331..a7ff17c 100644
--- a/app/views/admin/clients/_recent_job.html.erb
+++ b/app/views/admin/clients/_recent_job.html.erb
@@ -1,14 +1,12 @@
<%= recent_job.name %> |
<%= recent_job.job_id %> |
<%= recent_job.level_human %> |
<%= recent_job.fileset %> |
<%= recent_job.start_time_formatted %> |
<%= recent_job.end_time_formatted %> |
<%= recent_job.duration %> |
<%= number_to_human_size(recent_job.job_bytes) %> |
<%= number_by_magnitude(recent_job.job_files) %> |
<%= recent_job.status_human %> |
- <%= recent_job.encryption %> |
- <%= recent_job.compression %> |
diff --git a/app/views/admin/clients/_recent_jobs.html.erb b/app/views/admin/clients/_recent_jobs.html.erb
index dd35d54..443cfa1 100644
--- a/app/views/admin/clients/_recent_jobs.html.erb
+++ b/app/views/admin/clients/_recent_jobs.html.erb
@@ -1,25 +1,23 @@
Name |
JobId |
Level |
Fileset |
Started At |
Finished At |
Duration |
Bytes |
Files |
Status |
- Encryption |
- Compression |
<%= render partial: 'recent_job', collection: @jobs %>
diff --git a/app/views/admin/jobs/_recent_job.html.erb b/app/views/admin/jobs/_recent_job.html.erb
index 1c4c8e5..f66139b 100644
--- a/app/views/admin/jobs/_recent_job.html.erb
+++ b/app/views/admin/jobs/_recent_job.html.erb
@@ -1,18 +1,16 @@
<%= recent_job.name %> |
<%= recent_job.client.name %> |
<%= link_to recent_job.job_id,
logs_admin_client_path(recent_job.client, job_id: recent_job.id) %>
|
<%= recent_job.level_human %> |
<%= recent_job.fileset %> |
<%= recent_job.start_time_formatted %> |
<%= recent_job.end_time_formatted %> |
<%= recent_job.duration %> |
<%= number_to_human_size(recent_job.job_bytes) %> |
<%= number_by_magnitude(recent_job.job_files) %> |
<%= recent_job.status_human %> |
- <%= recent_job.encryption %> |
- <%= recent_job.compression %> |
diff --git a/app/views/admin/jobs/_recent_jobs.html.erb b/app/views/admin/jobs/_recent_jobs.html.erb
index 0f7ffbe..aadace0 100644
--- a/app/views/admin/jobs/_recent_jobs.html.erb
+++ b/app/views/admin/jobs/_recent_jobs.html.erb
@@ -1,26 +1,24 @@
Name |
Client |
JobId |
Level |
Fileset |
Started At |
Finished At |
Duration |
Bytes |
Files |
Status |
- Encryption |
- Compression |
<%= render partial: 'admin/jobs/recent_job', collection: @jobs %>
diff --git a/app/views/clients/_recent_job.html.erb b/app/views/clients/_recent_job.html.erb
index e5f5331..a7ff17c 100644
--- a/app/views/clients/_recent_job.html.erb
+++ b/app/views/clients/_recent_job.html.erb
@@ -1,14 +1,12 @@
<%= recent_job.name %> |
<%= recent_job.job_id %> |
<%= recent_job.level_human %> |
<%= recent_job.fileset %> |
<%= recent_job.start_time_formatted %> |
<%= recent_job.end_time_formatted %> |
<%= recent_job.duration %> |
<%= number_to_human_size(recent_job.job_bytes) %> |
<%= number_by_magnitude(recent_job.job_files) %> |
<%= recent_job.status_human %> |
- <%= recent_job.encryption %> |
- <%= recent_job.compression %> |
diff --git a/app/views/clients/_recent_jobs.html.erb b/app/views/clients/_recent_jobs.html.erb
index da33da0..9a173a2 100644
--- a/app/views/clients/_recent_jobs.html.erb
+++ b/app/views/clients/_recent_jobs.html.erb
@@ -1,25 +1,23 @@
Name |
JobId |
Level |
Fileset |
Started At |
Finished At |
Duration |
Bytes |
Files |
Status |
- Encryption |
- Compression |
<%= render partial: 'clients/recent_job', collection: @jobs %>