@necrolab/dashboard 0.4.61 → 0.4.208

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 (133) hide show
  1. package/.prettierrc +1 -27
  2. package/.vscode/extensions.json +1 -1
  3. package/README.md +79 -43
  4. package/backend/api.js +48 -40
  5. package/backend/auth.js +3 -3
  6. package/backend/batching.js +1 -1
  7. package/backend/endpoints.js +77 -13
  8. package/backend/index.js +2 -2
  9. package/backend/mock-data.js +38 -29
  10. package/backend/mock-src/classes/logger.js +8 -8
  11. package/backend/mock-src/classes/utils.js +3 -7
  12. package/backend/mock-src/database.js +0 -0
  13. package/backend/mock-src/ticketmaster.js +79 -79
  14. package/backend/validator.js +2 -2
  15. package/config/configs.json +3 -2
  16. package/config/filter.json +3 -2
  17. package/index.html +10 -81
  18. package/index.js +1 -1
  19. package/package.json +25 -40
  20. package/postcss.config.js +1 -1
  21. package/postinstall.js +17 -98
  22. package/public/android-chrome-192x192.png +0 -0
  23. package/public/android-chrome-512x512.png +0 -0
  24. package/public/apple-touch-icon.png +0 -0
  25. package/public/favicon-16x16.png +0 -0
  26. package/public/favicon-32x32.png +0 -0
  27. package/public/favicon.ico +0 -0
  28. package/public/manifest.json +7 -12
  29. package/public/sw.js +2 -0
  30. package/public/workbox-49fdaf31.js +2 -0
  31. package/public/workbox-49fdaf31.js.map +1 -0
  32. package/public/workbox-88575b92.js +2 -0
  33. package/public/workbox-88575b92.js.map +1 -0
  34. package/public/workbox-a67a7b11.js +2 -0
  35. package/public/workbox-a67a7b11.js.map +1 -0
  36. package/public/workbox-d4314735.js +2 -0
  37. package/public/workbox-d4314735.js.map +1 -0
  38. package/public/workbox-e0f89ef3.js +2 -0
  39. package/public/workbox-e0f89ef3.js.map +1 -0
  40. package/run +9 -176
  41. package/src/App.vue +85 -498
  42. package/src/assets/css/_input.scss +99 -144
  43. package/src/assets/css/main.scss +99 -450
  44. package/src/assets/img/background.svg +2 -2
  45. package/src/assets/img/logo_icon.png +0 -0
  46. package/src/components/Auth/LoginForm.vue +11 -62
  47. package/src/components/Editors/Account/Account.vue +40 -116
  48. package/src/components/Editors/Account/AccountCreator.vue +39 -88
  49. package/src/components/Editors/Account/AccountView.vue +34 -102
  50. package/src/components/Editors/Account/CreateAccount.vue +32 -80
  51. package/src/components/Editors/Profile/CreateProfile.vue +83 -269
  52. package/src/components/Editors/Profile/Profile.vue +47 -132
  53. package/src/components/Editors/Profile/ProfileCountryChooser.vue +20 -82
  54. package/src/components/Editors/Profile/ProfileView.vue +34 -91
  55. package/src/components/Editors/TagLabel.vue +6 -67
  56. package/src/components/Filter/Filter.vue +72 -289
  57. package/src/components/Filter/FilterPreview.vue +30 -171
  58. package/src/components/Filter/PriceSortToggle.vue +4 -74
  59. package/src/components/Table/Header.vue +1 -1
  60. package/src/components/Table/Row.vue +1 -1
  61. package/src/components/Table/Table.vue +2 -19
  62. package/src/components/Tasks/CheckStock.vue +13 -28
  63. package/src/components/Tasks/Controls/DesktopControls.vue +17 -17
  64. package/src/components/Tasks/Controls/MobileControls.vue +45 -8
  65. package/src/components/Tasks/CreateTaskAXS.vue +73 -79
  66. package/src/components/Tasks/CreateTaskTM.vue +142 -94
  67. package/src/components/Tasks/MassEdit.vue +7 -9
  68. package/src/components/Tasks/QuickSettings.vue +55 -169
  69. package/src/components/Tasks/ScrapeVenue.vue +4 -7
  70. package/src/components/Tasks/Stats.vue +23 -52
  71. package/src/components/Tasks/Task.vue +136 -378
  72. package/src/components/Tasks/TaskView.vue +47 -107
  73. package/src/components/Tasks/Utilities.vue +6 -5
  74. package/src/components/icons/Bag.vue +1 -1
  75. package/src/components/icons/Loyalty.vue +1 -1
  76. package/src/components/icons/Mail.vue +2 -2
  77. package/src/components/icons/Play.vue +2 -2
  78. package/src/components/icons/Reload.vue +5 -4
  79. package/src/components/icons/Sandclock.vue +2 -2
  80. package/src/components/icons/Stadium.vue +1 -1
  81. package/src/components/icons/index.js +1 -24
  82. package/src/components/ui/Modal.vue +13 -105
  83. package/src/components/ui/Navbar.vue +38 -171
  84. package/src/components/ui/ReconnectIndicator.vue +55 -351
  85. package/src/components/ui/Splash.vue +35 -5
  86. package/src/components/ui/controls/CountryChooser.vue +62 -200
  87. package/src/components/ui/controls/atomic/Checkbox.vue +10 -119
  88. package/src/components/ui/controls/atomic/Dropdown.vue +39 -208
  89. package/src/components/ui/controls/atomic/MultiDropdown.vue +37 -300
  90. package/src/libs/Filter.js +170 -200
  91. package/src/registerServiceWorker.js +1 -1
  92. package/src/stores/connection.js +53 -51
  93. package/src/stores/logger.js +3 -11
  94. package/src/stores/sampleData.js +235 -207
  95. package/src/stores/ui.js +44 -112
  96. package/src/stores/utils.js +6 -90
  97. package/src/views/Accounts.vue +35 -44
  98. package/src/views/Console.vue +90 -341
  99. package/src/views/Editor.vue +123 -1176
  100. package/src/views/FilterBuilder.vue +251 -607
  101. package/src/views/Login.vue +14 -76
  102. package/src/views/Profiles.vue +25 -44
  103. package/src/views/Tasks.vue +100 -187
  104. package/static/offline.html +50 -192
  105. package/tailwind.config.js +26 -104
  106. package/vite.config.js +16 -73
  107. package/vue.config.js +32 -0
  108. package/workbox-config.js +11 -0
  109. package/artwork/image.png +0 -0
  110. package/dev-server.js +0 -136
  111. package/exit +0 -209
  112. package/jsconfig.json +0 -16
  113. package/src/assets/css/_utilities.scss +0 -388
  114. package/src/assets/img/background.svg.backup +0 -11
  115. package/src/components/icons/Check.vue +0 -5
  116. package/src/components/icons/Close.vue +0 -21
  117. package/src/components/icons/CloseX.vue +0 -5
  118. package/src/components/icons/Key.vue +0 -21
  119. package/src/components/icons/Pencil.vue +0 -21
  120. package/src/components/icons/Profile.vue +0 -18
  121. package/src/components/icons/Sell.vue +0 -21
  122. package/src/components/icons/Spinner.vue +0 -42
  123. package/src/components/icons/SquareCheck.vue +0 -18
  124. package/src/components/icons/SquareUncheck.vue +0 -18
  125. package/src/components/icons/Wildcard.vue +0 -18
  126. package/src/components/ui/controls/atomic/LoadingButton.vue +0 -45
  127. package/src/composables/useClickOutside.js +0 -21
  128. package/src/composables/useDropdownPosition.js +0 -174
  129. package/src/types/index.js +0 -41
  130. package/src/utils/debug.js +0 -1
  131. package/switch-branch.sh +0 -41
  132. package/workbox-config.cjs +0 -63
  133. /package/src/assets/img/{logo_icon-old.png → logo_icon_2.png} +0 -0
