@necrolab/dashboard 0.4.38 → 0.4.40

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 (65) hide show
  1. package/.claude/settings.local.json +7 -1
  2. package/.prettierrc +14 -1
  3. package/backend/api.js +25 -16
  4. package/backend/auth.js +2 -2
  5. package/backend/batching.js +1 -1
  6. package/backend/endpoints.js +5 -5
  7. package/backend/index.js +2 -2
  8. package/backend/mock-data.js +27 -28
  9. package/backend/mock-src/classes/logger.js +5 -7
  10. package/backend/mock-src/classes/utils.js +3 -2
  11. package/backend/mock-src/ticketmaster.js +2 -2
  12. package/backend/validator.js +2 -2
  13. package/dev-server.js +136 -0
  14. package/index.html +1 -1
  15. package/index.js +1 -1
  16. package/package.json +8 -6
  17. package/postcss.config.js +1 -1
  18. package/postinstall.js +30 -16
  19. package/public/android-chrome-192x192.png +0 -0
  20. package/public/android-chrome-512x512.png +0 -0
  21. package/public/apple-touch-icon.png +0 -0
  22. package/public/favicon-16x16.png +0 -0
  23. package/public/favicon-32x32.png +0 -0
  24. package/public/favicon.ico +0 -0
  25. package/public/manifest.json +4 -4
  26. package/src/App.vue +471 -49
  27. package/src/assets/css/_input.scss +37 -37
  28. package/src/assets/css/main.scss +177 -30
  29. package/src/assets/img/logo_icon-old.png +0 -0
  30. package/src/assets/img/logo_icon.png +0 -0
  31. package/src/components/Auth/LoginForm.vue +12 -5
  32. package/src/components/Editors/Account/Account.vue +19 -19
  33. package/src/components/Editors/Account/AccountCreator.vue +53 -24
  34. package/src/components/Editors/Account/AccountView.vue +79 -17
  35. package/src/components/Editors/Account/CreateAccount.vue +47 -28
  36. package/src/components/Editors/Profile/Profile.vue +24 -24
  37. package/src/components/Editors/Profile/ProfileView.vue +67 -16
  38. package/src/components/Editors/TagLabel.vue +6 -7
  39. package/src/components/Filter/FilterPreview.vue +0 -4
  40. package/src/components/Table/Table.vue +15 -0
  41. package/src/components/Tasks/Controls/DesktopControls.vue +1 -1
  42. package/src/components/Tasks/CreateTaskAXS.vue +15 -15
  43. package/src/components/Tasks/CreateTaskTM.vue +5 -4
  44. package/src/components/Tasks/Stats.vue +22 -16
  45. package/src/components/Tasks/Task.vue +100 -81
  46. package/src/components/Tasks/TaskView.vue +25 -23
  47. package/src/components/Tasks/Utilities.vue +1 -1
  48. package/src/components/icons/Mail.vue +2 -2
  49. package/src/components/ui/Modal.vue +84 -15
  50. package/src/components/ui/Navbar.vue +118 -39
  51. package/src/components/ui/controls/atomic/Dropdown.vue +23 -3
  52. package/src/components/ui/controls/atomic/MultiDropdown.vue +43 -23
  53. package/src/stores/sampleData.js +89 -64
  54. package/src/stores/ui.js +30 -4
  55. package/src/views/Accounts.vue +2 -2
  56. package/src/views/Console.vue +276 -41
  57. package/src/views/Editor.vue +175 -28
  58. package/src/views/FilterBuilder.vue +45 -49
  59. package/src/views/Login.vue +134 -12
  60. package/src/views/Profiles.vue +8 -8
  61. package/src/views/Tasks.vue +51 -2
  62. package/tailwind.config.js +2 -2
  63. package/vite.config.js +34 -1
  64. package/vue.config.js +1 -1
  65. package/{workbox-config.js → workbox-config.cjs} +1 -4
