0.4.0 • Published 4 years ago
@pimred/cron-ui v0.4.0
Cron UI
A visualization of @pimred/cron.
It's using the instance of @pimred/cron together with logs from @pimred/logger/elastic to create a dashboard of the scheduled cronjobs.
Installation
npm install @pimred/cron-uiUsage
const Scheduler = require('@pimred/cron')
const CronUI = require('@pimred/cron-ui')
const scheduler = new Scheduler()
// add cronjobs to the scheduler
const cronUI = new CronUI(scheduler)
cronUI.start()You can open the dashboard at localhost:3001.
API
Constructor
const cronUI = new CronUI(scheduler, options)Create an instance of CronUI.
The instance of @pimred/cron is required.
Optional options:
| Name | Description | Default |
|---|---|---|
| port | Port number | 3001 |
| indexName | name of the index in elasticsearch | process.env.PIMRED_LOGGER_ELASTIC_INDEX_NAME |
| elasticNode | url of elasticsearch | process.env.PIMRED_LOGGER_ELASTIC_NODE |
| elasticUsername | optional username for authentication | process.env.PIMRED_LOGGER_ELASTIC_USERNAME |
| elasticPassword | optional password for authentication | process.env.PIMRED_LOGGER_ELASTIC_PASSWORD |
| auth.username | Username for basic authentication of the dashboard | |
| auth.password | Password for basic authentication of the dashboard |
Examples
Using a different port
const cronUI = new CronUI(scheduler, { port: 3002 })Basic authentication
const cronUI = new CronUI(scheduler, {
auth: {
username: 'User',
password: 'XXXXX'
}
})
cronUI.start()