@@ -2,16 +2,13 @@ import { useUIStore } from "@/stores/ui";
2
2
  import WebsocketHeartbeatJs from "websocket-heartbeat-js";
3
3
  import { decode } from "@msgpack/msgpack";
4
4
  import router from "@/router/index";
5
- import { sortTaskIds } from "@/stores/utils";
6
5
 
7
6
  export class ConnectionHandler {
8
7
  handleWebsocketMessages(msg) {
9
8
  switch (msg.event) {
10
9
  case "startup":
11
- if (msg.done) {
12
- this.ui.hideSpinner();
13
- this.ui.setBotVersion(msg.version || "-");
14
- } else this.ui.startSpinner(msg.message || "Starting Bot");
10
+ if (msg.done) this.ui.hideSpinner();
11
+ else this.ui.startSpinner(msg.message || "Starting Bot");
15
12
  break;
16
13
 
17
14
  case "stop-all":
@@ -35,15 +32,10 @@ export class ConnectionHandler {
35
32
  break;
36
33
 
37
34
  case "init-tasks":
38
- var oldOrder = [...this.ui.taskIdOrder];
39
35
  this.ui.tasks = msg.tasks;
40
- var newIds = Object.keys(msg.tasks);
41
-
42
- var existingIds = oldOrder.filter((id) => newIds.includes(id));
43
- var missingTaskIds = newIds.filter((id) => !oldOrder.includes(id));
44
- missingTaskIds.sort(sortTaskIds);
45
-
46
- this.ui.taskIdOrder = [...existingIds, ...missingTaskIds];
36
+ for (const value of Object.values(msg.tasks)) {
37
+ if (!this.ui.taskIdOrder.includes(value.taskId)) this.ui.taskIdOrder.push(value.taskId);
38
+ }
47
39
  this.ui.refreshQueueStats();
48
40
  this.ui.hideSpinner();
49
41
  break;
@@ -70,42 +62,19 @@ export class ConnectionHandler {
70
62
 
71
63
  case "add-task":
72
64
  this.ui.tasks[msg.task.taskId] = msg.task;
73
-
74
- if (!this.ui.taskIdOrder.includes(msg.task.taskId)) {
75
- let pos = this.ui.taskIdOrder.length;
76
- for (let i = 0; i < this.ui.taskIdOrder.length; i++) {
77
- if (sortTaskIds(msg.task.taskId, this.ui.taskIdOrder[i]) < 0) {
78
- pos = i;
79
- break;
80
- }
81
- }
82
- this.ui.taskIdOrder.splice(pos, 0, msg.task.taskId);
83
- }
84
-
65
+ if (!this.ui.taskIdOrder.includes(msg.task.taskId)) this.ui.taskIdOrder.push(msg.task.taskId);
85
66
  this.ui.toggleSort();
86
67
  this.ui.showSuccess("Created 1 task!");
87
68
  this.ui.refreshQueueStats();
88
69
  break;
89
70
 
90
71
  case "add-tasks":
91
- var batchTaskIds = Object.keys(msg.tasks).sort(sortTaskIds);
92
-
93
- for (const id of batchTaskIds) {
94
- const value = msg.tasks[id];
95
- this.ui.tasks[id] = value;
96
-
97
- if (!this.ui.taskIdOrder.includes(id)) {
98
- let pos = this.ui.taskIdOrder.length;
99
- for (let i = 0; i < this.ui.taskIdOrder.length; i++) {
100
- if (sortTaskIds(id, this.ui.taskIdOrder[i]) < 0) {
101
- pos = i;
102
- break;
103
- }
104
- }
105
- this.ui.taskIdOrder.splice(pos, 0, id);
106
- }
72
+ for (const value of Object.values(msg.tasks)) {
73
+ if (!this.ui.taskIdOrder.includes(value.taskId)) this.ui.taskIdOrder.push(value.taskId);
74
+ this.ui.tasks[value.taskId] = value;
107
75
  }
108
- this.ui.showSuccess(`Created ${batchTaskIds.length} tasks!`);
76
+ this.ui.showSuccess(`Created ${Object.entries(msg.tasks).length} tasks!`);
77
+ this.ui.toggleSort();
109
78
  this.ui.refreshQueueStats();
110
79
  break;
111
80
 
@@ -164,7 +133,7 @@ export class ConnectionHandler {
164
133
  }
165
134
 
166
135
  case "add-account": {
167
- const exists = this.ui.accounts.findIndex((p) => p.id === msg.account.id);
136
+ const exists = this.ui.accounts.findIndex((p) => p._id === msg.account._id);
168
137
  if (exists !== -1) {
169
138
  Object.keys(msg.account).forEach((k) => (this.ui.accounts[exists][k] = msg.account[k]));
170
139
  } else this.ui.accounts.push(msg.account);
@@ -172,7 +141,7 @@ export class ConnectionHandler {
172
141
  }
173
142
 
174
143
  case "add-profile": {
175
- const exists = this.ui.profiles.findIndex((p) => p.id === msg.profile.id);
144
+ const exists = this.ui.profiles.findIndex((p) => p._id === msg.profile._id);
176
145
  if (exists !== -1) {
177
146
  Object.keys(msg.profile).forEach((k) => (this.ui.profiles[exists][k] = msg.profile[k]));
178
147
  } else this.ui.profiles.push(msg.profile);
@@ -180,7 +149,7 @@ export class ConnectionHandler {
180
149
  }
181
150
 
182
151
  case "delete-profile":
183
- this.ui.profiles = this.ui.profiles.filter((p) => p.id !== msg.profile.id);
152
+ this.ui.profiles = this.ui.profiles.filter((p) => p._id !== msg.profile._id);
184
153
  break;
185
154
 
186
155
  default:
@@ -191,7 +160,7 @@ export class ConnectionHandler {
191
160
 
192
161
  sendMessage(msg) {
193
162
  try {
194
- if (msg?.data) msg.data.module = this.ui.currentModule;
163
+ msg.module = this.ui.currentModule;
195
164
  this.socket.send(JSON.stringify(msg));
196
165
  } catch {
197
166
  this.ui.startSpinner("Reconnecting");
@@ -233,6 +202,7 @@ export class ConnectionHandler {
233
202
  // this.socket.addEventListener('message', );
234
203
  }
235
204
 
205
+ // tasks/continue: continue task manually
236
206
  sendContinueTask(taskId, continueType) {
237
207
  this.sendMessage({
238
208
  event: "tasks/continue",
@@ -243,6 +213,7 @@ export class ConnectionHandler {
243
213
  });
244
214
  }
245
215
 
216
+ // tasks/continue: continue task manually
246
217
  sendTasksChange(taskId) {
247
218
  this.sendMessage({
248
219
  event: "tasks/change",
@@ -252,6 +223,7 @@ export class ConnectionHandler {
252
223
  });
253
224
  }
254
225
 
226
+ // tasks/open: open browser
255
227
  sendTasksOpen(taskId) {
256
228
  this.sendMessage({
257
229
  event: "tasks/open",
@@ -261,6 +233,7 @@ export class ConnectionHandler {
261
233
  });
262
234
  }
263
235
 
236
+ // tasks/delete: delete task
264
237
  sendDeleteTask(taskId) {
265
238
  this.sendMessage({
266
239
  event: "tasks/delete",
@@ -270,13 +243,39 @@ export class ConnectionHandler {
270
243
  });
271
244
  }
272
245
 
246
+ // tasks/: get all tasks. Not used right now.
273
247
  sendGetTasks() {
274
248
  this.sendMessage({
275
- event: "tasks/get",
249
+ event: "tasks/",
250
+ data: {}
251
+ });
252
+ }
253
+
254
+ // tasks/start-all
255
+ sendStartAllTasks() {
256
+ this.sendMessage({
257
+ event: "tasks/start-all",
258
+ data: {}
259
+ });
260
+ }
261
+
262
+ // tasks/stop-all
263
+ sendStopAllTasks() {
264
+ this.sendMessage({
265
+ event: "tasks/stop-all",
266
+ data: {}
267
+ });
268
+ }
269
+
270
+ // tasks/delete-all
271
+ sendDeleteAllTasks() {
272
+ this.sendMessage({
273
+ event: "tasks/delete-all",
276
274
  data: {}
277
275
  });
278
276
  }
279
277
 
278
+ // tasks/start
280
279
  sendStartTask(taskId) {
281
280
  this.sendMessage({
282
281
  event: "tasks/start",
@@ -286,6 +285,7 @@ export class ConnectionHandler {
286
285
  });
287
286
  }
288
287
 
288
+ // tasks/stop
289
289
  sendStopTask(taskId) {
290
290
  this.sendMessage({
291
291
  event: "tasks/stop",
@@ -295,6 +295,7 @@ export class ConnectionHandler {
295
295
  });
296
296
  }
297
297
 
298
+ // tasks/add
298
299
  sendAddTask(task) {
299
300
  this.sendMessage({
300
301
  event: "tasks/add",
@@ -325,6 +326,7 @@ export class ConnectionHandler {
325
326
  });
326
327
  }
327
328
 
329
+ // mass-edit-presale-code
328
330
  sendMassEditPresaleCode(eventId, presaleCode) {
329
331
  this.sendMessage({
330
332
  event: "mass-edit-presale-code",
@@ -336,6 +338,7 @@ export class ConnectionHandler {
336
338
  this.ui.showSuccess("Editing presale codes");
337
339
  }
338
340
 
341
+ // scrape-map
339
342
  sendScrapeMap(eventId) {
340
343
  this.sendMessage({
341
344
  event: "scrape-map",
@@ -347,13 +350,12 @@ export class ConnectionHandler {
347
350
  this.ui.showSuccess("Scraping map");
348
351
  }
349
352
 
350
- sendCheckStock(eventId, presaleCode, eventDid, clOrigin) {
353
+ // check-stock
354
+ sendCheckStock(eventId, presaleCode) {
351
355
  this.sendMessage({
352
356
  event: "check-stock",
353
357
  data: {
354
358
  eventId: eventId,
355
- eventDid: eventDid,
356
- clOrigin: clOrigin,
357
359
  presaleCode: presaleCode,
358
360
  siteId: this.ui.currentCountry.siteId
359
361
  }
@@ -380,7 +382,7 @@ export class ConnectionHandler {
380
382
  sendDeleteProfile(id) {
381
383
  this.sendMessage({
382
384
  event: "profiles/delete",
383
- data: { id: id }
385
+ data: { _id: id }
384
386
  });
385
387
  }
386
388
 
@@ -18,6 +18,7 @@ const LOG_COLORS = {
18
18
  yellow: "color: #ffbb33; font-weight: bold", // Yellow
19
19
  reset: ""
20
20
  };
21
+
21
22
  class Logger {
22
23
  constructor() {
23
24
  this.ENABLED = true;
@@ -44,20 +45,11 @@ class Logger {
44
45
 
45
46
  args.unshift(timestamp);
46
47
 
47
- // Format objects for console output
48
- const formattedArgs = args.map((arg) => {
49
- if (typeof arg === "object" && arg !== null) {
50
- console.log(arg._value ? arg._value : arg);
51
- return arg;
52
- }
53
- return arg;
54
- });
55
-
56
48
  // For styled console output in browser
57
49
  if (style) {
58
- console.log(`%c${formattedArgs.join(" ")}`, style);
50
+ console.log(`%c${args.join(" ")}`, style);
59
51
  } else {
60
- console.log(...formattedArgs);
52
+ console.log(...args);
61
53
  }
62
54
  }
63
55