Overview
Agenda Admin is a dashboard for managing and monitoring jobs in Agenda, a job scheduling library for Node.js. It provides a range of features to easily view and manage jobs, including searching, filtering, deleting, requeueing, and scheduling new jobs. It can be used as express middleware and supports Docker usage. The dashboard requires a minimum version of MongoDB 2.6.0.
Features
- Jobs status: View the status of jobs, with the ability to refresh the status every 15 seconds by default.
- Search jobs by name: Easily search for jobs using an autocomplete feature for job names.
- Filter jobs by metadata and status: Filter jobs based on their metadata and status.
- View job details: Access detailed information about each job.
- Delete and requeue jobs: Delete or requeue jobs from the dashboard.
- Schedule a new job: Schedule new jobs from the dashboard.
Installation
To install and use Agenda Admin, follow these steps:
- Make sure you have MongoDB version >2.6.0 installed.
- Install Agenda Admin as an express middleware. Use the
mountAgendaAdminfunction and pass an object with the following fields:publicUrl: The URL at which the frontend of Agenda Admin is served.mountPath: The path at which the middleware should be mounted (useapp.use()to mount the middleware).expressApp: The express app to which the middleware will be added.agenda: An instance of the Agenda library.options(optional): An object with additional properties, such asitemsPerPage,username, andpassword.
Example:
const AgendaAdmin = require('agenda-admin');
const agenda = new Agenda();
AgendaAdmin.mountAgendaAdmin({
publicUrl: 'http://localhost:3000',
mountPath: '/admin',
expressApp: app,
agenda: agenda,
options: {
itemsPerPage: 10,
username: 'admin',
password: 'pass123'
}
});
Docker usage
If you prefer to use Docker, follow these additional steps:
- Make sure you expose port 7878 from the Docker container.
- Connect the Docker container to port 7878 (Agenda Admin does not support port remapping at the moment).
Docker environment configuration
When using Docker, you can configure Agenda Admin using environment variables. Here are the available variables:
CONNECTION_STRING(required): MongoDB connection string.COLLECTION(optional): MongoDB collection of jobs. Defaults to “agendaJobs”.ITEMS_PER_PAGE(optional): Number of jobs per page. Defaults to 20.AGENDA_USERNAME(optional): Username for authentication (only required when a password is provided).AGENDA_PASSWORD(optional): Password for authentication. If not provided, no authentication is required.
Summary
Agenda Admin is a powerful dashboard for managing and monitoring jobs in Agenda. It offers various features such as job status monitoring, job searching, filtering, viewing details, deleting and requeueing jobs, and scheduling new jobs. It can be easily integrated into an Express application as middleware and supports Docker usage. With Agenda Admin, developers can efficiently manage and monitor their Agenda jobs with ease.