mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 02:04:57 +00:00
39 lines
886 B
Ruby
39 lines
886 B
Ruby
ActiveAdmin.register Device do
|
|
|
|
actions :all, except: [:edit,:new]
|
|
|
|
# See permitted parameters documentation:
|
|
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
|
#
|
|
# permit_params :list, :of, :attributes, :on, :model
|
|
#
|
|
# or
|
|
#
|
|
# permit_params do
|
|
# permitted = [:permitted, :attributes]
|
|
# permitted << :other if resource.something?
|
|
# permitted
|
|
# end
|
|
index do
|
|
selectable_column
|
|
id_column
|
|
column "Status" do | device |
|
|
status = device.status
|
|
status_tag status.titleize, STATUS_CLASSES[status.to_sym]
|
|
end
|
|
column "Model Name",:model
|
|
column :created_at
|
|
column :updated_at
|
|
column :last_heartbeat_recd_time
|
|
actions
|
|
end
|
|
filter :model
|
|
filter :created_at
|
|
filter :updated_at
|
|
filter :last_heartbeat_recd_time
|
|
|
|
scope :active
|
|
scope :missing
|
|
scope :dead
|
|
end
|