agendash 4.0.0 → 6.0.1

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 (71) 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 +10 -52
  31. package/Dockerfile +0 -23
  32. package/History.md +0 -118
  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 -341
  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 -233
  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 -248
  62. package/public/app/js/main.js +0 -283
  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/public/site.webmanifest +0 -1
  71. package/search.png +0 -0
@@ -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,233 +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
- .job-detail-dialog {
126
- max-width: calc(100vw - 1.75rem * 2);
127
- }
128
- .modal-body > * {
129
- flex: 0 1 auto;
130
- }
131
- .modal-body {
132
- display: flex;
133
- flex-flow: column;
134
- max-height: calc(100vh - 195px);
135
- }
136
-
137
- .json-editor {
138
- flex: 1 1 auto;
139
- }
140
- .card-responsive-title-container {
141
- display: flex;
142
- justify-content: space-between;
143
- align-items: center;
144
- }
145
- .card-responsive-name {
146
- font-weight: 500;
147
- line-height: 1.2;
148
- font-size: 1.25rem;
149
- }
150
- .card-responsive-status-title {
151
- color: grey;
152
- font-size: 14px;
153
- text-align: center;
154
- }
155
- .card-responsive-checkbox {
156
- width: 22px;
157
- height: 22px;
158
- }
159
- .material-icons-size {
160
- font-size: 25px;
161
- }
162
- .pill-own-card {
163
- display: flex;
164
- align-items: center;
165
- padding: 6px 10px
166
- }
167
- .pill-own-card-info {
168
- font-size: 12px!important;
169
- text-align: center;
170
- }
171
- @media (min-width: 768px) {
172
- .col-md-10 {
173
- flex: 0 0 70%;
174
- max-width: 70%;
175
- }
176
- .col-md-2 {
177
- flex: 0 0 30%;
178
- max-width: 30%;
179
- }
180
- }
181
- @media (min-width: 1150px) {
182
- .col-md-10 {
183
- flex: 0 0 80%;
184
- max-width: 80%;
185
- }
186
- .col-md-2 {
187
- flex: 0 0 20%;
188
- max-width: 20%;
189
- }
190
- }
191
-
192
- /* The sidebar menu */
193
- .sidebar-collapse {
194
- height: 100%;
195
- width: 0;
196
- position: fixed;
197
- z-index: 1;
198
- top: 0;
199
- left: 0;
200
- background-color: white;
201
- padding-top: 45px;
202
- transition: 0.5s;
203
- }
204
- .sidebar-collapse a {
205
- padding: 8px 8px 8px 32px;
206
- text-decoration: none;
207
- font-size: 25px;
208
- color: #818181;
209
- display: block;
210
- transition: 0.3s;
211
- }
212
- .sidebar-collapse a:hover {
213
- color: #f1f1f1;
214
- }
215
- .sidebar-collapse .closebtn {
216
- position: absolute;
217
- top: -10px;
218
- right: 25px;
219
- font-size: 36px;
220
- margin-left: 50px;
221
- }
222
- .slidebar-container-button {
223
- position: absolute;
224
- left: 85%;
225
- }
226
- .openbtn {
227
- font-size: 23px;
228
- cursor: pointer;
229
- background-color: #343a40;
230
- color: white;
231
- padding: 5px 0 0 0;
232
- border: none;
233
- }
@@ -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
- });
@@ -1,40 +0,0 @@
1
- const confirmRequeue = Vue.component("confirm-requeue", {
2
- props: ["job"],
3
- methods: {
4
- RequeueOne(id) {
5
- const url = `api/jobs/requeue`;
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");
12
- this.$emit("refresh-data");
13
- })
14
- .catch(console.log);
15
- },
16
- },
17
- template: `
18
- <div class="modal fade" id="modalRequeueSure" 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 requeue job</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-info" data-dismiss="modal" @click="RequeueOne(job.job._id)">Requeue Job</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 confirmRequeueMulti = Vue.component("confirm-multi-requeue", {
2
- props: ["jobs"],
3
- methods: {
4
- RequeueMulti(ids) {
5
- const url = `api/jobs/requeue`;
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");
12
- this.$emit("refresh-data");
13
- this.$emit("ready-clean");
14
- })
15
- .catch(console.log);
16
- },
17
- },
18
- template: `
19
- <div class="modal fade" id="modalRequeueSureMulti" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
20
- <!-- Modal -->
21
- <h1>MULTI</h1>
22
- <div class="modal-dialog" role="document">
23
- <div class="modal-content">
24
- <div class="modal-header">
25
- <h5 class="modal-title" id="exampleModalLabel">Confirm requeue job</h5>
26
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
27
- <span aria-hidden="true">&times;</span>
28
- </button>
29
- </div>
30
- <div class="modal-body">
31
- <div class="row px-3" v-for="job in jobs">
32
- <div class="col">
33
- <p>Job Id: {{job}}</p>
34
- </div>
35
- </div>
36
- </div>
37
- <div class="modal-footer">
38
- <button type="button" class="btn btn-info" data-dismiss="modal" @click="RequeueMulti(jobs)">Requeue Job</button>
39
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- `,
45
- });
@@ -1,8 +0,0 @@
1
- const popupmessage = Vue.component("popup-message", {
2
- props: ["job", "deletec", "requeuec", "createc"],
3
- template: `
4
- <div v-if="deletec" class="alert alert-success popupmessage">Job Deleted successfull</div>
5
- <div v-else-if="requeuec" class="alert alert-success popupmessage">Job Requeue successfull</div>
6
- <div v-else-if="createc" class="alert alert-success popupmessage">Job Created successfull</div>
7
- `,
8
- });
@@ -1,48 +0,0 @@
1
- const jobDetail = Vue.component("job-detail", {
2
- props: ["job"],
3
- filters: {
4
- formatJSON(jsonstr) {
5
- return JSON.stringify(jsonstr, null, 2);
6
- },
7
- },
8
- methods: {
9
- formatDate(date) {
10
- return moment(date).format("DD-MM-YYYY HH:mm:ss");
11
- },
12
- },
13
- template: `
14
- <div class="modal fade" id="modalData" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
15
- <!-- Modal -->
16
- <div class="modal-dialog job-detail-dialog" role="document">
17
- <div class="modal-content">
18
- <div class="modal-header">
19
- <h5 class="modal-title" id="exampleModalLabel">Job Data - {{job.job.name}}</h5>
20
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
21
- <span aria-hidden="true">&times;</span>
22
- </button>
23
- </div>
24
- <div class="modal-body">
25
- <div class="row my-3">
26
- <div class="col">
27
- <p><strong>Next run starts: </strong>{{ formatDate(job.job.nextRunAt) }}</p>
28
- <p><strong>Last run started: </strong>{{ formatDate(job.job.lastRunAt) }}</p>
29
- </div>
30
- </div>
31
- <p><strong>Metadata: </strong></p>
32
- <prism-editor class="json-editor" :lineNumbers="true" :readonly="true" :code="job.job.data | formatJSON" language="json"></prism-editor>
33
- <div v-if='job.failed' class="row mt-3">
34
- <div class="col pt-3 bg-danger text-light">
35
- <p><strong>Fail Count:</strong> {{job.job.failCount}}</p>
36
- <p><strong>Failed At:</strong> {{formatDate(job.job.failedAt)}}</p>
37
- <p><strong>Reason:</strong> {{job.job.failReason}}</p>
38
- </div>
39
- </div>
40
- </div>
41
- <div class="modal-footer">
42
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
- `,
48
- });