Code Monkey home page Code Monkey logo

agendash-v2's Introduction

WARNING! This project was merged into the main Agendash. This git repo is deprecated now.

Agendash 2

A modern, secure, and reliable dashboard for Agenda with search and pagination capabilities written in vue.js


Features

  • Dropin replacement for old agendash just change your require(agendash) to require(agendash2)
  • Job status auto-refreshes (60-second polling by default)
  • Schedule a new job from the UI
  • Dive in to see more details about the job, like the json data
  • Requeue a job (clone the data and run immediately)
  • Delete jobs (Useful for cleaning up old completed jobs)
  • Search jobs by name and metadata (supports for quering mongo Object Id)
  • Pagination (Original version had limitiation to 200 results only)
  • Responsive UI

Screenshots

Dashboard

Auto-refresh list of jobs


Create jobs

See job details, requeue or delete jobs


Search by name, metadata, job status

Search for a job by name or metadata


Responsive UI

Mobile UI small devices

Mobile UI extra small devices


Requirements

A minimun Node.js version 12 is required for @hapi/@hapi dependency (see #23)

Troubleshooting

Index for sorting

It may be required to create the following index for faster sorting (see #24)

db.agendaJobs.ensureIndex({
    "nextRunAt" : -1,
    "lastRunAt" : -1,
    "lastFinishedAt" : -1
}, "agendash2")

Motivation

At Software On The Road we've been using agenda and agendash for almost every project since 2017 but it always had its limitation. And due to a critical security issue that we found on the server middleware, we decided to fork agendash and rewrote it from scratch. At first, we tried to just patch the existing code but it was written in backbone.js, so it would be more effort to learn it that just use vue.js to re-create the existing features. After all, this is just a simple CRUD with pagination and search, nothing fancy.

Roadmap

  • Improve default security
  • Compatibility with agenda v3
  • Polish backend so it is more efficient (MongoDB Aggregation queries were rewritten and optimized)
  • Mobile/Responsive UI
  • Get more test coverage
  • Add middlewares for KOA, fastify, and other express-like libraries
  • You decide! Submit a feature request

Install

npm install --save agendash2

Note: Agendash requires mongodb version >2.6.0 to perform the needed aggregate queries. This is your mongo database version, not your node package version! To check your database version, connect to mongo and run db.version().

Middleware usage

Agendash2 provides Express middleware you can use at a specified path, for example this will make Agendash2 available on your site at the /dash path. Note: Do not try to mount Agendash2 at the root level like app.use('/', Agendash(agenda)).

var express = require('express');
var app = express();

// ... your other express middleware like body-parser

var Agenda = require('agenda');
var Agendash = require('agendash2');

var agenda = new Agenda({db: {address: 'mongodb://127.0.0.1/agendaDb'}});
// or provide your own mongo client:
// var agenda = new Agenda({mongo: myMongoClient})

app.use('/dash', Agendash(agenda));

// ... your other routes

// ... start your server

By mounting Agendash2 as middleware on a specific path, you may provide your own authentication for that path. For example if you have an authenticated session using passport, you can protect the dashboard path like this:

app.use('/dash',
  function (req, res, next) {
    if (!req.user || !req.user.is_admin) {
      res.send(401);
    } else {
      next();
    }
  },
  Agendash(agenda)
);

Other middlewares will come soon in the folder /lib/middlewares/. You'll just have to update the last line to require the middleware you need:

app.use('/agendash', Agendash(agenda, {
  middleware: 'koa'
}));

Note that if you use a CSRF protection middleware like csurf, you might need to configure it off for Agendash-routes.

Standalone usage

Agendash comes with a standalone Express app which you can use like this:

./node_modules/.bin/agendash2 --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3001

or like this, for default collection agendaJobs and default port 3000:

./node_modules/.bin/agendash2 --db=mongodb://localhost/agendaDb

If you are using npm >= 5.2, then you can use npx:

npx agendash2 --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3001

agendash-v2's People

Contributors

alexkwolfe avatar bh-chaker avatar dependabot[bot] avatar ebourmalo avatar enubia avatar hugocornu avatar jframbach-nerdwallet avatar joeframbach avatar koresar avatar lgaticaq avatar luislobo avatar nico-code avatar omgimalexis avatar r0binxp avatar rapidia avatar renovate-bot avatar santiq avatar simison avatar simllll avatar umens avatar vziukas avatar wolfulus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agendash-v2's Issues

Data JSON parsing

Great job on the dashboard, I want to use it for my project but I have one issue that prevents me from doint it:
While creating job and passing data json, for example:
изображение

In database this json is saved like this:
"data" : "{\n \"test\":\"test\",\n \"test2\":\"test2\"\n}"
It saves all the new lines as "\n", and if there are tabs it's gonna save those aswell like "\t", so the job doesn't work like this and I have to parse inputs which adds mess to my code.
This doesn't happen in original agendash, passing same json saves it normally

Node minimum requirements

We are still currently using Node LTS 10.X. Trying to use this npm package I get the following:

[1/4] Resolving packages...
warning agendash2 > @hapi/hapi > @hapi/[email protected]: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
warning agendash2 > @hapi/hapi > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
warning agendash2 > @hapi/hapi > @hapi/joi > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
[2/4] Fetching packages...
error @hapi/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.0.0". Got "10.22.0"
error Found incompatible module.

I didn't see anywhere in the readme a minimum node version.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.