Skip to content

Commit 0e950e2

Browse files
committed
init monitoring ui
1 parent 2b5f814 commit 0e950e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4457
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/styles/app.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {}
22+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const createMockQueue = (name: string) => {
2+
let lastStats: Record<string, number> | null = null
3+
4+
function generateStats() {
5+
return {
6+
pending: Math.floor(Math.random() * 50),
7+
processing: Math.floor(Math.random() * 10),
8+
completed: Math.floor(Math.random() * 200),
9+
failed: Math.floor(Math.random() * 5),
10+
delayed: Math.floor(Math.random() * 5),
11+
cancelled: Math.floor(Math.random() * 2),
12+
}
13+
}
14+
15+
return {
16+
getConfig: () => ({
17+
name,
18+
maxTimeout: 30000,
19+
concurrency: 5,
20+
retryLimit: 3,
21+
}),
22+
getStats: () => {
23+
lastStats = generateStats()
24+
return lastStats
25+
},
26+
getJobs: () => {
27+
lastStats = generateStats()
28+
const now = Date.now()
29+
const jobs = []
30+
const statusList = Object.keys(lastStats) as (keyof typeof lastStats)[]
31+
let jobCounter = 1
32+
for (const status of statusList) {
33+
const count = lastStats[status] ?? 0
34+
for (let i = 0; i < count; i++) {
35+
const baseTime = now - i * 10000 - jobCounter * 1000
36+
jobs.push({
37+
id: `job-${baseTime}-${jobCounter}`,
38+
name: `${name}-job-${jobCounter}`,
39+
status,
40+
progress:
41+
status === "completed"
42+
? 100
43+
: status === "processing"
44+
? Math.floor(Math.random() * 80) + 10
45+
: 0,
46+
maxAttempts: 3,
47+
attempts: status === "failed" ? 3 : status === "processing" ? 2 : 1,
48+
createdAt: new Date(baseTime),
49+
processAt: new Date(baseTime + 1000),
50+
processedAt: ["processing", "completed", "failed", "cancelled"].includes(status)
51+
? new Date(baseTime + 2000)
52+
: null,
53+
failedAt: status === "failed" ? new Date(baseTime + 7000) : null,
54+
completedAt: status === "completed" ? new Date(baseTime + 8000) : null,
55+
})
56+
jobCounter++
57+
}
58+
}
59+
return jobs
60+
},
61+
get: (id: string) => ({
62+
id,
63+
status: "completed",
64+
createdAt: new Date(Date.now() - 60000).toISOString(),
65+
startedAt: new Date(Date.now() - 50000).toISOString(),
66+
completedAt: new Date(Date.now() - 10000).toISOString(),
67+
payload: { example: "payload data" },
68+
result: { success: true, data: "Job result" },
69+
error: null,
70+
retries: 0,
71+
}),
72+
}
73+
}
74+
75+
export default [
76+
createMockQueue("email-queue"),
77+
createMockQueue("video-processing-queue"),
78+
createMockQueue("data-import-queue"),
79+
createMockQueue("report-generation-queue"),
80+
createMockQueue("notification-queue"),
81+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import baseConfig, { restrictEnvAccess } from "@vorsteh-queue/eslint-config/base"
2+
import reactConfig from "@vorsteh-queue/eslint-config/react"
3+
4+
/** @type {import('typescript-eslint').Config} */
5+
export default [...baseConfig, ...reactConfig, ...restrictEnvAccess]
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "@vorsteh-queue/monitoring-ui",
3+
"description": "Monitoring UI for Vorsteh Queue",
4+
"keywords": [
5+
"vorsteh-queue",
6+
"queue",
7+
"jobs",
8+
"ui",
9+
"monitoring"
10+
],
11+
"homepage": "https://vorsteh-queue.dev",
12+
"bugs": "https://github.com/noxify/vorsteh-queue/issues",
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/noxify/vorsteh-queue.git",
16+
"directory": "packages/monitoring-ui"
17+
},
18+
"license": "MIT",
19+
"type": "module",
20+
"scripts": {
21+
"dev": "vite dev",
22+
"build": "vite build",
23+
"start": "node .output/server/index.mjs",
24+
"lint": "eslint .",
25+
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path ../../.prettierignore",
26+
"typecheck": "tsc --noEmit"
27+
},
28+
"files": [
29+
"dist/*"
30+
],
31+
"prettier": "@vorsteh-queue/prettier-config",
32+
"dependencies": {
33+
"@icons-pack/react-simple-icons": "13.8.0",
34+
"@radix-ui/react-accordion": "1.2.12",
35+
"@radix-ui/react-dialog": "1.1.15",
36+
"@radix-ui/react-dropdown-menu": "2.1.16",
37+
"@radix-ui/react-label": "2.1.8",
38+
"@radix-ui/react-scroll-area": "1.2.10",
39+
"@radix-ui/react-select": "2.2.6",
40+
"@radix-ui/react-separator": "1.1.8",
41+
"@radix-ui/react-slot": "1.2.4",
42+
"@radix-ui/react-switch": "1.2.6",
43+
"@radix-ui/react-tabs": "1.1.13",
44+
"@radix-ui/react-tooltip": "1.2.8",
45+
"@tanstack/devtools-vite": "0.3.11",
46+
"@tanstack/react-devtools": "0.8.1",
47+
"@tanstack/react-query": "5.90.7",
48+
"@tanstack/react-query-devtools": "5.90.2",
49+
"@tanstack/react-router": "1.135.0",
50+
"@tanstack/react-router-devtools": "1.135.0",
51+
"@tanstack/react-router-ssr-query": "1.135.0",
52+
"@tanstack/react-start": "1.135.1",
53+
"@tanstack/react-table": "8.21.3",
54+
"class-variance-authority": "0.7.1",
55+
"clsx": "2.1.1",
56+
"date-fns": "^4.1.0",
57+
"jiti": "2.6.1",
58+
"lucide-react": "0.553.0",
59+
"next-themes": "0.4.6",
60+
"react": "19.2.0",
61+
"react-dom": "19.2.0",
62+
"redaxios": "0.5.1",
63+
"sonner": "2.0.7",
64+
"tailwind-merge": "3.4.0",
65+
"vaul": "1.1.2",
66+
"zod": "4.1.12"
67+
},
68+
"devDependencies": {
69+
"@tailwindcss/postcss": "4.1.17",
70+
"@tailwindcss/vite": "4.1.17",
71+
"@tanstack/nitro-v2-vite-plugin": "1.133.19",
72+
"@types/node": "22.19.0",
73+
"@types/react": "19.2.2",
74+
"@types/react-dom": "19.2.2",
75+
"@vitejs/plugin-react": "5.1.0",
76+
"@vorsteh-queue/core": "workspace:*",
77+
"@vorsteh-queue/eslint-config": "workspace:*",
78+
"@vorsteh-queue/prettier-config": "workspace:*",
79+
"postcss": "8.5.6",
80+
"tailwindcss": "4.1.17",
81+
"tw-animate-css": "1.4.0",
82+
"typescript": "5.9.3",
83+
"vite": "npm:rolldown-vite@latest",
84+
"vite-tsconfig-paths": "5.1.4"
85+
}
86+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
5+
}
3.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)