-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[admin] Add feed stats views for podcasts, feeds
- Loading branch information
1 parent
152f909
commit 97c51e2
Showing
10 changed files
with
162 additions
and
5 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
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
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
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
46 changes: 46 additions & 0 deletions
46
lib/changelog_web/templates/admin/feed/feed_stats.html.heex
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,46 @@ | ||
<div class="ui basic segment"> | ||
<h1 class="ui dividing header"> | ||
<%= link("Feeds", to: ~p"/admin/feeds") %> | ||
»<%= @feed.id %> (<%= @feed.name %>) | ||
»Feed Stats | ||
</h1> | ||
|
||
<div class="actions right"> | ||
<%= if @prev do %> | ||
<%= link to: ~p"/admin/feeds/#{@feed}/feed_stats" <> "?date=#{@prev.date}", class: "ui right floated basic button" do %> | ||
<i class="icon angle double left"></i> | ||
Previous Day | ||
<% end %> | ||
<% end %> | ||
<%= if @next do %> | ||
<%= link to: ~p"/admin/feeds/#{@feed}/feed_stats" <> "?date=#{@next.date}", class: "ui right floated basic button" do %> | ||
<i class="icon angle double right"></i> | ||
Next Day | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="ui basic segment"> | ||
<h2 class="ui header"><%= @stat.date %></h2> | ||
<table class="ui striped table"> | ||
<thead> | ||
<tr> | ||
<th>Agent</th> | ||
<th>Type</th> | ||
<th>Requests</th> | ||
<th>Raw</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%= for {name, data} <- Enum.sort_by(@stat.agents, fn {_name, data} -> data["requests"] end, :desc) do %> | ||
<tr> | ||
<td><%= name %></td> | ||
<td><%= data["type"] %></td> | ||
<td><%= data["requests"] %></td> | ||
<td><%= data["raw"] %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</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
47 changes: 47 additions & 0 deletions
47
lib/changelog_web/templates/admin/podcast/feed_stats.html.heex
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,47 @@ | ||
<div class="ui basic segment"> | ||
<h1 class="ui dividing header"> | ||
<%= link("Podcasts", to: ~p"/admin/podcasts") %> | ||
<%= render("_dropdown_list.html", assigns) %> | ||
<%= @podcast.name %> | ||
»Feed Stats | ||
</h1> | ||
|
||
<div class="actions right"> | ||
<%= if @prev do %> | ||
<%= link to: ~p"/admin/podcasts/#{@podcast.slug}/feed_stats" <> "?date=#{@prev.date}", class: "ui right floated basic button" do %> | ||
<i class="icon angle double left"></i> | ||
Previous Day | ||
<% end %> | ||
<% end %> | ||
<%= if @next do %> | ||
<%= link to: ~p"/admin/podcasts/#{@podcast.slug}/feed_stats" <> "?date=#{@next.date}", class: "ui right floated basic button" do %> | ||
<i class="icon angle double right"></i> | ||
Next Day | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="ui basic segment"> | ||
<h2 class="ui header"><%= @stat.date %></h2> | ||
<table class="ui striped table"> | ||
<thead> | ||
<tr> | ||
<th>Agent</th> | ||
<th>Type</th> | ||
<th>Requests</th> | ||
<th>Raw</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%= for {name, data} <- Enum.sort_by(@stat.agents, fn {_name, data} -> data["requests"] end, :desc) do %> | ||
<tr> | ||
<td><%= name %></td> | ||
<td><%= data["type"] %></td> | ||
<td><%= data["requests"] %></td> | ||
<td><%= data["raw"] %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> |