Skip to content

rudza/orionjs-dashboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orionjs Dashboards v0.1.3

This package brings a set of api tools as well as a new newspace to orion. orion.dashboard. With this package you will be able to

This package is an extension of Orion and has a dependency on the orionjs:base package along with others.

Instructions

  1. Install the package
$ meteor add rwatts:orionjs-dashboard
  1. Register your widget by following Client
  2. Register access to the dashboard by setting Options.set('showDashboard', true) within your lib directory. If you have used the Example project from the Orion repository this will typically be in the lib/options.js file.
  3. If using the default widget template follow the instructions below
  4. Navigate to /admin/dashboard/ to see your new widget.

Register a custom Widget

  1. From the instructions above register a new widget Client.
  2. In your widget declaration pass your template as the template key.
  3. Ensure that the values you want to display in your widget is passed in the registration as individual keys.

Note orion.dashboard.registerWidget must be passed as an object, and template is a required field. If you do not set the template, it will default to your themes default template.

Tips

For the best experience, if utilizing the default widgets, you will need to use tmeasday:publish-counts to publish the total Count of a collections records. See their documentation for instructions on publishing the record counts.

A tutorial will be provided in the documentation demonstrating how to complete this task.

Default Widget Guide

Publish Counts Server

Meteor.publish('allProducts', function () {
	Counts.publish(this, 'totalProducts', Products.find());
});

Register Widget Client

orion.dashboard.registerWidget({
	template: 'default',
	publication: 'allProducts',
	count: 'totalProducts',
	label: 'Products',
	path: '/admin/products/',
	baseColor: 'blue',
	icon: 'shopping_cart',
	textColor: 'white'
});

API

The full API is available here.

TODO

  • v0.2.0 next
    • Add default widget for bootstrap theme.
  • v0.1.3
    • Added tests and updated documentation.
  • v0.1.2
    • Added the ability to send publication to the default widget.
    • Moved tmeasday:publish-counts internal so that it's available immediately for default widgets.
    • Documentation improvements.
  • v0.1.1
    • Fixed Issue with publications which caused some data not to publish the counts to the widget.

About

Adds a Dashboard with Widgets to Orion

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 76.2%
  • HTML 21.5%
  • CSS 2.3%