diff --git a/app/admin/dashboard.rb b/app/admin/dashboard.rb index 0fd077d..dbdcbcd 100644 --- a/app/admin/dashboard.rb +++ b/app/admin/dashboard.rb @@ -3,8 +3,19 @@ ActiveAdmin.register_page "Dashboard" do menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") } content title: proc{ I18n.t("active_admin.dashboard") } do - - panel "Recent Pushes" do + panel "Device Status" do + columns do + STATUS_CLASSES.keys.each do |status| + column span:1 do + span status.to_s.titleize + span link_to(Device.send(status).count, + admin_devices_path(scope: status.to_s)) + end + end + end + end + + panel "Recent Pushes" do table_for BatchInstallation.order('id desc').limit(10) do column "Pushed on" do |batch| batch.created_at diff --git a/app/admin/device.rb b/app/admin/device.rb index 9c06d45..1099fa7 100644 --- a/app/admin/device.rb +++ b/app/admin/device.rb @@ -39,4 +39,27 @@ ActiveAdmin.register Device do scope :active scope :missing scope :dead + + show do + attributes_table do + row :model + row :imei_address + row :unique_id + row :os_version + row :client_version + row :last_heartbeat_recd_time + row :heartbeats_count + row :created_at + row :updated_at + panel "APP INSTALL DETAILS" do + table_for device.installations.order('updated_at desc') do + column "App Name" do |installation| + link_to installation.app.name, admin_app_path(installation.app.id) + end + column(:status){ |installation| installation.status.titleize } + column "Date", :updated_at + end + end + end + end end