@@ -44,7 +44,13 @@
44
44
  "Bash(npx eslint:*)",
45
45
  "Bash(cp:*)",
46
46
  "Bash(sed:*)",
47
- "Bash(true)"
47
+ "Bash(true)",
48
+ "Bash(./run build)",
49
+ "Bash(mv:*)",
50
+ "Bash(chown:*)",
51
+ "Bash(chmod:*)",
52
+ "Bash(timeout 10s npm run dev)",
53
+ "Bash(gtimeout:*)"
48
54
  ],
49
55
  "deny": []
50
56
  }
package/.prettierrc CHANGED
@@ -6,5 +6,18 @@
6
6
  "trailingComma": "none",
7
7
  "bracketSpacing": true,
8
8
  "arrowParens": "always",
9
- "printWidth": 120
9
+ "printWidth": 120,
10
+ "vueIndentScriptAndStyle": false,
11
+ "htmlWhitespaceSensitivity": "ignore",
12
+ "bracketSameLine": true,
13
+ "singleAttributePerLine": false,
14
+ "overrides": [
15
+ {
16
+ "files": "*.vue",
17
+ "options": {
18
+ "vueIndentScriptAndStyle": false,
19
+ "htmlWhitespaceSensitivity": "ignore"
20
+ }
21
+ }
22
+ ]
10
23
  }
package/backend/api.js CHANGED
@@ -1,18 +1,22 @@
1
- const enableWs = require("express-ws");
2
- const express = require("express");
3
- const cors = require("cors");
4
- const cookieParser = require("cookie-parser");
5
- const { encode } = require("@msgpack/msgpack");
6
- const fs = require("node:fs");
7
- const path = require("node:path");
8
-
9
- const { createLogger } = require("./mock-src/classes/logger");
10
- const utils = require("./mock-src/classes/utils");
11
-
12
- const Batcher = require("./batching");
13
- const endpoints = require("./endpoints");
14
- const authSystem = require("./auth");
15
- const { users } = require("./mock-data.js");
1
+ import enableWs from "express-ws";
2
+ import express from "express";
3
+ import cors from "cors";
4
+ import cookieParser from "cookie-parser";
5
+ import { encode } from "@msgpack/msgpack";
6
+ import fs from "node:fs";
7
+ import path from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
13
+ import { createLogger } from "./mock-src/classes/logger.js";
14
+ import utils from "./mock-src/classes/utils.js";
15
+
16
+ import Batcher from "./batching.js";
17
+ import endpoints from "./endpoints.js";
18
+ import authSystem from "./auth.js";
19
+ import { users } from "./mock-data.js";
16
20
 
17
21
  const logger = createLogger("WEB UI");
18
22
 
@@ -175,6 +179,11 @@ app.ws("/api/updates", async function (ws, req) {
175
179
  }
176
180
  });
177
181
 
182
+ // Root route - serve the main app
183
+ app.get("/", (req, res) => {
184
+ res.sendFile(path.join(__dirname, "../dist/index.html"));
185
+ });
186
+
178
187
  // catches vue reloads
