agendash 3.1.0 → 6.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 (70) hide show
  1. package/LICENSE.md +25 -0
  2. package/README.md +109 -200
  3. package/dist/AgendashController.d.ts +50 -0
  4. package/dist/AgendashController.js +176 -0
  5. package/dist/AgendashController.js.map +1 -0
  6. package/dist/csp.d.ts +1 -0
  7. package/dist/csp.js +15 -0
  8. package/dist/csp.js.map +1 -0
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.js +16 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/middlewares/express.d.ts +22 -0
  13. package/dist/middlewares/express.js +119 -0
  14. package/dist/middlewares/express.js.map +1 -0
  15. package/dist/middlewares/fastify.d.ts +18 -0
  16. package/dist/middlewares/fastify.js +129 -0
  17. package/dist/middlewares/fastify.js.map +1 -0
  18. package/dist/middlewares/hapi.d.ts +28 -0
  19. package/dist/middlewares/hapi.js +198 -0
  20. package/dist/middlewares/hapi.js.map +1 -0
  21. package/dist/middlewares/koa.d.ts +25 -0
  22. package/dist/middlewares/koa.js +139 -0
  23. package/dist/middlewares/koa.js.map +1 -0
  24. package/dist/types.d.ts +154 -0
  25. package/dist/types.js +2 -0
  26. package/dist/types.js.map +1 -0
  27. package/package.json +77 -62
  28. package/public/assets/index-CIdOb8D1.css +5 -0
  29. package/public/assets/index-Ct6Ovrls.js +17 -0
  30. package/public/index.html +11 -52
  31. package/public/site.webmanifest +8 -1
  32. package/Dockerfile +0 -23
  33. package/LICENSE +0 -21
  34. package/all-jobs.png +0 -0
  35. package/app.js +0 -23
  36. package/bin/agendash-standalone-fastify.js +0 -61
  37. package/bin/agendash-standalone-hapi.js +0 -60
  38. package/bin/agendash-standalone-koa.js +0 -56
  39. package/bin/agendash-standalone.js +0 -64
  40. package/create-job.png +0 -0
  41. package/entrypoint.sh +0 -5
  42. package/lib/controllers/agendash.js +0 -340
  43. package/lib/csp.js +0 -28
  44. package/lib/middlewares/README.md +0 -59
  45. package/lib/middlewares/express.js +0 -80
  46. package/lib/middlewares/fastify.js +0 -77
  47. package/lib/middlewares/hapi.js +0 -101
  48. package/lib/middlewares/koa.js +0 -77
  49. package/mobile-ui-sm.png +0 -0
  50. package/mobile-ui-xs.png +0 -0
  51. package/public/android-chrome-192x192.png +0 -0
  52. package/public/android-chrome-512x512.png +0 -0
  53. package/public/app/assets/ArgensdashV2Logo.svg +0 -18
  54. package/public/app/css/styles.css +0 -221
  55. package/public/app/js/confirmDelete.js +0 -40
  56. package/public/app/js/confirmDeleteMulti.js +0 -45
  57. package/public/app/js/confirmRequeue.js +0 -40
  58. package/public/app/js/confirmRequeueMulti.js +0 -45
  59. package/public/app/js/confirms.js +0 -8
  60. package/public/app/js/jobdetail.js +0 -48
  61. package/public/app/js/joblist.js +0 -239
  62. package/public/app/js/main.js +0 -275
  63. package/public/app/js/newJob.js +0 -89
  64. package/public/app/js/sidebar.js +0 -121
  65. package/public/app/js/topbar.js +0 -95
  66. package/public/apple-touch-icon.png +0 -0
  67. package/public/favicon-16x16.png +0 -0
  68. package/public/favicon-32x32.png +0 -0
  69. package/public/favicon.ico +0 -0
  70. package/search.png +0 -0
