0.4.0 • Published 2 years ago

@pimred/cron-ui v0.4.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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-ui

Usage

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:

NameDescriptionDefault
portPort number3001
indexNamename of the index in elasticsearchprocess.env.PIMRED_LOGGER_ELASTIC_INDEX_NAME
elasticNodeurl of elasticsearchprocess.env.PIMRED_LOGGER_ELASTIC_NODE
elasticUsernameoptional username for authenticationprocess.env.PIMRED_LOGGER_ELASTIC_USERNAME
elasticPasswordoptional password for authenticationprocess.env.PIMRED_LOGGER_ELASTIC_PASSWORD
auth.usernameUsername for basic authentication of the dashboard
auth.passwordPassword 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()