open-index/open-npm huggingface dataset:
npm package: @pimred/cron-ui
Description: A visualization of `@pimred/cron`.
Latest version: 0.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

```bash
npm install @pimred/cron-ui
```

## Usage

```JavaScript
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

```JavaScript
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

```JavaScript
const cronUI = new CronUI(scheduler, { port: 3002 })
```

### Basic authentication

```JavaScript
const cronUI = new CronUI(scheduler, {
  auth: {
    username: 'User',
    password: 'XXXXX'
  }
})
cronUI.start()
```