@@ -1,80 +0,0 @@
1
- const path = require("path");
2
- const express = require("express");
3
- const bodyParser = require("body-parser");
4
- const csp = require("../csp");
5
-
6
- module.exports = (agendash) => {
7
- const { api, requeueJobs, deleteJobs, createJob } = agendash;
8
- const app = express();
9
- app.use(bodyParser.json());
10
- app.use(bodyParser.urlencoded({ extended: false }));
11
-
12
- app.use((req, res, next) => {
13
- res.header("Content-Security-Policy", csp);
14
- next();
15
- });
16
-
17
- app.use("/", express.static(path.join(__dirname, "../../public")));
18
-
19
- app.get("/api", async (request, response) => {
20
- try {
21
- const {
22
- job,
23
- state,
24
- skip,
25
- limit,
26
- q,
27
- property,
28
- isObjectId,
29
- } = request.query;
30
- const apiResponse = await api(job, state, {
31
- query: q,
32
- property,
33
- isObjectId,
34
- skip,
35
- limit,
36
- });
37
- response.json(apiResponse);
38
- } catch (error) {
39
- response.status(400).json(error);
40
- }
41
- });
42
-
43
- app.post("/api/jobs/requeue", async (request, response) => {
44
- try {
45
- const newJobs = await requeueJobs(request.body.jobIds);
46
- response.send(newJobs);
47
- } catch (error) {
48
- response.status(404).json(error);
49
- }
50
- });
51
-
52
- app.post("/api/jobs/delete", async (request, response) => {
53
- try {
54
- const deleted = await deleteJobs(request.body.jobIds);
55
- if (deleted) {
56
- response.json({ deleted: true });
57
- } else {
58
- response.json({ message: "Jobs not deleted" });
59
- }
60
- } catch (error) {
61
- response.status(404).json(error);
62
- }
63
- });
64
-
65
- app.post("/api/jobs/create", async (request, response) => {
66
- try {
67
- await createJob(
68
- request.body.jobName,
69
- request.body.jobSchedule,
70
- request.body.jobRepeatEvery,
71
- request.body.jobData
72
- );
73
- response.json({ created: true });
74
- } catch (error) {
75
- response.status(400).json(error);
76
- }
77
- });
78
-
79
- return app;
80
- };
@@ -1,77 +0,0 @@
1
- const path = require("path");
2
- const csp = require("../csp");
3
-
4
- module.exports = (agendash) => (instance, opts, done) => {
5
- const { api, requeueJobs, deleteJobs, createJob } = agendash;
6
-
7
- instance.register(require("fastify-static"), {
8
- root: path.join(__dirname, "../../public"),
9
- });
10
-
11
- instance.get("/", function (req, reply) {
12
- reply.header("Content-Security-Policy", csp);
13
- return reply.sendFile("index.html");
14
- });
15
-
16
- instance.get("/api", async (request, response) => {
17
- try {
18
- const {
19
- job,
20
- state,
21
- skip,
22
- limit,
23
- q,
24
- property,
25
- isObjectId,
26
- } = request.query;
27
- const apiResponse = await api(job, state, {
28
- query: q,
29
- property,
30
- isObjectId,
31
- skip,
32
- limit,
33
- });
34
- response.send(apiResponse);
35
- } catch (error) {
36
- response.status(400).send(error);
37
- }
38
- });
39
-
40
- instance.post("/api/jobs/requeue", async (request, response) => {
41
- try {
42
- const newJobs = await requeueJobs(request.body.jobIds);
43
- response.send(newJobs);
44
- } catch (error) {
45
- response.status(404).send(error);
46
- }
47
- });
48
-
49
- instance.post("/api/jobs/delete", async (request, response) => {
50
- try {
51
- const deleted = await deleteJobs(request.body.jobIds);
52
- if (deleted) {
53
- response.send({ deleted: true });
54
- } else {
55
- response.send({ message: "Jobs not deleted" });
56
- }
57
- } catch (error) {
58
- response.status(404).send(error);
59
- }
60
- });
61
-
62
- instance.post("/api/jobs/create", async (request, response) => {
63
- try {
64
- await createJob(
65
- request.body.jobName,
66
- request.body.jobSchedule,
67
- request.body.jobRepeatEvery,
68
- request.body.jobData
69
- );
70
- response.send({ created: true });
71
- } catch (error) {
72
- response.status(400).send(error);
73
- }
74
- });
75
-
76
- done();
77
- };
@@ -1,101 +0,0 @@
1
- const path = require("path");
2
- const pack = require("../../package.json");
3
- const csp = require("../csp");
4
-
5
- module.exports = (agendash) => {
6
- const { api, requeueJobs, deleteJobs, createJob } = agendash;
7
- return {
8
- pkg: pack,
9
- register: (server, options) => {
10
- server.ext("onPreResponse", (req, h) => {
11
- req.response.header("Content-Security-Policy", csp);
12
- return h.continue;
13
- });
14
-
15
- server.route([
16
- {
17
- method: "GET",
18
- path: "/{param*}",
19
- handler: {
20
- directory: {
21
- path: path.join(__dirname, "../../public"),
22
- },
23
- },
24
- config: {
25
- auth: options.auth || false,
26
- },
27
- },
28
- {
29
- method: "GET",
30
- path: "/api",
31
- handler(request) {
32
- const {
33
- job,
34
- state,
35
- limit,
36
- skip,
37
- q,
38
- property,
39
- isObjectId,
40
- } = request.query;
41
- return api(job, state, {
42
- query: q,
43
- property,
44
- isObjectId,
45
- skip,
46
- limit,
47
- });
48
- },
49
- config: {
50
- auth: options.auth || false,
51
- },
52
- },
53
- {
54
- method: "POST",
55
- path: "/api/jobs/requeue",
56
- handler(request) {
57
- return requeueJobs(request.payload.jobIds);
58
- },
59
- config: {
60
- auth: options.auth || false,
61
- },
62
- },
63
- {
64
- method: "POST",
65
- path: "/api/jobs/delete",
66
- async handler(request, h) {
67
- const deleted = await deleteJobs(request.payload.jobIds);
68
- if (deleted) {
69
- return h.response({ deleted: true });
70
- }
71
-
72
- return h.code(404);
73
- },
74
- config: {
75
- auth: options.auth || false,
76
- },
77
- },
78
- {
79
- method: "POST",
80
- path: "/api/jobs/create",
81
- async handler(request, h) {
82
- const created = await createJob(
83
- request.payload.jobName,
84
- request.payload.jobSchedule,
85
- request.payload.jobRepeatEvery,
86
- request.payload.jobData
87
- );
88
- if (created) {
89
- return h.response({ created: true });
90
- }
91
-
92
- return h.code(404);
93
- },
94
- config: {
95
- auth: options.auth || false,
96
- },
97
- },
98
- ]);
99
- },
100
- };
101
- };
@@ -1,77 +0,0 @@
1
- const path = require("path");
2
- const bodyParser = require("koa-bodyparser");
3
- const Router = require("koa-router");
4
- const koaStatic = require("koa-static");
5
- const csp = require("../csp");
6
-
7
- module.exports = (agendash) => {
8
- const middlewares = [];
9
-
10
- middlewares.push(async (ctx, next) => {
11
- await next();
12
- ctx.set("Content-Security-Policy", csp);
13
- });
14
-
15
- middlewares.push(
16
- koaStatic(path.resolve(__dirname, "../../public"), { defer: true })
17
- );
18
-
19
- middlewares.push(bodyParser());
20
-
21
- const routerApi = new Router();
22
-
23
- routerApi.get("/api", async ({ response, query }) => {
24
- const { job, state, skip, limit, q, property, isObjectId } = query;
25
- try {
26
- response.body = await agendash.api(job, state, {
27
- query: q,
28
- property,
29
- isObjectId,
30
- skip,
31
- limit,
32
- });
33
- } catch (error) {
34
- response.status = 400;
35
- response.body = error;
36
- }
37
- });
38
-
39
- routerApi.post("/api/jobs/requeue", async ({ request, response }) => {
40
- try {
41
- response.body = await agendash.requeueJobs(request.body.jobIds);
42
- } catch (error) {
43
- response.status = 404;
44
- response.body = error;
45
- }
46
- });
47
-
48
- routerApi.post("/api/jobs/delete", async ({ request, response }) => {
49
- try {
50
- await agendash.deleteJobs(request.body.jobIds);
51
- response.body = {
52
- deleted: true,
53
- };
54
- } catch (error) {
55
- response.status = 404;
56
- response.body = error;
57
- }
58
- });
59
-
60
- routerApi.post("/api/jobs/create", async ({ request, response }) => {
61
- const { jobData, jobName, jobSchedule, jobRepeatEvery } = request.body;
62
-
63
- try {
64
- await agendash.createJob(jobName, jobSchedule, jobRepeatEvery, jobData);
65
- response.body = {
66
- created: true,
67
- };
68
- } catch (error) {
69
- response.status = 404;
70
- response.body = error;
71
- }
72
- });
73
-
74
- middlewares.push(routerApi.middleware());
75
-
76
- return middlewares;
77
- };
package/mobile-ui-sm.png DELETED
Binary file
package/mobile-ui-xs.png DELETED
Binary file
Binary file
Binary file
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 468.9 334.3" style="enable-background:new 0 0 468.9 334.3;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:#36A9E1;}
7
- .st1{fill:#FFFFFF;}
8
- .st2{fill:#FFCF02;}
9
- </style>
10
- <rect x="61.8" y="155.8" class="st0" width="46.6" height="159.2"/>
11
- <rect x="117.4" y="124.8" class="st0" width="46.6" height="190.2"/>
12
- <rect x="179.4" y="107.1" class="st1" width="46.6" height="207.9"/>
13
- <rect x="239.4" y="89.4" class="st1" width="46.6" height="225.6"/>
14
- <rect x="296.3" y="53.8" class="st0" width="46.6" height="261.2"/>
15
- <rect x="351.9" y="16.3" class="st0" width="46.6" height="298.7"/>
16
- <path class="st2" d="M178.8,241c9.4,16.8,26.6,28.8,46.6,31V150.1c-20.1,2.2-37.2,14.2-46.6,31V241z"/>
17
- <path class="st2" d="M238.8,150.1V272c20-2.1,37.1-13.8,46.6-30.4v-61.2C275.9,163.9,258.8,152.2,238.8,150.1z"/>
18
- </svg>
@@ -1,221 +0,0 @@
1
- :root{
2
- --secondary: #ffffff;
3
- --primary: #2b2b2b;
4
- --warning: rgb(255, 94, 0);
5
- --pill-own-time: #00b7ff;
6
- }
7
- * {
8
- font-family: 'Roboto', sans-serif;
9
- }
10
- .tittle {
11
- font-family: 'Days One', sans-serif;
12
- font-size: 22px;
13
- }
14
- .logo{
15
- margin-bottom: 12px;
16
- }
17
-
18
- /* width */
19
- ::-webkit-scrollbar {
20
- width: 10px;
21
- }
22
-
23
- /* Track */
24
- ::-webkit-scrollbar-track {
25
- background-color: rgb(202, 202, 202);
26
- box-shadow: inset 0 0 5px rgb(211, 211, 211);
27
- border-radius: 10px;
28
- }
29
-
30
- /* Handle */
31
- ::-webkit-scrollbar-thumb {
32
- background: rgb(65, 65, 65);
33
- border-radius: 10px;
34
- }
35
-
36
- /* Handle on hover */
37
- ::-webkit-scrollbar-thumb:hover {
38
- background: #000000;
39
- }
40
-
41
- body {
42
- overflow-y: hidden;
43
- }
44
-
45
- .sidebar, main {
46
- max-height: calc(100vh - 45px);
47
- overflow-y: scroll;
48
- }
49
-
50
- .joblist {
51
- overflow-y: scroll;
52
- }
53
- .sortable{
54
- float: right
55
- }
56
- .sortableinactive{
57
- float: right;
58
- opacity: 0.2;
59
- }
60
- .table-headers, .table-row {
61
- display: flex;
62
- justify-content: space-between;
63
- }
64
-
65
- .popupmessage{
66
- width: 60vw;
67
- position: absolute;
68
- top: 30px;
69
- right: 10px;
70
- z-index: 999999;
71
- }
72
- code {
73
- padding: 5px;
74
- background-color: #eeeeee;
75
- }
76
- .action-btn{
77
- margin: 0px;
78
- padding: 1px 2px;
79
- cursor: pointer;
80
- }
81
- .action-btn:hover{
82
- color: var(--warning-secondary);
83
- }
84
- .oi{
85
- top:0px !important;
86
- }
87
- .pill-own {
88
- padding: 3px 3px;
89
- font-size: 10px;
90
- color: var(--secondary);
91
- border-radius: 3px;
92
- }
93
- .pill-big-own {
94
- padding: 2px 2px;
95
- font-size: 13px;
96
- max-height: 23px;
97
- color: var(--secondary);
98
- border-radius: 3px;
99
- }
100
- .progress{
101
- height: 5px;
102
- }
103
- .md-custom {
104
- font-size: 21px;
105
- -webkit-font-smoothing: antialiased;
106
- -moz-osx-font-smoothing: grayscale;
107
- }
108
- .mybtn{
109
- cursor: pointer;
110
- }
111
- .mybtn:hover{
112
- background-color: rgb(218, 218, 218);
113
- }
114
-
115
- .pill-own span {
116
- line-height: 12px;
117
- font-size: 10px;
118
- font-style: normal;
119
- }
120
- .IcoInButton{
121
- font-size: 13px;
122
- margin: 0 2px;
123
- }
124
-
125
- .json-editor {
126
- height: 150px;
127
- }
128
- .card-responsive-title-container {
129
- display: flex;
130
- justify-content: space-between;
131
- align-items: center;
132
- }
133
- .card-responsive-name {
134
- font-weight: 500;
135
- line-height: 1.2;
136
- font-size: 1.25rem;
137
- }
138
- .card-responsive-status-title {
139
- color: grey;
140
- font-size: 14px;
141
- text-align: center;
142
- }
143
- .card-responsive-checkbox {
144
- width: 22px;
145
- height: 22px;
146
- }
147
- .material-icons-size {
148
- font-size: 25px;
149
- }
150
- .pill-own-card {
151
- display: flex;
152
- align-items: center;
153
- padding: 6px 10px
154
- }
155
- .pill-own-card-info {
156
- font-size: 12px!important;
157
- text-align: center;
158
- }
159
- @media (min-width: 768px) {
160
- .col-md-10 {
161
- flex: 0 0 70%;
162
- max-width: 70%;
163
- }
164
- .col-md-2 {
165
- flex: 0 0 30%;
166
- max-width: 30%;
167
- }
168
- }
169
- @media (min-width: 1150px) {
170
- .col-md-10 {
171
- flex: 0 0 80%;
172
- max-width: 80%;
173
- }
174
- .col-md-2 {
175
- flex: 0 0 20%;
176
- max-width: 20%;
177
- }
178
- }
179
-
180
- /* The sidebar menu */
181
- .sidebar-collapse {
182
- height: 100%;
183
- width: 0;
184
- position: fixed;
185
- z-index: 1;
186
- top: 0;
187
- left: 0;
188
- background-color: white;
189
- padding-top: 45px;
190
- transition: 0.5s;
191
- }
192
- .sidebar-collapse a {
193
- padding: 8px 8px 8px 32px;
194
- text-decoration: none;
195
- font-size: 25px;
196
- color: #818181;
197
- display: block;
198
- transition: 0.3s;
199
- }
200
- .sidebar-collapse a:hover {
201
- color: #f1f1f1;
202
- }
203
- .sidebar-collapse .closebtn {
204
- position: absolute;
205
- top: -10px;
206
- right: 25px;
207
- font-size: 36px;
208
- margin-left: 50px;
209
- }
210
- .slidebar-container-button {
211
- position: absolute;
212
- left: 85%;
213
- }
214
- .openbtn {
215
- font-size: 23px;
216
- cursor: pointer;
217
- background-color: #343a40;
218
- color: white;
219
- padding: 5px 0 0 0;
220
- border: none;
221
- }
@@ -1,40 +0,0 @@
1
- const confirmDelete = Vue.component("confirm-delete", {
2
- props: ["job"],
3
- methods: {
4
- deleteOne(id) {
5
- const url = `api/jobs/delete`;
6
- let body = { jobIds: [id] };
7
- return axios
8
- .post(url, body)
9
- .then((result) => result.data)
10
- .then((data) => {
11
- this.$emit("popup-message", "delete");
12
- this.$emit("refresh-data");
13
- })
14
- .catch(console.log);
15
- },
16
- },
17
- template: `
18
- <div class="modal fade" id="modalDeleteSure" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
19
- <!-- Modal -->
20
- <div class="modal-dialog" role="document">
21
- <div class="modal-content">
22
- <div class="modal-header">
23
- <h5 class="modal-title" id="exampleModalLabel">Confirm Delete Permanently</h5>
24
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
25
- <span aria-hidden="true">&times;</span>
26
- </button>
27
- </div>
28
- <div class="modal-body">
29
- <p>ID: {{job.job._id}}</p>
30
- <p>Name: {{job.job.name}}</p>
31
- </div>
32
- <div class="modal-footer">
33
- <button type="button" class="btn btn-danger" data-dismiss="modal" @click="deleteOne(job.job._id)">Delete</button>
34
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- `,
40
- });
@@ -1,45 +0,0 @@
1
- const confirmDeleteMulti = Vue.component("confirm-multi-delete", {
2
- props: ["jobs"],
3
- methods: {
4
- deleteMulti(ids) {
5
- const url = `api/jobs/delete`;
6
- let body = { jobIds: ids };
7
- return axios
8
- .post(url, body)
9
- .then((result) => result.data)
10
- .then((data) => {
11
- this.$emit("popup-message", "delete");
12
- this.$emit("refresh-data");
13
- })
14
- .catch(console.log);
15
- },
16
- },
17
- template: `
18
- <div class="modal fade" id="modalDeleteSureMulti" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
19
- <!-- Modal -->
20
- <h1>MULTI</h1>
21
- <div class="modal-dialog" role="document">
22
- <div class="modal-content">
23
- <div class="modal-header">
24
- <h5 class="modal-title" id="exampleModalLabel">Confirm Delete Permanently</h5>
25
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
26
- <span aria-hidden="true">&times;</span>
27
- </button>
28
- </div>
29
- <div class="modal-body">
30
- <div class="row px-3" v-for="job in jobs">
31
- <div class="col">
32
- <p>Job Id: {{job}}</p>
33
- </div>
34
-
35
- </div>
36
- </div>
37
- <div class="modal-footer">
38
- <button type="button" class="btn btn-danger" data-dismiss="modal" @click="deleteMulti(jobs)">Delete</button>
39
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- `,
45
- });