Global: Admin
Global: Admin.utils
Methods:
Admin.utils.isAdmin(userId)
Creates user / converts user to admin when specified in:
- env variables
- settings
- configured with AdminConfig
Global: Admin.config
Methods:
Admin.config(configObj)
extendsAdmin._config
which holds the json. Should probably be run instartup
functionAdmin.addRoute(routeObj)
- ...
Gobal: Admin._zeroConfig
Generates a default config file for the user.
Should prepopulate with collections and generate schemas for these collections so that Admin can be used right out of the box.
Adds CRUD meteor methods:
admin.insert(collection, doc)
admin.update(collection, docId, modifier)
admin.remove(collection, docId)
Adds publish function for admins
admin.find(collection, query)
admin.findOne(collection, query/docId)
Add templates and blaze helpers.
Adds $AdminUtils
as a helper.
It should be easy to modify your admin dashboard. The easiest is having direct access to the code.
User should start by 1) Cloning a repo with a working app 2) Using a generator (see mantra)
This repo should contains the packages, giving the dev easy access.
It could even be the case that almost everything is in repo, giving the dev fuller control.
Until a good solution for astronomy forms exists, we just support 1) No schemas 2) Collection 2
We attempt to automatically generate schemas for the user. Work in progress.
We generate forms via AutoForm
meteor add admin-server
meteor add admin-client-blaze
Will generate AdminConfig automatically.
meteor add admin-server
meteor add admin-client-blaze
const configObj = {
...
};
Meteor.startup(() => {
Admin.config(configObj)
})
In order to have a set of sweet add-on packages, an api must be exposed.
The API's functionality is to modify the config.
Methods:
Admin.addCrud(collection)
Admin.addSidebarLink(linkObj)
Admin.addRoute(routeObj)