add nav link

This commit is contained in:
Donovan Daniels 2024-10-24 01:38:42 -05:00
parent 7aac4f7e72
commit e14419bc91
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
2 changed files with 4 additions and 1 deletions

View File

@ -466,7 +466,7 @@ class APIImage < ApplicationRecord
end end
def self.all_seen def self.all_seen
Cache.fetch("img:all_seen", expires_in: 10.minutes) do Cache.fetch("img:all_seen", expires_in: 1.minutes) do
keys = all.map { |img| "yiffy2:stats:image:#{img.md5}" } keys = all.map { |img| "yiffy2:stats:image:#{img.md5}" }
values = Cache.redis.mget(*keys) values = Cache.redis.mget(*keys)
results = {} results = {}

View File

@ -14,6 +14,9 @@
<li class="nav-item"> <li class="nav-item">
<%= link_to("Image List", yiff_rest_api_v2_manage_images_path, class: "nav-link") %> <%= link_to("Image List", yiff_rest_api_v2_manage_images_path, class: "nav-link") %>
</li> </li>
<li class="nav-item">
<%= link_to("Leaderboard", leaderboard_yiff_rest_api_v2_manage_images_path, class: "nav-link") %>
</li>
<% if params[:controller] == "yiff_rest/api_v2/manage" %> <% if params[:controller] == "yiff_rest/api_v2/manage" %>
<% elsif params[:controller] == "yiff_rest/api_v2/images" %> <% elsif params[:controller] == "yiff_rest/api_v2/images" %>
<% if %w[index iqdb query_iqdb].include?(params[:action]) %> <% if %w[index iqdb query_iqdb].include?(params[:action]) %>