179
188
  app.use(
180
189
  ["/login", "/console", "/editor", "/filter", "/profiles", "/accounts"],
@@ -420,7 +429,7 @@ app.get("/api/userconfig/balances", async (req, res) => {
420
429
  return res.send({ CapSolver: 100, TwoCaptcha: 40 });
421
430
  });
422
431
 
423
- module.exports = {
432
+ export default {
424
433
  start: async () => {
425
434
  // onChange = (await import('on-change')).default;
426
435
  app.listen(port, "0.0.0.0", () => {
package/backend/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- const crypto = require("node:crypto");
1
+ import crypto from "node:crypto";
2
2
 
3
3
  const generateAuthToken = () => {
4
4
  return crypto.randomUUID();
@@ -59,4 +59,4 @@ class Auth {
59
59
  }
60
60
  }
61
61
 
62
- module.exports = Auth;
62
+ export default Auth;
@@ -40,4 +40,4 @@ class Batcher {
40
40
  }
41
41
  }
42
42
 
43
- module.exports = Batcher;
43
+ export default Batcher;
@@ -1,8 +1,8 @@
1
- const { createLogger } = require("./mock-src/classes/logger");
2
- const TicketMaster = require("./mock-src/ticketmaster");
3
- const utils = require("./mock-src/classes/utils");
1
+ import { createLogger } from "./mock-src/classes/logger.js";
2
+ import TicketMaster from "./mock-src/ticketmaster.js";
3
+ import utils from "./mock-src/classes/utils.js";
4
4
 
5
- const validateTaskData = require("./validator");
5
+ import validateTaskData from "./validator.js";
6
6
  const logger = createLogger("WEB UI");
7
7
 
8
8
  const none = (v) => {
@@ -326,7 +326,7 @@ async function handleWebsocketMessage(msg) {
326
326
  }
327
327
  }
328
328
 
329
- module.exports = {
329
+ export default {
330
330
  continueTask,
331
331
  tasksOpen,
332
332
  deleteTask,
package/backend/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const { users, profiles, tmAccounts, axsAccounts } = require("./mock-data");
1
+ import { users, profiles, tmAccounts, axsAccounts } from "./mock-data.js";
2
2
 
3
3
  const Bot = {};
4
4
 
@@ -20,4 +20,4 @@ Bot.AXS = {
20
20
  Accounts: axsAccounts
21
21
  };
22
22
 
23
- module.exports = require("./api");
23
+ export { default } from "./api.js";
@@ -2,17 +2,17 @@ const users = [
2
2
  {
3
3
  event: "auth",
4
4
  botChannels: {
5
- splash: "950761407119511582",
6
- carts: "961558093832011807",
7
- checkouts: "1025407596120776794",
8
- declines: "1027868055696572508",
9
- stockChecker: "1099079655962722375",
10
- venueMaps: "1099125114450214973"
5
+ splash: "-",
6
+ carts: "-",
7
+ checkouts: "-",
8
+ declines: "-",
9
+ stockChecker: "-",
10
+ venueMaps: "-"
11
11
  },
12
12
  _id: "641a5292b561088b64fe390b",
13
- name: "admin",
13
+ name: "Admin",
14
14
  password: "admin",
15
- profilePicture: "https://avatars.githubusercontent.com/u/202437892?s=128",
15
+ profilePicture: "https://cdn.discordapp.com/avatars/435549216304267264/6cfd74ad7c5939a0bcbf218aa08be8cb.png",
16
16
  admin: true,
17
17
  proxyList: { checkout: "admin-proxies" },
18
18
  profileTags: ["Amex", "Citi", "Mercury", "Slash"],
@@ -44,23 +44,22 @@ const profile = {
44
44
  const profiles = [];
45
45
  for (let i = 0; i < 1000; i++) profiles.push({ ...profile, _id: i });
46
46
 
47
- module.exports = {
48
- users,
49
- profiles,
50
- tmAccounts: [
51
- {
52
- tags: ["admin"],
53
- _id: 1,
54
- password: "123",
55
- email: "tm@tm.com"
56
- }
57
- ],
58
- axsAccounts: [
59
- {
60
- tags: ["admin"],
61
- _id: 2,
62
- password: "123",
63
- email: "axs@axs.com"
64
- }
65
- ]
66
- };
47
+ export { users, profiles };
48
+
49
+ export const tmAccounts = [
50
+ {
51
+ tags: ["admin"],
52
+ _id: 1,
53
+ password: "123",
54
+ email: "tm@tm.com"
55
+ }
56
+ ];
57
+
58
+ export const axsAccounts = [
59
+ {
60
+ tags: ["admin"],
61
+ _id: 2,
62
+ password: "123",
63
+ email: "axs@axs.com"
64
+ }
65
+ ];
@@ -1,4 +1,4 @@
1
- const util = require("node:util");
1
+ import util from "node:util";
2
2
 
3
3
  const zeroPadding = (num, length) => String(num).padStart(length, "0");
4
4
 
@@ -103,10 +103,8 @@ class Logger {
103
103
  }
104
104
  }
105
105
 
106
- module.exports = {
107
- createLogger: (args) => {
108
- const logger = new Logger();
109
- logger.defaultArgs = typeof args == "string" ? [args] : typeof args == "object" ? args : undefined;
110
- return logger;
111
- }
106
+ export const createLogger = (args) => {
107
+ const logger = new Logger();
108
+ logger.defaultArgs = typeof args == "string" ? [args] : typeof args == "object" ? args : undefined;
109
+ return logger;
112
110
  };
@@ -1,7 +1,8 @@
1
+ import crypto from "node:crypto";
2
+
1
3
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2
- const crypto = require("node:crypto");
3
4
 
4
- module.exports = {
5
+ export default {
5
6
  pickAccount: () => {
6
7
  return "demo@email.com";
7
8
  },
@@ -1,6 +1,6 @@
1
- const { createLogger } = require("./classes/logger");
1
+ import { createLogger } from "./classes/logger.js";
2
2
 
3
- module.exports = class TicketMaster {
3
+ export default class TicketMaster {
4
4
  constructor(taskData) {
5
5
  this.taskId = taskData.taskId || "T-" + ++Bot.CurrentTaskId;
6
6
  this.logger = createLogger(this.taskId);
@@ -1,4 +1,4 @@
1
- const utils = require("./mock-src/classes/utils");
1
+ import utils from "./mock-src/classes/utils.js";
2
2
 
3
3
  const none = (v) => {
4
4
  return v === undefined;
@@ -59,4 +59,4 @@ const validateTaskData = (task) => {
59
59
  return task;
60
60
  };
61
61
 
62
- module.exports = validateTaskData;
62
+ export default validateTaskData;
package/dev-server.js ADDED
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createServer } from "vite";
4
+ import process from "process";
5
+ import { spawn } from "child_process";
6
+
7
+ // Start backend server with mock data
8
+ const startBackend = () => {
9
+ return new Promise((resolve, reject) => {
10
+ const backend = spawn("node", ["index.js"], {
11
+ stdio: ["inherit", "pipe", "pipe"],
12
+ env: { ...process.env, NODE_ENV: "development" }
13
+ });
14
+
15
+ let backendReady = false;
16
+
17
+ backend.stdout.on("data", (data) => {
18
+ const output = data.toString();
19
+
20
+ // Look for backend ready signal
21
+ if (output.includes("Web API started on port") || output.includes("8081")) {
22
+ backendReady = true;
23
+ resolve(backend);
24
+ }
25
+ });
26
+
27
+ backend.stderr.on("data", (data) => {
28
+ // Suppress error output unless it's critical
29
+ if (data.toString().includes("Error") || data.toString().includes("EADDRINUSE")) {
30
+ console.error("⚠️ Backend error:", data.toString().trim());
31
+ }
32
+ });
33
+
34
+ backend.on("error", (error) => {
35
+ reject(error);
36
+ });
37
+
38
+ backend.on("exit", (code) => {
39
+ if (code !== 0 && !backendReady) {
40
+ reject(new Error(`Backend failed to start`));
41
+ }
42
+ });
43
+
44
+ // Timeout fallback
45
+ setTimeout(() => {
46
+ if (!backendReady) {
47
+ resolve(backend);
48
+ }
49
+ }, 5000);
50
+ });
51
+ };
52
+
53
+ const startServer = async () => {
54
+ let backend;
55
+ let server;
56
+ let isShuttingDown = false;
57
+
58
+ // Cleanup function
59
+ const cleanup = () => {
60
+ if (isShuttingDown) return;
61
+ isShuttingDown = true;
62
+
63
+ console.log("\n👋 Goodbye!");
64
+ if (backend) {
65
+ backend.kill("SIGTERM");
66
+ setTimeout(() => backend.kill("SIGKILL"), 3000);
67
+ }
68
+ if (server) {
69
+ server.close();
70
+ }
71
+ process.exit(0);
72
+ };
73
+
74
+ // Handle cleanup on various exit signals
75
+ process.on("SIGINT", cleanup);
76
+ process.on("SIGTERM", cleanup);
77
+
78
+ try {
79
+ console.log("🚀 Starting Necro Dashboard...");
80
+
81
+ // Ensure proper permissions for Vite cache
82
+ try {
83
+ const fs = await import('node:fs');
84
+ const path = await import('node:path');
85
+ const cacheDir = path.resolve('./node_modules/.vite');
86
+ if (fs.existsSync(cacheDir)) {
87
+ fs.chmodSync(cacheDir, 0o755);
88
+ }
89
+ } catch (e) {
90
+ // Ignore permission errors
91
+ }
92
+
93
+ backend = await startBackend();
94
+
95
+ server = await createServer({
96
+ configFile: "./vite.config.js",
97
+ server: {
98
+ port: 5173,
99
+ strictPort: true,
100
+ host: true,
101
+ cors: true,
102
+ hmr: {
103
+ overlay: false
104
+ }
105
+ }
106
+ });
107
+
108
+ // Handle unhandled errors gracefully
109
+ process.on("uncaughtException", (error) => {
110
+ if (error.code === "ECONNRESET" || error.errno === -54) {
111
+ return; // Silently handle mobile reconnects
112
+ }
113
+ console.error("❌ Server error:", error.message);
114
+ });
115
+
116
+ process.on("unhandledRejection", (reason) => {
117
+ if (reason?.code === "ECONNRESET" || reason?.errno === -54) {
118
+ return; // Silently handle mobile reconnects
119
+ }
120
+ console.error("❌ Unhandled error:", reason?.message || reason);
121
+ });
122
+
123
+ await server.listen();
124
+
125
+ console.log("\n✨ Necro Dashboard is ready!");
126
+ console.log("🌐 Development: http://localhost:5173");
127
+ console.log("🌐 Staging: http://localhost:8081\n");
128
+ console.log("💀 Happy debugging");
129
+ console.log("\n\n👆 Press Ctrl+C to stop");
130
+ } catch (error) {
131
+ console.error("Failed to start server:", error);
132
+ process.exit(1);
133
+ }
134
+ };
135
+
136
+ startServer();
package/index.html CHANGED
@@ -96,7 +96,7 @@
96
96
  <!-- Preload critical PWA manifest -->
97
97
  <link rel="preload" as="fetch" href="/manifest.json" crossorigin />
98
98
  <link rel="manifest" href="/manifest.json" />
99
- <meta name="theme-color" content="rgba(28, 28, 49, 1)" />
99
+ <meta name="theme-color" content="#1a1b1e" />
100
100
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
101
101
 
102
102
  <!-- Prism.js for syntax highlighting -->
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- const api = require("./backend");
1
+ import api from "./backend/index.js";
2
2
  api.start();
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@necrolab/dashboard",
3
- "version": "0.4.38",
3
+ "version": "0.4.40",
4
+ "type": "module",
4
5
  "scripts": {
5
- "build": "rm -rf dist && vite build && npx workbox-cli generateSW workbox-config.js",
6
- "dev": "vite",
7
- "bot": "vite",
8
- "expose": "vite --host 0.0.0.0",
6
+ "build": "rm -rf dist && vite build && npx workbox-cli generateSW workbox-config.cjs",
7
+ "dev": "node dev-server.js",
8
+ "bot": "node dev-server.js",
9
+ "expose": "node dev-server.js",
9
10
  "postinstall": "node postinstall.js",
10
11
  "updaterenderer": "npm i @necrolab/tm-renderer@latest",
11
12
  "preview": "vite preview",
@@ -14,7 +15,7 @@
14
15
  "dependencies": {
15
16
  "@faker-js/faker": "^7.6.0",
16
17
  "@msgpack/msgpack": "^3.0.0-beta2",
17
- "@necrolab/tm-renderer": "^0.1.4",
18
+ "@necrolab/tm-renderer": "^0.1.7",
18
19
  "@vitejs/plugin-vue": "^5.2.1",
19
20
  "@vueuse/core": "^11.3.0",
20
21
  "autoprefixer": "^10.4.21",
@@ -24,6 +25,7 @@
24
25
  "dragselect": "^3.1.1",
25
26
  "express": "^4.21.2",
26
27
  "express-ws": "^5.0.2",
28
+ "ipaddr.js": "^2.2.0",
27
29
  "pinia": "^2.3.0",
28
30
  "postcss": "^8.4.49",
29
31
  "register-service-worker": "^1.7.2",
package/postcss.config.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  plugins: {
3
3
  tailwindcss: {},
4
4
  autoprefixer: {},
package/postinstall.js CHANGED
@@ -1,21 +1,35 @@
1
- const fs = require("node:fs");
2
- const { execSync } = require("node:child_process");
1
+ import fs from "node:fs";
2
+ import { execSync } from "node:child_process";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
3
5
 
4
- const path = require("node:path");
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
7
 
6
- console.log(__dirname);
8
+ console.log("🔧 Running postinstall build...");
7
9
 
8
- var vitePath = path.resolve(path.join(__dirname, "/../../vite/bin/vite.js"));
9
- console.log(vitePath);
10
- execSync(`node "${vitePath}" build`, {
11
- cwd: __dirname,
12
- stdio: "inherit"
13
- });
10
+ // Use npx to run vite instead of hardcoded path
11
+ try {
12
+ execSync(`npx vite build`, {
13
+ cwd: __dirname,
14
+ stdio: "inherit"
15
+ });
16
+ console.log("✅ Build completed successfully");
17
+ } catch (error) {
18
+ console.log("⚠️ Build failed, but continuing...");
19
+ }
14
20
 
15
- var oldPath = path.resolve("./dist/");
16
- var distPath = path.resolve(path.join(__dirname, "../../../dashboard/dist/"));
17
- fs.rmSync(distPath, {
18
- recursive: true
19
- });
21
+ // Only do file operations if we're in a nested structure
22
+ const distPath = path.resolve(path.join(__dirname, "../../../dashboard/dist/"));
23
+ const localDistPath = path.resolve("./dist/");
20
24
 
21
- fs.renameSync(oldPath, distPath);
25
+ if (fs.existsSync(localDistPath) && __dirname.includes("dashboard")) {
26
+ try {
27
+ if (fs.existsSync(distPath)) {
28
+ fs.rmSync(distPath, { recursive: true });
29
+ }
30
+ fs.renameSync(localDistPath, distPath);
31
+ console.log("📁 Moved dist folder");
32
+ } catch (error) {
33
+ console.log("⚠️ Could not move dist folder, but that's okay");
34
+ }
35
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
- "short_name": "Russonoro",
3
- "name": "Russonoro Labs",
2
+ "short_name": "Necro",
3
+ "name": "Necro Dashboard",
4
4
  "icons": [{
5
5
  "src": "/android-chrome-192x192.png",
6
6
  "type": "image/png",
@@ -20,8 +20,8 @@
20
20
  }
21
21
  ],
22
22
  "start_url": "/",
23
- "background_color": "#202036",
23
+ "background_color": "#1a1b1e",
24
24
  "display": "standalone",
25
25
  "scope": "/",
26
- "theme_color": "#202036"
26
+ "theme_color": "#1a1b1e"
27
27
  }