EdenJS - Admin
Administrator base logic component for EdenJS
@edenjs/admin
creates all the base administrator logic that any normal system should require. This module also creates configuratble dashboards.
Setup
Install
npm i --save @edenjs/admin
Configure
No configuration is required for this module
Models
Dashboard model consists of a single configurable dashboard instance. These are created in the frontend through the api.
Example
const Dashboard = model('dashboard');
const dashboard = await Dashboard.findOne();
const data = await dashboard.sanitise();
Hooks
No hooks created in this module
Views
<dashboard>
Usage
The dashboard view creates an instance of a dashboard container, this provides a fully configurable dashboard area.
Example
In the controller Usage
const blockHelper = helper('cms/block');
const dashboards = await Dashboard.find();
const data = await Promise.all(dashboards.map(dash => dash.sanitise()));
res.render('dashboard/home', {
blocks : blockHelper.renderBlocks('admin'),
dashboards : data,
});
In the view dashboard/home.tag
Usage
<dashboard-home-page>
<dashboard dashboards={ opts.dashboards } blocks={ opts.blocks } type="my.dashboard" name="My Dashboard" />
</dashboard-home-page>
The admin header view creates a common admin header component for use in admin layout pages.
Example
In the view
<admin-header title="Admin Header Title" />