agendash 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/Dockerfile +3 -2
  2. package/History.md +80 -58
  3. package/LICENSE +1 -1
  4. package/README.md +173 -49
  5. package/all-jobs.png +0 -0
  6. package/app.js +12 -7
  7. package/bin/agendash-standalone-fastify.js +61 -0
  8. package/bin/agendash-standalone-hapi.js +60 -0
  9. package/bin/agendash-standalone-koa.js +56 -0
  10. package/bin/agendash-standalone.js +47 -15
  11. package/create-job.png +0 -0
  12. package/entrypoint.sh +1 -1
  13. package/lib/controllers/agendash.js +340 -0
  14. package/lib/middlewares/README.md +12 -5
  15. package/lib/middlewares/express.js +58 -34
  16. package/lib/middlewares/fastify.js +75 -0
  17. package/lib/middlewares/hapi.js +65 -88
  18. package/lib/middlewares/koa.js +71 -0
  19. package/mobile-ui-sm.png +0 -0
  20. package/mobile-ui-xs.png +0 -0
  21. package/package.json +45 -36
  22. package/public/android-chrome-192x192.png +0 -0
  23. package/public/android-chrome-512x512.png +0 -0
  24. package/public/app/assets/ArgensdashV2Logo.svg +18 -0
  25. package/public/app/css/styles.css +221 -0
  26. package/public/app/js/confirmDelete.js +40 -0
  27. package/public/app/js/confirmDeleteMulti.js +45 -0
  28. package/public/app/js/confirmRequeue.js +40 -0
  29. package/public/app/js/confirmRequeueMulti.js +45 -0
  30. package/public/app/js/confirms.js +8 -0
  31. package/public/app/js/jobdetail.js +48 -0
  32. package/public/app/js/joblist.js +239 -0
  33. package/public/app/js/main.js +275 -0
  34. package/public/app/js/newJob.js +89 -0
  35. package/public/app/js/sidebar.js +121 -0
  36. package/public/app/js/topbar.js +95 -0
  37. package/public/apple-touch-icon.png +0 -0
  38. package/public/favicon-16x16.png +0 -0
  39. package/public/favicon-32x32.png +0 -0
  40. package/public/favicon.ico +0 -0
  41. package/public/index.html +40 -164
  42. package/public/site.webmanifest +1 -0
  43. package/search.png +0 -0
  44. package/.editorconfig +0 -7
  45. package/.travis.yml +0 -24
  46. package/job-details.png +0 -0
  47. package/lib/agendash.js +0 -295
  48. package/public/css/bootstrap-theme.css +0 -587
  49. package/public/css/bootstrap-theme.css.map +0 -1
  50. package/public/css/bootstrap-theme.min.css +0 -6
  51. package/public/css/bootstrap-theme.min.css.map +0 -1
  52. package/public/css/bootstrap.css +0 -6760
  53. package/public/css/bootstrap.css.map +0 -1
  54. package/public/css/bootstrap.min.css +0 -6
  55. package/public/css/bootstrap.min.css.map +0 -1
  56. package/public/css/dashboard.css +0 -94
  57. package/public/fonts/glyphicons-halflings-regular.eot +0 -0
  58. package/public/fonts/glyphicons-halflings-regular.svg +0 -288
  59. package/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  60. package/public/fonts/glyphicons-halflings-regular.woff +0 -0
  61. package/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  62. package/public/js/backbone-min.js +0 -2
  63. package/public/js/backbone-min.map +0 -1
  64. package/public/js/bootstrap.js +0 -2363
  65. package/public/js/bootstrap.min.js +0 -7
  66. package/public/js/jquery-2.2.0.min.js +0 -4
  67. package/public/js/lodash.min.js +0 -120
  68. package/public/js/main.js +0 -414
  69. package/public/js/moment.min.js +0 -7
  70. package/test/test-express.js +0 -98
  71. package/test/test-hapi.js +0 -104
  72. package/yarn.lock +0 -4412
package/test/test-hapi.js DELETED
@@ -1,104 +0,0 @@
1
- const test = require('ava');
2
- const supertest = require('supertest');
3
- const Hapi = require('hapi');
4
- const Agenda = require('agenda');
5
-
6
- const agenda = new Agenda().database('mongodb://127.0.0.1/agendash-test-db', 'agendash-test-collection');
7
-
8
- const server = Hapi.server({
9
- port: 3000,
10
- host: 'localhost'
11
- });
12
- server.register(require('inert'));
13
- server.register(require('../app')(agenda, {
14
- middleware: 'hapi'
15
- }));
16
-
17
- const request = supertest(server.listener);
18
-
19
- test.before.cb(t => {
20
- agenda.on('ready', () => {
21
- t.end();
22
- });
23
- });
24
-
25
- test.beforeEach(async () => {
26
- await agenda._collection.deleteMany({}, null);
27
- });
28
-
29
- test.serial('GET /api with no jobs should return the correct overview', async t => {
30
- const res = await request.get('/api');
31
-
32
- t.is(res.body.overview[0].displayName, 'All Jobs');
33
- t.is(res.body.jobs.length, 0);
34
- });
35
-
36
- test.serial('POST /api/jobs/create should confirm the job exists', async t => {
37
- const res = await request.post('/api/jobs/create')
38
- .send({
39
- jobName: 'Test Job',
40
- jobSchedule: 'in 2 minutes',
41
- jobRepeatEvery: '',
42
- jobData: {}
43
- })
44
- .set('Accept', 'application/json');
45
-
46
- t.true('created' in res.body);
47
-
48
- agenda._collection.count({}, null, (err, res) => {
49
- t.ifError(err);
50
- if (res !== 1) {
51
- throw new Error('Expected one document in database');
52
- }
53
- });
54
- });
55
-
56
- test.serial('POST /api/jobs/delete should delete the job', async t => {
57
- const job = await new Promise((resolve, reject) => {
58
- agenda.create('Test Job', {})
59
- .schedule('in 4 minutes')
60
- .save()
61
- .then(job => {
62
- resolve(job);
63
- })
64
- .catch(err => {
65
- reject(err);
66
- });
67
- });
68
-
69
- const res = await request.post('/api/jobs/delete')
70
- .send({
71
- jobIds: [job.attrs._id]
72
- })
73
- .set('Accept', 'application/json');
74
-
75
- t.true('deleted' in res.body);
76
-
77
- const count = await agenda._collection.count({}, null);
78
- t.is(count, 0);
79
- });
80
-
81
- test.serial('POST /api/jobs/requeue should requeue the job', async t => {
82
- const job = await new Promise((resolve, reject) => {
83
- agenda.create('Test Job', {})
84
- .schedule('in 4 minutes')
85
- .save()
86
- .then(job => {
87
- resolve(job);
88
- })
89
- .catch(err => {
90
- reject(err);
91
- });
92
- });
93
-
94
- const res = await request.post('/api/jobs/requeue')
95
- .send({
96
- jobIds: [job.attrs._id]
97
- })
98
- .set('Accept', 'application/json');
99
-
100
- t.false('newJobs' in res.body);
101
-
102
- const count = await agenda._collection.count({}, null);
103
- t.is(count, 2);
104
- });