songtianlun
d418232e7b
Some checks failed
Docker / docker (push) Has been cancelled
- Removed user_id, city, country, and region columns - Added visit_id, visit_token, referrer, landing_page, browser, os, and device_type columns This refactor improves the administrative interface for Ahoy models by updating the displayed attributes to better suit the current application requirements. It also aligns the displayed data with the available attributes in the Ahoy tracking system, making it easier for administrators to review relevant information.
45 lines
1.5 KiB
Ruby
45 lines
1.5 KiB
Ruby
ActiveAdmin.register Ahoy::Visit do
|
|
menu label: "访客统计", parent: "数据统计"
|
|
# See permitted parameters documentation:
|
|
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
|
#
|
|
# Uncomment all parameters which should be permitted for assignment
|
|
#
|
|
# permit_params :visit_token, :visitor_token, :user_id, :ip, :user_agent, :referrer, :referring_domain, :landing_page, :browser, :os, :device_type, :country, :region, :city, :latitude, :longitude, :utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign, :app_version, :os_version, :platform, :started_at
|
|
#
|
|
# or
|
|
#
|
|
# permit_params do
|
|
# permitted = [:visit_token, :visitor_token, :user_id, :ip, :user_agent, :referrer, :referring_domain, :landing_page, :browser, :os, :device_type, :country, :region, :city, :latitude, :longitude, :utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign, :app_version, :os_version, :platform, :started_at]
|
|
# permitted << :other if params[:action] == 'create' && current_user.admin?
|
|
# permitted
|
|
# end
|
|
|
|
# menu priority: 100, label: "访问统计"
|
|
|
|
actions :index
|
|
|
|
index do
|
|
column :id
|
|
column :visitor_token
|
|
column :ip
|
|
column :user_agent
|
|
column :started_at
|
|
# column :city
|
|
# column :country
|
|
# column :region
|
|
column :visit_token
|
|
column :user_agent
|
|
column :referrer
|
|
column :landing_page
|
|
column :browser
|
|
column :os
|
|
column :device_type
|
|
column :started_at
|
|
end
|
|
|
|
filter :started_at
|
|
filter :city
|
|
filter :country
|
|
end
|