Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

RailsAdmin alternative dashboard

License

Notifications You must be signed in to change notification settings

blocknotes/rails_admin_mydash

Repository files navigation

PROJECT UNMAINTAINED

This project is not maintained anymore

If you like it or continue to use it fork it please.



RailsAdminMydash Gem Version

A rails_admin alternative dashboard. It overrides the default dashboard component.

Features:

  • last 3 records for each model (useful to reach the last items easily)

  • Google Analytics widget embed if enabled

  • admin notices if enabled (to show informations to the users)

  • auditing / history table if enabled

  • no breadcrump and nav tabs on the dashboard

  • no counters progress bars (minor performance improvement)

Demo: heroku app

Installation

  • Add the gem to Gemfile (after rails_admin gem): gem 'rails_admin_mydash'

  • Execute bundle

Google Analytics

This feature allows the access to Analytics data only after signing in with an enabled Google account.

To enable Google Analytics follow this guide: Google Analytics Embed API

# In config.actions block:
dashboard do
  ga_key 'XXX.apps.googleusercontent.com'
  ga_chart_id 'ga:YYYYYYYYY'
  ga_start_date '60daysAgo'
  ga_end_date '30daysAgo'
  ga_metrics 'ga:sessions,ga:pageviews'
end

Options:

  • ga_key: required - CLIENT_ID parameter (obtained from Google API Client Libraries - ID client OAuth 2.0)

  • ga_chart_id: optional - chart to show, if not specified the selector is shown

  • ga_start_date: optional - starting date, default: '30daysAgo'

  • ga_end_date: optional - ending date, default: 'yesterday'

  • ga_metrics: optional - type of data to show, default: 'ga:sessions'

Admin notices

  • Create and apply a migration:

rails g migration CreateAdminNotices message:string published:boolean

  • Create a model AdminNotice

  • Enable the option in rails_admin config:

# In config.actions block:
dashboard do
  admin_notices 'AdminNotice'
end
  • Add some messages: AdminNotice.new( message: 'Just a test', published: true ).save

Options

  • admin_notices [String]: model to use to show admin messages

  • ga_key [String], ga_chart_id [String], ga_start_date [String], ga_end_date [String], ga_metrics [String]: see Google Analytics section above

  • last_records [Integer]: number of records to show per model

  • models [String array]: list of models to show (es. ['Category', 'Post', 'Tag'])

Notes

  • For each record to show a name field or method is used

Preview

preview

Contributors