Admin Login Activities

Login and logout events for administrative users
<%= form_with url: admin_portal_login_activities_path, method: :get, local: true do |f| %>
<%= f.submit "Apply", data: { turbo: false }, class: "btn btn-primary btn-sm rounded-pill px-4" %> <%= link_to "Clear", admin_portal_login_activities_path, data: { turbo: false }, class: "btn btn-warning btn-sm rounded-pill px-4" %>
<% end %>
<% @login_activities.each do |log| %> <% end %>
Time User Action IP Address Device
<%= log.occurred_at_formatted %> <%= log.user&.display_name || "System" %> <% badge_class = log.human_action.downcase == "login" ? "bg-success-subtle text-success" : "bg-secondary-subtle text-secondary" %> <%= log.human_action %> <%= log.ip_address %> <%= log.device&.name || "N/A" %>