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.
- Install the package
$ meteor add rwatts:orionjs-dashboard
- Register your widget by following
Client
- 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. - If using the default widget template follow the instructions below
- Navigate to
/admin/dashboard/
to see your new widget.
- From the instructions above register a new widget
Client
. - In your widget declaration pass your template as the template key.
- 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.
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.
Meteor.publish('allProducts', function () {
Counts.publish(this, 'totalProducts', Products.find());
});
orion.dashboard.registerWidget({
template: 'default',
publication: 'allProducts',
count: 'totalProducts',
label: 'Products',
path: '/admin/products/',
baseColor: 'blue',
icon: 'shopping_cart',
textColor: 'white'
});
The full API is available here.
- 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.