-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Screened Urls page shows results for each domain instead of each url
- Loading branch information
Showing
8 changed files
with
33 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
app/assets/javascripts/admin/templates/logs/screened_urls_list_item.js.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<div class="col first url"> | ||
<div class="overflow-ellipsis" {{bindAttr title="url"}}>{{url}}</div> | ||
<div class="col first domain"> | ||
<div class="overflow-ellipsis" {{bindAttr title="domain"}}>{{domain}}</div> | ||
</div> | ||
<div class="col action">{{actionName}}</div> | ||
<div class="col match_count">{{match_count}}</div> | ||
<div class="col last_match_at">{{unboundAgeWithTooltip last_match_at}}</div> | ||
<div class="col created_at">{{unboundAgeWithTooltip created_at}}</div> | ||
<div class="col ip_address">{{ip_address}}</div> | ||
<div class="clearfix"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
class Admin::ScreenedUrlsController < Admin::AdminController | ||
|
||
def index | ||
screened_urls = ScreenedUrl.limit(200).order('last_match_at desc').to_a | ||
render_serialized(screened_urls, ScreenedUrlSerializer) | ||
screened_urls = ScreenedUrl.select("domain, sum(match_count) as match_count, max(last_match_at) as last_match_at, min(created_at) as created_at").group(:domain).to_a | ||
render_serialized(screened_urls, GroupedScreenedUrlSerializer) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class GroupedScreenedUrlSerializer < ApplicationSerializer | ||
attributes :domain, | ||
:action, | ||
:match_count, | ||
:last_match_at, | ||
:created_at | ||
|
||
def action | ||
'do_nothing' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters