77 Commits

Author SHA1 Message Date
2e722fd8e3 chore: bump version to 0.1.15 2026-05-22 17:24:10 +08:00
f8c8aeed40 fix: deploy tool push ke remote build bukan origin
Sebelumnya push ke origin (Gitea) dengan branch build/stg, seharusnya ke
remote build (GitHub) branch stg.
2026-05-22 17:23:48 +08:00
312aaf9dd8 chore: bump version to 0.1.14 2026-05-22 17:11:12 +08:00
7d879d1901 feat: add show/hide and copy for API keys on dev page
- Display client key and server key on Settings app cards with toggle
  visibility and copy button
- Hide API keys table in Desa Mandiri Keys tab behind toggle + copy
- Add eye toggle to password inputs in Add App and Edit API Config
  modals
- Backend now returns apiKey and clientApiKey in apps list endpoint
2026-05-22 17:10:36 +08:00
4464f42da3 chore: bump version to 0.1.13 2026-05-22 14:29:21 +08:00
0846ac924c feat: time range selector & area chart improvements
- Add 7D/30D/3M toggle on Daily Activity and Comparison Between Villages charts
- Switch LineChart to AreaChart with fillOpacity 0.4 for bold gradient fill
- Fix broken tooltip on all charts with custom dark card content
- Apply consistent chart style (tickLine, gridAxis, glow) to village detail page
- api.ts: getDailyActivity and getComparisonActivity now accept range param
2026-05-22 14:16:31 +08:00
91dead0082 fix: resolve 5 bugs on app overview page
- Migrate useQuery to useSWR for consistency (no mixed fetching)
- Fix trend badge: guard against undefined grid and NaN comparison
- Fix trend badge: hide when increase is exactly 0
- Fix version modal: use gridRef so background refetch cannot overwrite user edits
- ErrorDataTable: migrate to useSWR, expose refresh() via forwardRef so the
  refresh button at the top also reloads the error table
2026-05-22 12:15:42 +08:00
7808de0db3 docs: split CLAUDE.md into focused reference files
Move Common Commands to docs/COMMANDS.md and add docs/CONVENTIONS.md
for frontend patterns (SWR, filters, Mantine, routing, API URLs).
CLAUDE.md now only contains runtime rules and pointers.
2026-05-22 12:08:39 +08:00
0afc2e271a feat: improve logs page with debounce, action/village/date filters, and timestamp fix 2026-05-22 11:37:37 +08:00
603a0a04b7 feat: server-side filter, village filter, and sortable columns on users page 2026-05-22 11:17:38 +08:00
ed9f59f404 feat: add status and role filter on users page 2026-05-22 11:07:01 +08:00
b79c63a5e8 refactor: improve users page code quality
- extract shared UserFormFields component to eliminate form duplication between Add and Edit modals
- debounce search input (400ms) to prevent excessive API calls
- fix validation messages to show human-readable labels instead of internal field names
- fix pagination visibility condition (totalPage > 1)
- remove unused TbEdit import
2026-05-22 11:04:56 +08:00
4d5c2bf632 Merge pull request 'amalia/20-mei-26' (#24) from amalia/20-mei-26 into main
Reviewed-on: #24
2026-05-20 17:23:15 +08:00
c782f956e0 chore: bump version to 0.1.12 2026-05-20 14:08:35 +08:00
515ee01d53 chore: bump version to 0.1.11 2026-05-20 13:57:48 +08:00
058dd95b4f refactor: rename and reorder dev panel tabs for clarity
- Rename "API Keys" → "Desa Mandiri Keys" (tab + panel title + description)
- Rename "Settings" → "App Config" (tab + panel title)
- Move "Desa Mandiri Keys" to last position with a divider separator
- Import Divider from @mantine/core
2026-05-20 12:32:06 +08:00
ef2183ffb7 chore: bump version to 0.1.10 2026-05-19 15:40:05 +08:00
9afe9297e0 Merge pull request 'amalia/18-mei-26' (#23) from amalia/18-mei-26 into main
Reviewed-on: #23
2026-05-18 17:26:01 +08:00
f98fb51cfd feat: tambah field isApprover pada edit user modal 2026-05-18 16:42:32 +08:00
3b8eabc111 fix: gender select value M/F instead of Male/Female 2026-05-18 16:31:43 +08:00
88ddb7527e Merge pull request 'chore: bump version to 0.1.9' (#22) from amalia/15-mei-26 into main
Reviewed-on: #22
2026-05-15 14:22:43 +08:00
abca720f89 chore: bump version to 0.1.9 2026-05-15 11:51:57 +08:00
a69b0aad48 Merge pull request 'upd: setting api key sistem desa mandiri' (#21) from amalia/13-mei-26 into main
Reviewed-on: #21
2026-05-13 17:24:37 +08:00
2cb061ea7f upd: setting api key sistem desa mandiri 2026-05-13 17:23:27 +08:00
a53309bf15 Merge pull request 'amalia/12-mei-26' (#20) from amalia/12-mei-26 into main
Reviewed-on: #20
2026-05-12 17:24:25 +08:00
b75a51727b chore: bump version to 0.1.8 2026-05-12 15:00:59 +08:00
6fdcc7f6ec fix: import logo as asset instead of hardcoded /src path 2026-05-12 15:00:44 +08:00
48118cad40 chore: bump version to 0.1.7 2026-05-12 14:27:39 +08:00
3cf656951d Merge remote-tracking branch 'origin/build/stg' into amalia/12-mei-26 2026-05-12 14:27:33 +08:00
7ca78ad39d chore: bump version to 0.1.6 2026-05-12 14:27:12 +08:00
18f719f551 Merge remote-tracking branch 'build/stg' into amalia/12-mei-26 2026-05-12 14:26:49 +08:00
fced7d4c1c feat: show isDummy flag on village detail and list pages 2026-05-12 14:10:29 +08:00
b39d1d5099 fix: update reset filters button style and remove filter icon 2026-05-12 11:47:48 +08:00
1831e757cd Merge pull request 'amalia/07-mei-26' (#19) from amalia/07-mei-26 into main
Reviewed-on: #19
2026-05-07 17:36:54 +08:00
f926ab2701 feat: add colored top border to stats cards 2026-05-07 12:21:08 +08:00
032386a549 feat: redesign login and splash screen with playful visual lift 2026-05-07 12:08:34 +08:00
5e44aa9021 chore: bump version to 0.1.6 2026-05-07 11:14:03 +08:00
273e4041e8 Merge branch 'amalia/05-mei-26' into stg 2026-05-07 11:13:13 +08:00
f469faf740 fix: add Secure flag to session cookies in production 2026-05-07 11:12:30 +08:00
f3c90ba290 chore: bump version to 0.1.4 2026-05-07 11:11:25 +08:00
d898671be9 Merge pull request 'amalia/05-mei-26' (#18) from amalia/05-mei-26 into main
Reviewed-on: #18
2026-05-05 17:28:45 +08:00
aea1cc1be2 chore: bump version to 0.1.5 2026-05-05 14:21:05 +08:00
77ccf4cf33 Merge remote-tracking branch 'build/stg' into stg 2026-05-05 14:19:46 +08:00
a50a9d6456 chore: bump version to 0.1.4 2026-05-05 13:56:39 +08:00
031180c6ec chore: bump version to 0.1.3 2026-05-05 12:44:29 +08:00
a73dcb1e89 refactor: simplify app status and response shape in API
Derive status from app.active flag instead of maintenance/bugs heuristic.
Remove version, minVersion, and maintenance from list/detail response
as these are fetched separately via the grid overview endpoint.
2026-05-05 12:43:36 +08:00
ef852842b4 feat: improve UI/UX consistency across all dashboard pages
Apply uniform design system across all routes and components:
- Consistent header pattern with gradient-text titles, dimmed subtitles
- Loader type="dots" replacing text-based loading states
- Icon + text empty/error states with Paper+glass containers
- Full STATUS_COLOR/STATUS_LABEL maps for all BugStatus values
- dayjs timestamps, Tooltip on action icons, size="sm" on badges/pagination
- Modals with overlayProps blur and gradient save buttons
- Replace left-border Papers with clean Stack headers
- Translate all remaining Indonesian UI strings to English
- New monitoring-themed SVG logo and redesigned splash screen
2026-05-05 12:42:41 +08:00
ee543a16ad Merge pull request 'amalia/30-apr-26' (#17) from amalia/30-apr-26 into main
Reviewed-on: #17
2026-04-30 17:27:11 +08:00
6cc86dafd8 Merge branch 'amalia/30-apr-26' into stg 2026-04-30 16:01:06 +08:00
87ffc4ac7d chore: bump version to 0.1.2 2026-04-30 15:21:28 +08:00
722bca8a61 refactor: replace global API_KEY with per-app clientApiKey
Remove global API_KEY env var and its validation in checkAuth.
Auth via x-api-key now exclusively uses clientApiKey per-app
validated inline on POST /api/bugs.
2026-04-30 15:16:54 +08:00
6124ee5bf6 fix: show today timestamp as single line on activity logs 2026-04-30 14:57:27 +08:00
40a5f38eaf feat: add clientApiKey per-app for mobile bug submission 2026-04-30 13:50:29 +08:00
4e9d5964ae feat: merge url_api & api_key to App, add application settings page 2026-04-30 11:28:25 +08:00
e2ad6f9313 Merge pull request 'amalia/29-apr-26' (#16) from amalia/29-apr-26 into main
Reviewed-on: #16
2026-04-29 17:40:58 +08:00
83e8becaa3 upd: mcp json 2026-04-29 17:39:43 +08:00
73849304ae Merge branch 'stg' of https://github.com/bipprojectbali/monitoring-app into stg 2026-04-29 17:26:48 +08:00
6258c580a8 Merge branch 'amalia/29-apr-26' into stg 2026-04-29 17:24:52 +08:00
292e338a39 chore: bump version to 0.1.1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 17:12:18 +08:00
90280fcac7 chore: bump version to 0.1.1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 16:51:05 +08:00
a2c7be7cfa chore: bump version to 0.1.1 2026-04-29 16:38:19 +08:00
f44a8216bf fix: jalankan prisma migrate deploy otomatis jika ada pending migrations
Sebelumnya pipeline dibatalkan saat ada pending migrations.
Sekarang langsung deploy migrations lalu lanjut ke step berikutnya.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 16:26:35 +08:00
7609204a13 feat: tambah deploy pipeline tool di MCP deploy-stg
Tool baru `deploy` menjalankan full pipeline:
1. Cek pending migrations → batalkan jika ada
2. Version bump package.json ke tag baru
3. Commit + push ke build/stg
4. Trigger publish.yml → polling hingga selesai
5. Trigger re-pull.yml → polling hingga selesai
6. Cek version di STG_URL vs local untuk konfirmasi

Env baru: STG_URL (staging app URL), VERSION_PATH (default /api/system/version)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 16:12:22 +08:00
d3a4f97d0e feat: tambah MCP server deploy-stg untuk trigger GitHub workflow
- scripts/mcp-deploy.ts: MCP server dengan 2 tool:
  - publish: trigger publish.yml (build & push image stg)
  - repull: trigger re-pull.yml (redeploy stack di Portainer)
- .mcp.json: registrasi server dengan env GH_TOKEN, STACK_NAME, BASE_URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 16:01:16 +08:00
5050835d81 upd: tambah notifikasi success/error saat simpan Settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:54:38 +08:00
d17b49cf8f upd: gabungkan Settings menjadi 1 form dengan tombol Simpan Semua
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:51:51 +08:00
8bcb30a85b feat: tambah API Key Desa Plus ke Settings panel dan proxy
- Tambah kolom API_KEY_DESA_PLUS di CONFIG_DEFINITIONS (ditampilkan sebagai password field)
- Proxy otomatis menyertakan X-API-Key header jika API key sudah dikonfigurasi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:51:09 +08:00
ccc43e0c96 feat: runtime config via DB — ganti VITE_URL_API_DESA_PLUS dengan proxy
- Tambah model AppConfig (key-value) ke schema + migration
- Tambah GET/PUT /api/admin/config (DEVELOPER only)
- Tambah proxy /api/proxy/desa-plus/* yang baca URL dari DB
- Hapus VITE_URL_API_DESA_PLUS dari frontend, ganti semua URL desa-plus ke relative proxy path
- Aktifkan Settings tab di /dev dengan UI untuk set URL_API_DESA_PLUS

URL desa-plus kini bisa diubah via /dev → Settings tanpa rebuild image.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:47:21 +08:00
Amalia
21e2923c02 Merge pull request #1 from bipprojectbali/amalia/29-apr-26
Amalia/29 apr 26
2026-04-29 14:00:13 +08:00
b63117694b feat: add /api/system/version endpoint with changelog
Mengembalikan versi aplikasi, git commit hash, branch aktif, dan 20 commit terakhir untuk memverifikasi apakah staging/production sudah terupdate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 13:56:23 +08:00
dbbe53584c upd: sync compose.yml and .env.example with all env vars in env.ts
Add missing required vars: API_KEY, MINIO_*, and optional REDIS_URL, BUN_PUBLIC_BASE_URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 12:01:44 +08:00
06794524fd feat: block inactive users from login and fix activity log on dev operators
- Block inactive users on email/password login (403)
- Block inactive users on Google OAuth (redirect to account_disabled)
- Auto-logout inactive users on session check (deleteMany sessions)
- Delete sessions when user is deactivated via PATCH /api/operators/:id
- Add account_disabled error message on login page
- Show inactive indicator on users table with reactivate button
- Add createSystemLog calls to /api/admin/users role and activate endpoints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 11:58:31 +08:00
73aa9729b8 upd: remove Settings menu item from DashboardLayout user menu
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 11:39:13 +08:00
7c5a491ba9 upd: update role management descriptions and add USER role card
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 11:33:39 +08:00
3c6fac1943 feat: redesign /logs page with table UI and date range filter
- Replace timeline view with table layout (Time, Operator, Type, Message)
- Add date range filter using @mantine/dates DatePickerInput
- Add SegmentedControl for log type filter
- Disable App Logs and Settings menu on /dev
- Remove Activity Logs menu from /dev (moved to /logs)
- Add dateFrom/dateTo query params to /api/logs backend
- Import @mantine/dates/styles.css to fix datepicker styling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 11:27:05 +08:00
6b6e3f3430 Merge pull request 'amalia/28-apr-26' (#15) from amalia/28-apr-26 into main
Reviewed-on: #15
2026-04-28 17:37:18 +08:00
373198c7c4 Merge pull request 'amalia/27-apr-26' (#14) from amalia/27-apr-26 into main
Reviewed-on: #14
2026-04-28 10:19:12 +08:00
40 changed files with 3795 additions and 1828 deletions

View File

@@ -1,6 +1,7 @@
# App # App
PORT=3000 PORT=3000
NODE_ENV=development NODE_ENV=development
BUN_PUBLIC_BASE_URL=http://localhost:3000
# Dev Inspector # Dev Inspector
REACT_EDITOR=code REACT_EDITOR=code
@@ -13,12 +14,20 @@ DIRECT_URL=postgresql://user:password@localhost:5432/base-template
GOOGLE_CLIENT_ID= GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET= GOOGLE_CLIENT_SECRET=
# Role # Super Admin (comma-separated emails)
SUPER_ADMIN_EMAIL=admin@example.com SUPER_ADMIN_EMAIL=admin@example.com
# API Key for external clients (e.g. mobile apps) # API Key for external clients (e.g. mobile apps)
API_KEY=your-secret-api-key-here API_KEY=your-secret-api-key-here
# Telegram Notification (optional) # MinIO (object storage for bug report images)
TELEGRAM_NOTIFY_TOKEN= MINIO_ENDPOINT=
TELEGRAM_NOTIFY_CHAT_ID= MINIO_PORT=443
MINIO_USE_SSL=true
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_BUCKET=
MINIO_UPLOAD_DIR=bug-reports
# Redis (optional — enables App Logs feature on /dev)
REDIS_URL=

16
.mcp.json Normal file
View File

@@ -0,0 +1,16 @@
{
"mcpServers": {
"deploy-stg": {
"type": "stdio",
"command": "bun",
"args": ["scripts/mcp-deploy.ts"],
"env": {
"GH_TOKEN": "${GH_TOKEN}",
"STACK_NAME": "monitoring-app",
"BASE_URL": "https://api.github.com/repos/bipprojectbali/monitoring-app",
"STG_URL": "https://monitoring-stg.wibudev.com",
"VERSION_PATH": "/api/system/version"
}
}
}
}

View File

@@ -13,31 +13,9 @@ Default to Bun instead of Node.js everywhere:
- `bunx <pkg>` not `npx` - `bunx <pkg>` not `npx`
- Bun auto-loads `.env` — never use dotenv. - Bun auto-loads `.env` — never use dotenv.
## Common Commands ## Commands
```bash See @docs/COMMANDS.md
bun run dev # dev server with hot reload (bun --watch src/serve.ts)
bun run build # Vite production build
bun run start # production server (NODE_ENV=production)
bun run typecheck # tsc --noEmit
bun run lint # biome check src/
bun run lint:fix # biome check --write src/
# Database
bun run db:migrate # prisma migrate dev
bun run db:seed # seed demo data
bun run db:generate # regenerate prisma client
bun run db:studio # Prisma Studio GUI
bun run db:push # push schema without migration
# Tests
bun run test # all tests
bun run test:unit # tests/unit/
bun run test:integration # tests/integration/ — no server needed
bun run test:e2e # tests/e2e/ — requires Lightpanda Docker
```
Run a single test file: `bun test tests/integration/auth.test.ts`
## Architecture ## Architecture
@@ -50,3 +28,7 @@ See @docs/TESTING.md
## Dev Tools ## Dev Tools
See @docs/DEV_TOOLS.md See @docs/DEV_TOOLS.md
## Frontend Conventions
See @docs/CONVENTIONS.md

View File

@@ -13,6 +13,8 @@ RUN bunx prisma generate
# Build frontend (Vite → dist/) # Build frontend (Vite → dist/)
FROM prisma AS builder FROM prisma AS builder
ARG VITE_URL_API_DESA_PLUS
ENV VITE_URL_API_DESA_PLUS=$VITE_URL_API_DESA_PLUS
COPY . . COPY . .
RUN bun run build RUN bun run build

189
bun.lock
View File

@@ -8,15 +8,18 @@
"@elysiajs/eden": "^1.4.9", "@elysiajs/eden": "^1.4.9",
"@elysiajs/html": "^1.4.0", "@elysiajs/html": "^1.4.0",
"@elysiajs/swagger": "^1.3.1", "@elysiajs/swagger": "^1.3.1",
"@mantine/charts": "^9.0.0", "@mantine/charts": "^8.3.0",
"@mantine/core": "^8.3.18", "@mantine/core": "^8.3.18",
"@mantine/dates": "^8.3.0",
"@mantine/hooks": "^8.3.18", "@mantine/hooks": "^8.3.18",
"@mantine/modals": "^8.3.18", "@mantine/modals": "^8.3.18",
"@mantine/notifications": "^8.3.18", "@mantine/notifications": "^8.3.18",
"@modelcontextprotocol/sdk": "^1.29.0",
"@prisma/client": "6", "@prisma/client": "6",
"@tanstack/react-query": "^5.95.2", "@tanstack/react-query": "^5.95.2",
"@tanstack/react-router": "^1.168.10", "@tanstack/react-router": "^1.168.10",
"@xyflow/react": "^12.6.4", "@xyflow/react": "^12.6.4",
"dayjs": "^1.11.20",
"elkjs": "^0.9.3", "elkjs": "^0.9.3",
"elysia": "^1.4.28", "elysia": "^1.4.28",
"minio": "^8.0.7", "minio": "^8.0.7",
@@ -183,6 +186,8 @@
"@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="], "@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="],
"@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="],
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
@@ -197,10 +202,12 @@
"@kitajs/ts-html-plugin": ["@kitajs/ts-html-plugin@4.1.4", "", { "dependencies": { "chalk": "^5.6.2", "tslib": "^2.8.1", "yargs": "^18.0.0" }, "peerDependencies": { "@kitajs/html": "^4.2.10", "typescript": "^5.9.3" }, "bin": { "xss-scan": "dist/cli.js", "ts-html-plugin": "dist/cli.js" } }, "sha512-xK5mNrhnIy73kJFKx5yVGChJyWFRGmIaE0sjlVxVYllk5dyaEYVCrIh1N8AfnseEHka8gAqzPGW95HlkhDvnJA=="], "@kitajs/ts-html-plugin": ["@kitajs/ts-html-plugin@4.1.4", "", { "dependencies": { "chalk": "^5.6.2", "tslib": "^2.8.1", "yargs": "^18.0.0" }, "peerDependencies": { "@kitajs/html": "^4.2.10", "typescript": "^5.9.3" }, "bin": { "xss-scan": "dist/cli.js", "ts-html-plugin": "dist/cli.js" } }, "sha512-xK5mNrhnIy73kJFKx5yVGChJyWFRGmIaE0sjlVxVYllk5dyaEYVCrIh1N8AfnseEHka8gAqzPGW95HlkhDvnJA=="],
"@mantine/charts": ["@mantine/charts@9.0.0", "", { "peerDependencies": { "@mantine/core": "9.0.0", "@mantine/hooks": "9.0.0", "react": "^19.2.0", "react-dom": "^19.2.0", "recharts": ">=3.2.1" } }, "sha512-TnbjiT2tXZDAQWZrv/+Xu3JKYjPiTfO5jSIbcwnxZSVtLI+PIxA7zrSps+it/Nx3ch8GHpDizJ7UArC0UfmNkQ=="], "@mantine/charts": ["@mantine/charts@8.3.18", "", { "peerDependencies": { "@mantine/core": "8.3.18", "@mantine/hooks": "8.3.18", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x", "recharts": ">=2.13.3" } }, "sha512-oudif3EUH7Nb9DPm0abAPxpFYDWWjR3k2S5ll0/CcB+pJzlhwaBG19QwpOJaRA6VAvAXDDKOXCO4mi9XCEN78g=="],
"@mantine/core": ["@mantine/core@8.3.18", "", { "dependencies": { "@floating-ui/react": "^0.27.16", "clsx": "^2.1.1", "react-number-format": "^5.4.4", "react-remove-scroll": "^2.7.1", "react-textarea-autosize": "8.5.9", "type-fest": "^4.41.0" }, "peerDependencies": { "@mantine/hooks": "8.3.18", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-9tph1lTVogKPjTx02eUxDUOdXacPzK62UuSqb4TdGliI54/Xgxftq0Dfqu6XuhCxn9J5MDJaNiLDvL/1KRkYqA=="], "@mantine/core": ["@mantine/core@8.3.18", "", { "dependencies": { "@floating-ui/react": "^0.27.16", "clsx": "^2.1.1", "react-number-format": "^5.4.4", "react-remove-scroll": "^2.7.1", "react-textarea-autosize": "8.5.9", "type-fest": "^4.41.0" }, "peerDependencies": { "@mantine/hooks": "8.3.18", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-9tph1lTVogKPjTx02eUxDUOdXacPzK62UuSqb4TdGliI54/Xgxftq0Dfqu6XuhCxn9J5MDJaNiLDvL/1KRkYqA=="],
"@mantine/dates": ["@mantine/dates@8.3.18", "", { "dependencies": { "clsx": "^2.1.1" }, "peerDependencies": { "@mantine/core": "8.3.18", "@mantine/hooks": "8.3.18", "dayjs": ">=1.0.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-FHx5teJOhupI0gO2o5evtVYQEdqOjayOkLRhEQfB5Nc5DvcysfPfmNILGkc1Nrp9ZQeQWKLT9qr+CkcCXwHOaw=="],
"@mantine/hooks": ["@mantine/hooks@8.3.18", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-QoWr9+S8gg5050TQ06aTSxtlpGjYOpIllRbjYYXlRvZeTsUqiTbVfvQROLexu4rEaK+yy9Wwriwl9PMRgbLqPw=="], "@mantine/hooks": ["@mantine/hooks@8.3.18", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-QoWr9+S8gg5050TQ06aTSxtlpGjYOpIllRbjYYXlRvZeTsUqiTbVfvQROLexu4rEaK+yy9Wwriwl9PMRgbLqPw=="],
"@mantine/modals": ["@mantine/modals@8.3.18", "", { "peerDependencies": { "@mantine/core": "8.3.18", "@mantine/hooks": "8.3.18", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-JfPDS4549L314SxFPC1x6CbKwzh82OdnIzwgMxPCVNsWLKV2vEHHUH/fzUYj4Wli6IBrsW4cufjMj9BTj3hm3Q=="], "@mantine/modals": ["@mantine/modals@8.3.18", "", { "peerDependencies": { "@mantine/core": "8.3.18", "@mantine/hooks": "8.3.18", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-JfPDS4549L314SxFPC1x6CbKwzh82OdnIzwgMxPCVNsWLKV2vEHHUH/fzUYj4Wli6IBrsW4cufjMj9BTj3hm3Q=="],
@@ -209,6 +216,8 @@
"@mantine/store": ["@mantine/store@8.3.18", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-i+QRTLmZzLldea0egtUVnGALd6UMIu8jd44nrNWBSNIXJU/8B6rMlC6gyX+l4szopZSuOaaNJIXkqRdC1gQsVg=="], "@mantine/store": ["@mantine/store@8.3.18", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-i+QRTLmZzLldea0egtUVnGALd6UMIu8jd44nrNWBSNIXJU/8B6rMlC6gyX+l4szopZSuOaaNJIXkqRdC1gQsVg=="],
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="],
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.2", "", { "dependencies": { "@tybys/wasm-util": "^0.10.1" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw=="], "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.2", "", { "dependencies": { "@tybys/wasm-util": "^0.10.1" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw=="],
"@nodable/entities": ["@nodable/entities@2.1.0", "", {}, "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA=="], "@nodable/entities": ["@nodable/entities@2.1.0", "", {}, "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA=="],
@@ -359,10 +368,16 @@
"@xyflow/system": ["@xyflow/system@0.0.76", "", { "dependencies": { "@types/d3-drag": "^3.0.7", "@types/d3-interpolate": "^3.0.4", "@types/d3-selection": "^3.0.10", "@types/d3-transition": "^3.0.8", "@types/d3-zoom": "^3.0.8", "d3-drag": "^3.0.0", "d3-interpolate": "^3.0.1", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0" } }, "sha512-hvwvnRS1B3REwVDlWexsq7YQaPZeG3/mKo1jv38UmnpWmxihp14bW6VtEOuHEwJX2FvzFw8k77LyKSk/wiZVNA=="], "@xyflow/system": ["@xyflow/system@0.0.76", "", { "dependencies": { "@types/d3-drag": "^3.0.7", "@types/d3-interpolate": "^3.0.4", "@types/d3-selection": "^3.0.10", "@types/d3-transition": "^3.0.8", "@types/d3-zoom": "^3.0.8", "d3-drag": "^3.0.0", "d3-interpolate": "^3.0.1", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0" } }, "sha512-hvwvnRS1B3REwVDlWexsq7YQaPZeG3/mKo1jv38UmnpWmxihp14bW6VtEOuHEwJX2FvzFw8k77LyKSk/wiZVNA=="],
"accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
"acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="], "acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
"agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="],
"ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
"ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="],
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
@@ -399,6 +414,8 @@
"block-stream2": ["block-stream2@2.1.0", "", { "dependencies": { "readable-stream": "^3.4.0" } }, "sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg=="], "block-stream2": ["block-stream2@2.1.0", "", { "dependencies": { "readable-stream": "^3.4.0" } }, "sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg=="],
"body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="],
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
"browser-or-node": ["browser-or-node@2.1.1", "", {}, "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg=="], "browser-or-node": ["browser-or-node@2.1.1", "", {}, "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg=="],
@@ -409,8 +426,14 @@
"bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="], "bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="],
"bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
"c12": ["c12@3.1.0", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="], "c12": ["c12@3.1.0", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="],
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
"camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="], "camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="],
"caniuse-lite": ["caniuse-lite@1.0.30001782", "", {}, "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw=="], "caniuse-lite": ["caniuse-lite@1.0.30001782", "", {}, "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw=="],
@@ -437,12 +460,22 @@
"consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="], "consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="],
"content-disposition": ["content-disposition@1.1.0", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="],
"content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
"convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
"cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="], "cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="],
"cookie-es": ["cookie-es@2.0.0", "", {}, "sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg=="], "cookie-es": ["cookie-es@2.0.0", "", {}, "sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg=="],
"cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="],
"cors": ["cors@2.8.6", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="],
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
"cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="], "cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="],
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
@@ -481,6 +514,8 @@
"data-uri-to-buffer": ["data-uri-to-buffer@6.0.2", "", {}, "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw=="], "data-uri-to-buffer": ["data-uri-to-buffer@6.0.2", "", {}, "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw=="],
"dayjs": ["dayjs@1.11.20", "", {}, "sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ=="],
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
"decimal.js-light": ["decimal.js-light@2.5.1", "", {}, "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg=="], "decimal.js-light": ["decimal.js-light@2.5.1", "", {}, "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg=="],
@@ -493,6 +528,8 @@
"degenerator": ["degenerator@5.0.1", "", { "dependencies": { "ast-types": "^0.13.4", "escodegen": "^2.1.0", "esprima": "^4.0.1" } }, "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ=="], "degenerator": ["degenerator@5.0.1", "", { "dependencies": { "ast-types": "^0.13.4", "escodegen": "^2.1.0", "esprima": "^4.0.1" } }, "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ=="],
"depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
"dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
"destr": ["destr@2.0.5", "", {}, "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA=="], "destr": ["destr@2.0.5", "", {}, "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA=="],
@@ -509,6 +546,10 @@
"dotenv": ["dotenv@16.6.1", "", {}, "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="], "dotenv": ["dotenv@16.6.1", "", {}, "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="],
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
"effect": ["effect@3.18.4", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "fast-check": "^3.23.1" } }, "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA=="], "effect": ["effect@3.18.4", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "fast-check": "^3.23.1" } }, "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA=="],
"electron-to-chromium": ["electron-to-chromium@1.5.329", "", {}, "sha512-/4t+AS1l4S3ZC0Ja7PHFIWeBIxGA3QGqV8/yKsP36v7NcyUCl+bIcmw6s5zVuMIECWwBrAK/6QLzTmbJChBboQ=="], "electron-to-chromium": ["electron-to-chromium@1.5.329", "", {}, "sha512-/4t+AS1l4S3ZC0Ja7PHFIWeBIxGA3QGqV8/yKsP36v7NcyUCl+bIcmw6s5zVuMIECWwBrAK/6QLzTmbJChBboQ=="],
@@ -521,14 +562,24 @@
"empathic": ["empathic@2.0.0", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="], "empathic": ["empathic@2.0.0", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="],
"encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
"es-toolkit": ["es-toolkit@1.45.1", "", {}, "sha512-/jhoOj/Fx+A+IIyDNOvO3TItGmlMKhtX8ISAHKE90c4b/k1tqaqEZ+uUqfpU8DMnW5cgNJv606zS55jGvza0Xw=="], "es-toolkit": ["es-toolkit@1.45.1", "", {}, "sha512-/jhoOj/Fx+A+IIyDNOvO3TItGmlMKhtX8ISAHKE90c4b/k1tqaqEZ+uUqfpU8DMnW5cgNJv606zS55jGvza0Xw=="],
"esbuild": ["esbuild@0.27.4", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.4", "@esbuild/android-arm": "0.27.4", "@esbuild/android-arm64": "0.27.4", "@esbuild/android-x64": "0.27.4", "@esbuild/darwin-arm64": "0.27.4", "@esbuild/darwin-x64": "0.27.4", "@esbuild/freebsd-arm64": "0.27.4", "@esbuild/freebsd-x64": "0.27.4", "@esbuild/linux-arm": "0.27.4", "@esbuild/linux-arm64": "0.27.4", "@esbuild/linux-ia32": "0.27.4", "@esbuild/linux-loong64": "0.27.4", "@esbuild/linux-mips64el": "0.27.4", "@esbuild/linux-ppc64": "0.27.4", "@esbuild/linux-riscv64": "0.27.4", "@esbuild/linux-s390x": "0.27.4", "@esbuild/linux-x64": "0.27.4", "@esbuild/netbsd-arm64": "0.27.4", "@esbuild/netbsd-x64": "0.27.4", "@esbuild/openbsd-arm64": "0.27.4", "@esbuild/openbsd-x64": "0.27.4", "@esbuild/openharmony-arm64": "0.27.4", "@esbuild/sunos-x64": "0.27.4", "@esbuild/win32-arm64": "0.27.4", "@esbuild/win32-ia32": "0.27.4", "@esbuild/win32-x64": "0.27.4" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ=="], "esbuild": ["esbuild@0.27.4", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.4", "@esbuild/android-arm": "0.27.4", "@esbuild/android-arm64": "0.27.4", "@esbuild/android-x64": "0.27.4", "@esbuild/darwin-arm64": "0.27.4", "@esbuild/darwin-x64": "0.27.4", "@esbuild/freebsd-arm64": "0.27.4", "@esbuild/freebsd-x64": "0.27.4", "@esbuild/linux-arm": "0.27.4", "@esbuild/linux-arm64": "0.27.4", "@esbuild/linux-ia32": "0.27.4", "@esbuild/linux-loong64": "0.27.4", "@esbuild/linux-mips64el": "0.27.4", "@esbuild/linux-ppc64": "0.27.4", "@esbuild/linux-riscv64": "0.27.4", "@esbuild/linux-s390x": "0.27.4", "@esbuild/linux-x64": "0.27.4", "@esbuild/netbsd-arm64": "0.27.4", "@esbuild/netbsd-x64": "0.27.4", "@esbuild/openbsd-arm64": "0.27.4", "@esbuild/openbsd-x64": "0.27.4", "@esbuild/openharmony-arm64": "0.27.4", "@esbuild/sunos-x64": "0.27.4", "@esbuild/win32-arm64": "0.27.4", "@esbuild/win32-ia32": "0.27.4", "@esbuild/win32-x64": "0.27.4" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ=="],
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
"escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
"escodegen": ["escodegen@2.1.0", "", { "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2" }, "optionalDependencies": { "source-map": "~0.6.1" }, "bin": { "esgenerate": "bin/esgenerate.js", "escodegen": "bin/escodegen.js" } }, "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w=="], "escodegen": ["escodegen@2.1.0", "", { "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2" }, "optionalDependencies": { "source-map": "~0.6.1" }, "bin": { "esgenerate": "bin/esgenerate.js", "escodegen": "bin/escodegen.js" } }, "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w=="],
"esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],
@@ -537,12 +588,22 @@
"esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
"etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
"eventemitter3": ["eventemitter3@5.0.4", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="], "eventemitter3": ["eventemitter3@5.0.4", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="],
"events-universal": ["events-universal@1.0.1", "", { "dependencies": { "bare-events": "^2.7.0" } }, "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw=="], "events-universal": ["events-universal@1.0.1", "", { "dependencies": { "bare-events": "^2.7.0" } }, "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw=="],
"eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="],
"eventsource-parser": ["eventsource-parser@3.0.8", "", {}, "sha512-70QWGkr4snxr0OXLRWsFLeRBIRPuQOvt4s8QYjmUlmlkyTZkRqS7EDVRZtzU3TiyDbXSzaOeF0XUKy8PchzukQ=="],
"exact-mirror": ["exact-mirror@0.2.7", "", { "peerDependencies": { "@sinclair/typebox": "^0.34.15" }, "optionalPeers": ["@sinclair/typebox"] }, "sha512-+MeEmDcLA4o/vjK2zujgk+1VTxPR4hdp23qLqkWfStbECtAq9gmsvQa3LW6z/0GXZyHJobrCnmy1cdeE7BjsYg=="], "exact-mirror": ["exact-mirror@0.2.7", "", { "peerDependencies": { "@sinclair/typebox": "^0.34.15" }, "optionalPeers": ["@sinclair/typebox"] }, "sha512-+MeEmDcLA4o/vjK2zujgk+1VTxPR4hdp23qLqkWfStbECtAq9gmsvQa3LW6z/0GXZyHJobrCnmy1cdeE7BjsYg=="],
"express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
"express-rate-limit": ["express-rate-limit@8.4.1", "", { "dependencies": { "ip-address": "10.1.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-NGVYwQSAyEQgzxX1iCM978PP9AdO/hW93gMcF6ZwQCm+rFvLsBH6w4xcXWTcliS8La5EPRN3p9wzItqBwJrfNw=="],
"exsolve": ["exsolve@1.0.8", "", {}, "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA=="], "exsolve": ["exsolve@1.0.8", "", {}, "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA=="],
"extract-zip": ["extract-zip@2.0.1", "", { "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" }, "optionalDependencies": { "@types/yauzl": "^2.9.1" }, "bin": { "extract-zip": "cli.js" } }, "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg=="], "extract-zip": ["extract-zip@2.0.1", "", { "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" }, "optionalDependencies": { "@types/yauzl": "^2.9.1" }, "bin": { "extract-zip": "cli.js" } }, "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg=="],
@@ -551,8 +612,12 @@
"fast-decode-uri-component": ["fast-decode-uri-component@1.0.1", "", {}, "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="], "fast-decode-uri-component": ["fast-decode-uri-component@1.0.1", "", {}, "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="],
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
"fast-fifo": ["fast-fifo@1.3.2", "", {}, "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="], "fast-fifo": ["fast-fifo@1.3.2", "", {}, "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="],
"fast-uri": ["fast-uri@3.1.0", "", {}, "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA=="],
"fast-xml-builder": ["fast-xml-builder@1.1.5", "", { "dependencies": { "path-expression-matcher": "^1.1.3" } }, "sha512-4TJn/8FKLeslLAH3dnohXqE3QSoxkhvaMzepOIZytwJXZO69Bfz0HBdDHzOTOon6G59Zrk6VQ2bEiv1t61rfkA=="], "fast-xml-builder": ["fast-xml-builder@1.1.5", "", { "dependencies": { "path-expression-matcher": "^1.1.3" } }, "sha512-4TJn/8FKLeslLAH3dnohXqE3QSoxkhvaMzepOIZytwJXZO69Bfz0HBdDHzOTOon6G59Zrk6VQ2bEiv1t61rfkA=="],
"fast-xml-parser": ["fast-xml-parser@5.7.1", "", { "dependencies": { "@nodable/entities": "^2.1.0", "fast-xml-builder": "^1.1.5", "path-expression-matcher": "^1.5.0", "strnum": "^2.2.3" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-8Cc3f8GUGUULg34pBch/KGyPLglS+OFs05deyOlY7fL2MTagYPKrVQNmR1fLF/yJ9PH5ZSTd3YDF6pnmeZU+zA=="], "fast-xml-parser": ["fast-xml-parser@5.7.1", "", { "dependencies": { "@nodable/entities": "^2.1.0", "fast-xml-builder": "^1.1.5", "path-expression-matcher": "^1.5.0", "strnum": "^2.2.3" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-8Cc3f8GUGUULg34pBch/KGyPLglS+OFs05deyOlY7fL2MTagYPKrVQNmR1fLF/yJ9PH5ZSTd3YDF6pnmeZU+zA=="],
@@ -567,16 +632,28 @@
"filter-obj": ["filter-obj@1.1.0", "", {}, "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ=="], "filter-obj": ["filter-obj@1.1.0", "", {}, "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ=="],
"finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],
"forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],
"fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="],
"fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], "fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="],
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
"gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
"get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
"get-east-asian-width": ["get-east-asian-width@1.5.0", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="], "get-east-asian-width": ["get-east-asian-width@1.5.0", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="],
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"get-nonce": ["get-nonce@1.0.1", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="], "get-nonce": ["get-nonce@1.0.1", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="],
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
"get-stream": ["get-stream@5.2.0", "", { "dependencies": { "pump": "^3.0.0" } }, "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA=="], "get-stream": ["get-stream@5.2.0", "", { "dependencies": { "pump": "^3.0.0" } }, "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA=="],
"get-tsconfig": ["get-tsconfig@4.13.7", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q=="], "get-tsconfig": ["get-tsconfig@4.13.7", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q=="],
@@ -587,12 +664,24 @@
"glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
"hasown": ["hasown@2.0.3", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg=="],
"hono": ["hono@4.12.15", "", {}, "sha512-qM0jDhFEaCBb4TxoW7f53Qrpv9RBiayUHo0S52JudprkhvpjIrGoU1mnnr29Fvd1U335ZFPZQY1wlkqgfGXyLg=="],
"hookable": ["hookable@5.5.3", "", {}, "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ=="], "hookable": ["hookable@5.5.3", "", {}, "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ=="],
"http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
"http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], "http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="],
"https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
"iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
"ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
"immer": ["immer@10.2.0", "", {}, "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw=="], "immer": ["immer@10.2.0", "", {}, "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw=="],
@@ -615,14 +704,24 @@
"is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
"is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="],
"isbot": ["isbot@5.1.37", "", {}, "sha512-5bcicX81xf6NlTEV8rWdg7Pk01LFizDetuYGHx6d/f6y3lR2/oo8IfxjzJqn1UdDEyCcwT9e7NRloj8DwCYujQ=="], "isbot": ["isbot@5.1.37", "", {}, "sha512-5bcicX81xf6NlTEV8rWdg7Pk01LFizDetuYGHx6d/f6y3lR2/oo8IfxjzJqn1UdDEyCcwT9e7NRloj8DwCYujQ=="],
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
"jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="], "jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="],
"jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="],
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
"jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
"json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
"json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="],
"json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
"lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="], "lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
@@ -655,8 +754,14 @@
"lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="], "lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="],
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
"media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="],
"memoirist": ["memoirist@0.4.0", "", {}, "sha512-zxTgA0mSYELa66DimuNQDvyLq36AwDlTuVRbnQtB+VuTcKWm5Qc4z3WkSpgsFWHNhexqkIooqpv4hdcqrX5Nmg=="], "memoirist": ["memoirist@0.4.0", "", {}, "sha512-zxTgA0mSYELa66DimuNQDvyLq36AwDlTuVRbnQtB+VuTcKWm5Qc4z3WkSpgsFWHNhexqkIooqpv4hdcqrX5Nmg=="],
"merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="],
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
@@ -669,6 +774,8 @@
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],
"netmask": ["netmask@2.0.2", "", {}, "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg=="], "netmask": ["netmask@2.0.2", "", {}, "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg=="],
"node-fetch-native": ["node-fetch-native@1.6.7", "", {}, "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q=="], "node-fetch-native": ["node-fetch-native@1.6.7", "", {}, "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q=="],
@@ -681,8 +788,12 @@
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
"ohash": ["ohash@2.0.11", "", {}, "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="], "ohash": ["ohash@2.0.11", "", {}, "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="],
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
"once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
"openapi-types": ["openapi-types@12.1.3", "", {}, "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="], "openapi-types": ["openapi-types@12.1.3", "", {}, "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="],
@@ -691,8 +802,14 @@
"pac-resolver": ["pac-resolver@7.0.1", "", { "dependencies": { "degenerator": "^5.0.0", "netmask": "^2.0.2" } }, "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg=="], "pac-resolver": ["pac-resolver@7.0.1", "", { "dependencies": { "degenerator": "^5.0.0", "netmask": "^2.0.2" } }, "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg=="],
"parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
"path-expression-matcher": ["path-expression-matcher@1.5.0", "", {}, "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ=="], "path-expression-matcher": ["path-expression-matcher@1.5.0", "", {}, "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ=="],
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
"path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],
"pathe": ["pathe@1.1.2", "", {}, "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ=="], "pathe": ["pathe@1.1.2", "", {}, "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ=="],
"pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="], "pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="],
@@ -703,6 +820,8 @@
"picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], "picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="],
"pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="],
"pkg-types": ["pkg-types@2.3.0", "", { "dependencies": { "confbox": "^0.2.2", "exsolve": "^1.0.7", "pathe": "^2.0.3" } }, "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig=="], "pkg-types": ["pkg-types@2.3.0", "", { "dependencies": { "confbox": "^0.2.2", "exsolve": "^1.0.7", "pathe": "^2.0.3" } }, "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig=="],
"playwright": ["playwright@1.59.1", "", { "dependencies": { "playwright-core": "1.59.1" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw=="], "playwright": ["playwright@1.59.1", "", { "dependencies": { "playwright-core": "1.59.1" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw=="],
@@ -731,6 +850,8 @@
"prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="],
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
"proxy-agent": ["proxy-agent@6.5.0", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", "socks-proxy-agent": "^8.0.5" } }, "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A=="], "proxy-agent": ["proxy-agent@6.5.0", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", "socks-proxy-agent": "^8.0.5" } }, "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A=="],
"proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="],
@@ -741,8 +862,14 @@
"pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="], "pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="],
"qs": ["qs@6.15.1", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg=="],
"query-string": ["query-string@7.1.3", "", { "dependencies": { "decode-uri-component": "^0.2.2", "filter-obj": "^1.1.0", "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" } }, "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg=="], "query-string": ["query-string@7.1.3", "", { "dependencies": { "decode-uri-component": "^0.2.2", "filter-obj": "^1.1.0", "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" } }, "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg=="],
"range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
"raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],
"rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="], "rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="],
"react": ["react@19.2.4", "", {}, "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ=="], "react": ["react@19.2.4", "", {}, "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ=="],
@@ -781,24 +908,48 @@
"require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="],
"require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],
"reselect": ["reselect@5.1.1", "", {}, "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w=="], "reselect": ["reselect@5.1.1", "", {}, "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w=="],
"resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],
"rolldown": ["rolldown@1.0.0-rc.12", "", { "dependencies": { "@oxc-project/types": "=0.122.0", "@rolldown/pluginutils": "1.0.0-rc.12" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-x64": "1.0.0-rc.12", "@rolldown/binding-freebsd-x64": "1.0.0-rc.12", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.12", "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.12", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.12", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.12", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.12", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.12" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A=="], "rolldown": ["rolldown@1.0.0-rc.12", "", { "dependencies": { "@oxc-project/types": "=0.122.0", "@rolldown/pluginutils": "1.0.0-rc.12" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-x64": "1.0.0-rc.12", "@rolldown/binding-freebsd-x64": "1.0.0-rc.12", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.12", "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.12", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.12", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.12", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.12", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.12" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A=="],
"router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
"sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="], "sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="],
"scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
"semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], "semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],
"send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],
"seroval": ["seroval@1.5.1", "", {}, "sha512-OwrZRZAfhHww0WEnKHDY8OM0U/Qs8OTfIDWhUD4BLpNJUfXK4cGmjiagGze086m+mhI+V2nD0gfbHEnJjb9STA=="], "seroval": ["seroval@1.5.1", "", {}, "sha512-OwrZRZAfhHww0WEnKHDY8OM0U/Qs8OTfIDWhUD4BLpNJUfXK4cGmjiagGze086m+mhI+V2nD0gfbHEnJjb9STA=="],
"seroval-plugins": ["seroval-plugins@1.5.1", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-4FbuZ/TMl02sqv0RTFexu0SP6V+ywaIe5bAWCCEik0fk17BhALgwvUDVF7e3Uvf9pxmwCEJsRPmlkUE6HdzLAw=="], "seroval-plugins": ["seroval-plugins@1.5.1", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-4FbuZ/TMl02sqv0RTFexu0SP6V+ywaIe5bAWCCEik0fk17BhALgwvUDVF7e3Uvf9pxmwCEJsRPmlkUE6HdzLAw=="],
"serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
"side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
"side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="],
"side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
"side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
"smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="], "smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="],
"socks": ["socks@2.8.7", "", { "dependencies": { "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" } }, "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A=="], "socks": ["socks@2.8.7", "", { "dependencies": { "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" } }, "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A=="],
@@ -811,6 +962,8 @@
"split-on-first": ["split-on-first@1.1.0", "", {}, "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw=="], "split-on-first": ["split-on-first@1.1.0", "", {}, "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw=="],
"statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
"stream-chain": ["stream-chain@2.2.5", "", {}, "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA=="], "stream-chain": ["stream-chain@2.2.5", "", {}, "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA=="],
"stream-json": ["stream-json@1.9.1", "", { "dependencies": { "stream-chain": "^2.2.5" } }, "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw=="], "stream-json": ["stream-json@1.9.1", "", { "dependencies": { "stream-chain": "^2.2.5" } }, "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw=="],
@@ -853,6 +1006,8 @@
"to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
"toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
"token-types": ["token-types@6.1.2", "", { "dependencies": { "@borewit/text-codec": "^0.2.1", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww=="], "token-types": ["token-types@6.1.2", "", { "dependencies": { "@borewit/text-codec": "^0.2.1", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww=="],
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
@@ -861,6 +1016,8 @@
"type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
"type-is": ["type-is@2.0.1", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="],
"typed-query-selector": ["typed-query-selector@2.12.1", "", {}, "sha512-uzR+FzI8qrUEIu96oaeBJmd9E7CFEiQ3goA5qCVgc4s5llSubcfGHq9yUstZx/k4s9dXHVKsE35YWoFyvEqEHA=="], "typed-query-selector": ["typed-query-selector@2.12.1", "", {}, "sha512-uzR+FzI8qrUEIu96oaeBJmd9E7CFEiQ3goA5qCVgc4s5llSubcfGHq9yUstZx/k4s9dXHVKsE35YWoFyvEqEHA=="],
"typescript": ["typescript@6.0.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ=="], "typescript": ["typescript@6.0.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ=="],
@@ -869,6 +1026,8 @@
"undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="], "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
"unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
"unplugin": ["unplugin@2.3.11", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="], "unplugin": ["unplugin@2.3.11", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="],
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], "update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
@@ -887,6 +1046,8 @@
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
"victory-vendor": ["victory-vendor@37.3.6", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ=="], "victory-vendor": ["victory-vendor@37.3.6", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ=="],
"vite": ["vite@8.0.3", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.8", "rolldown": "1.0.0-rc.12", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.1.0", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ=="], "vite": ["vite@8.0.3", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.8", "rolldown": "1.0.0-rc.12", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.1.0", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ=="],
@@ -895,6 +1056,8 @@
"webpack-virtual-modules": ["webpack-virtual-modules@0.6.2", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="], "webpack-virtual-modules": ["webpack-virtual-modules@0.6.2", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="],
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
"wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], "wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
@@ -919,6 +1082,8 @@
"zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
"zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
"zustand": ["zustand@4.5.7", "", { "dependencies": { "use-sync-external-store": "^1.2.2" }, "peerDependencies": { "@types/react": ">=16.8", "immer": ">=9.0.6", "react": ">=16.8" }, "optionalPeers": ["@types/react", "immer", "react"] }, "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw=="], "zustand": ["zustand@4.5.7", "", { "dependencies": { "use-sync-external-store": "^1.2.2" }, "peerDependencies": { "@types/react": ">=16.8", "immer": ">=9.0.6", "react": ">=16.8" }, "optionalPeers": ["@types/react", "immer", "react"] }, "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw=="],
"@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
@@ -937,6 +1102,8 @@
"@tanstack/router-utils/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], "@tanstack/router-utils/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
"accepts/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
"anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], "anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],
"c12/chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], "c12/chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="],
@@ -949,6 +1116,10 @@
"escodegen/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "escodegen/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
"express/cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
"express/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
"giget/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], "giget/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
"nypm/citty": ["citty@0.2.1", "", {}, "sha512-kEV95lFBhQgtogAPlQfJJ0WGVSokvLr/UEoFPiKKOXF7pl98HfUVUD0ejsuTCld/9xH9vogSywZ5KqHzXrZpqg=="], "nypm/citty": ["citty@0.2.1", "", {}, "sha512-kEV95lFBhQgtogAPlQfJJ0WGVSokvLr/UEoFPiKKOXF7pl98HfUVUD0ejsuTCld/9xH9vogSywZ5KqHzXrZpqg=="],
@@ -961,14 +1132,20 @@
"prop-types/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], "prop-types/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],
"proxy-addr/ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
"readdirp/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], "readdirp/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],
"recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
"rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.12", "", {}, "sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw=="], "rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.12", "", {}, "sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw=="],
"send/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
"tsx/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "tsx/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
"type-is/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
"vite/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "vite/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
"yauzl/buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="], "yauzl/buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="],
@@ -983,8 +1160,16 @@
"@scalar/themes/@scalar/types/nanoid": ["nanoid@5.1.9", "", { "bin": { "nanoid": "bin/nanoid.js" } }, "sha512-ZUvP7KeBLe3OZ1ypw6dI/TzYJuvHP77IM4Ry73waSQTLn8/g8rpdjfyVAh7t1/+FjBtG4lCP42MEbDxOsRpBMw=="], "@scalar/themes/@scalar/types/nanoid": ["nanoid@5.1.9", "", { "bin": { "nanoid": "bin/nanoid.js" } }, "sha512-ZUvP7KeBLe3OZ1ypw6dI/TzYJuvHP77IM4Ry73waSQTLn8/g8rpdjfyVAh7t1/+FjBtG4lCP42MEbDxOsRpBMw=="],
"accepts/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
"c12/chokidar/readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], "c12/chokidar/readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="],
"express/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
"send/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
"type-is/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
"@kitajs/ts-html-plugin/yargs/cliui/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], "@kitajs/ts-html-plugin/yargs/cliui/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],
"@kitajs/ts-html-plugin/yargs/cliui/wrap-ansi": ["wrap-ansi@9.0.2", "", { "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", "strip-ansi": "^7.1.0" } }, "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww=="], "@kitajs/ts-html-plugin/yargs/cliui/wrap-ansi": ["wrap-ansi@9.0.2", "", { "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", "strip-ansi": "^7.1.0" } }, "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww=="],

View File

@@ -4,17 +4,30 @@ services:
container_name: monitoring-app-stg container_name: monitoring-app-stg
restart: unless-stopped restart: unless-stopped
environment: environment:
# App
- PORT=${PORT:-3000}
- NODE_ENV=${NODE_ENV:-production}
- BUN_PUBLIC_BASE_URL=${BUN_PUBLIC_BASE_URL}
# Database # Database
- DATABASE_URL=${DATABASE_URL} - DATABASE_URL=${DATABASE_URL}
- DIRECT_URL=${DIRECT_URL} - DIRECT_URL=${DIRECT_URL}
# Google OAuth # Google OAuth
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID} - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET} - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
# App # Super Admin
- PORT=${PORT:-3000}
- NODE_ENV=${NODE_ENV:-production}
# Admin (initial Super Admin emails, comma-separated)
- SUPER_ADMIN_EMAIL=${SUPER_ADMIN_EMAIL} - SUPER_ADMIN_EMAIL=${SUPER_ADMIN_EMAIL}
# API Key
- API_KEY=${API_KEY}
# MinIO (object storage)
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
- MINIO_PORT=${MINIO_PORT:-443}
- MINIO_USE_SSL=${MINIO_USE_SSL:-true}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
- MINIO_BUCKET=${MINIO_BUCKET}
- MINIO_UPLOAD_DIR=${MINIO_UPLOAD_DIR:-bug-reports}
# Redis (optional — app logs feature)
- REDIS_URL=${REDIS_URL:-}
networks: networks:
- public-net - public-net
- postgres-net-stg - postgres-net-stg

25
docs/COMMANDS.md Normal file
View File

@@ -0,0 +1,25 @@
# Commands
```bash
bun run dev # dev server with hot reload (bun --watch src/serve.ts)
bun run build # Vite production build
bun run start # production server (NODE_ENV=production)
bun run typecheck # tsc --noEmit
bun run lint # biome check src/
bun run lint:fix # biome check --write src/
# Database
bun run db:migrate # prisma migrate dev
bun run db:seed # seed demo data
bun run db:generate # regenerate prisma client
bun run db:studio # Prisma Studio GUI
bun run db:push # push schema without migration
# Tests
bun run test # all tests
bun run test:unit # tests/unit/
bun run test:integration # tests/integration/ — no server needed
bun run test:e2e # tests/e2e/ — requires Lightpanda Docker
```
Run a single test file: `bun test tests/integration/auth.test.ts`

66
docs/CONVENTIONS.md Normal file
View File

@@ -0,0 +1,66 @@
# Frontend Conventions
## Data Fetching
- **SWR** for read-only data in route components (tables, lists, charts).
- **TanStack Query** (`useQuery`, `useMutation`) for auth state — see `src/frontend/hooks/useAuth.ts`.
- Never mix both in the same component/page.
- Debounce search inputs: `useDebouncedValue(search, 400)` + `useEffect` that only triggers when length >= 3 or === 0.
## API URL Builder
All URLs go through `src/frontend/config/api.ts``API_URLS`. Add new entries there, never inline URLs in components.
Desa+ endpoints are proxied via `/api/proxy/desa-plus``DESA_PLUS_PROXY` constant. The actual API source is at:
`/Users/wibu04/Documents/Projects/sistem-desa-mandiri/src/app/api/monitoring/[[...slug]]/route.ts`
## Filters & Pagination Pattern
Server-side filtering — always pass filter params to the API, never filter client-side on paginated data.
State pattern for a filtered table page:
```ts
const [page, setPage] = useState(1)
const [search, setSearch] = useState('') // raw input
const [searchQuery, setSearchQuery] = useState('') // debounced, sent to API
const [debouncedSearch] = useDebouncedValue(search, 400)
useEffect(() => {
if (debouncedSearch.length >= 3 || debouncedSearch.length === 0) {
setSearchQuery(debouncedSearch)
setPage(1)
}
}, [debouncedSearch])
useEffect(() => { setPage(1) }, [filterA, filterB]) // reset page on filter change
```
## Mantine Components
- Dark theme forced (`#242424`). Never add light-mode conditionals.
- `radius="md"` on inputs, `radius="2xl"` on container `Paper`.
- `className="glass"` on `Paper` cards for the frosted glass effect.
- `size="sm"` on table inputs and selects.
- Icons from `react-icons/tb` only — no other icon libraries.
- `DatePickerInput` from `@mantine/dates` with `type="range"` returns `[string | null, string | null]`, not Date objects.
## Route Files
File-based routing via TanStack Router Vite plugin. Files in `src/frontend/routes/`:
| Pattern | Route |
|---|---|
| `apps.$appId.tsx` | Layout wrapper for per-app pages |
| `apps.$appId.index.tsx` | Overview/dashboard for an app |
| `apps.$appId.users.index.tsx` | User management |
| `apps.$appId.logs.tsx` | Activity logs |
| `apps.$appId.villages.tsx` | Villages layout |
| `apps.$appId.villages.index.tsx` | Village list |
| `apps.$appId.villages.$villageId.tsx` | Village detail |
`routeTree.gen.ts` is auto-generated — never edit it manually.
## App Registration
App configs (ID, menu items) live in `src/frontend/config/appMenus.ts`. Add new apps there to register them.
Currently active app: `desa-plus`.

View File

@@ -4,9 +4,10 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark" /> <meta name="color-scheme" content="dark" />
<meta name="description" content="Monitoring System — real-time dashboard for your applications" />
<base href="/" /> <base href="/" />
<link rel="icon" type="image/svg+xml" href="/src/logo.svg" /> <link rel="icon" type="image/svg+xml" href="/src/logo.svg" />
<title>My App</title> <title>Monitoring System</title>
<style> <style>
/* Prevent white flash — dark background immediately */ /* Prevent white flash — dark background immediately */
html, body { html, body {
@@ -25,7 +26,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #242424; background-color: #242424;
transition: opacity 0.3s ease; transition: opacity 0.4s ease;
} }
#splash.fade-out { #splash.fade-out {
opacity: 0; opacity: 0;
@@ -35,32 +36,79 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 24px; gap: 18px;
} }
.splash-spinner { .splash-logo {
width: 40px; animation: logo-breathe 2.4s ease-in-out infinite;
height: 40px;
border: 3px solid #3a3a3a;
border-top-color: #339af0;
border-radius: 50%;
animation: spin 0.8s linear infinite;
} }
.splash-text { .splash-logo svg {
display: block;
border-radius: 14px;
filter: drop-shadow(0 8px 24px rgba(37, 99, 235, 0.45));
}
.splash-title {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
font-size: 14px; font-size: 17px;
color: #909296; font-weight: 700;
letter-spacing: 0.5px; letter-spacing: -0.3px;
background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
} }
@keyframes spin { .splash-dots {
to { transform: rotate(360deg); } display: flex;
gap: 7px;
align-items: center;
}
.splash-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: linear-gradient(135deg, #2563EB, #7C3AED);
animation: dot-pulse 1.2s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes logo-breathe {
0%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.05); opacity: 0.9; }
}
@keyframes dot-pulse {
0%, 80%, 100% { transform: scale(0.5); opacity: 0.25; }
40% { transform: scale(1); opacity: 1; }
} }
</style> </style>
</head> </head>
<body> <body>
<div id="splash"> <div id="splash">
<div class="splash-content"> <div class="splash-content">
<div class="splash-spinner"></div> <div class="splash-logo">
<div class="splash-text">Loading...</div> <svg width="64" height="64" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="sl" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
<stop stop-color="#2563EB"/>
<stop offset="1" stop-color="#7C3AED"/>
</linearGradient>
</defs>
<rect width="32" height="32" rx="7" fill="url(#sl)"/>
<polyline
points="3,16 9,16 12,8 16,24 19,16 29,16"
stroke="white"
stroke-width="2.2"
stroke-linecap="round"
stroke-linejoin="round"
fill="none"
/>
</svg>
</div>
<div class="splash-title">Monitoring System</div>
<div class="splash-dots">
<span></span>
<span></span>
<span></span>
</div>
</div> </div>
</div> </div>
<div id="root"></div> <div id="root"></div>

View File

@@ -1,9 +1,10 @@
{ {
"name": "bun-react-template", "name": "bun-react-template",
"version": "0.1.0", "version": "0.1.15",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"claude": "set -a && source .env && set +a && claude",
"dev": "bun --watch src/serve.ts", "dev": "bun --watch src/serve.ts",
"build": "vite build", "build": "vite build",
"start": "NODE_ENV=production bun src/index.tsx", "start": "NODE_ENV=production bun src/index.tsx",
@@ -26,13 +27,19 @@
"@elysiajs/eden": "^1.4.9", "@elysiajs/eden": "^1.4.9",
"@elysiajs/html": "^1.4.0", "@elysiajs/html": "^1.4.0",
"@elysiajs/swagger": "^1.3.1", "@elysiajs/swagger": "^1.3.1",
"@mantine/charts": "^9.0.0", "@mantine/charts": "^8.3.0",
"@mantine/core": "^8.3.18", "@mantine/core": "^8.3.18",
"@mantine/dates": "^8.3.0",
"@mantine/hooks": "^8.3.18", "@mantine/hooks": "^8.3.18",
"@mantine/modals": "^8.3.18",
"@mantine/notifications": "^8.3.18", "@mantine/notifications": "^8.3.18",
"@modelcontextprotocol/sdk": "^1.29.0",
"@prisma/client": "6", "@prisma/client": "6",
"@tanstack/react-query": "^5.95.2", "@tanstack/react-query": "^5.95.2",
"@tanstack/react-router": "^1.168.10", "@tanstack/react-router": "^1.168.10",
"@xyflow/react": "^12.6.4",
"dayjs": "^1.11.20",
"elkjs": "^0.9.3",
"elysia": "^1.4.28", "elysia": "^1.4.28",
"minio": "^8.0.7", "minio": "^8.0.7",
"postcss": "^8.5.8", "postcss": "^8.5.8",
@@ -42,10 +49,7 @@
"react-dom": "^19", "react-dom": "^19",
"react-icons": "^5.6.0", "react-icons": "^5.6.0",
"recharts": "^3.8.1", "recharts": "^3.8.1",
"swr": "^2.4.1", "swr": "^2.4.1"
"@mantine/modals": "^8.3.18",
"@xyflow/react": "^12.6.4",
"elkjs": "^0.9.3"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.4.10", "@biomejs/biome": "^2.4.10",

View File

@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "app_config" (
"key" TEXT NOT NULL,
"value" TEXT NOT NULL,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "app_config_pkey" PRIMARY KEY ("key")
);

View File

@@ -0,0 +1,15 @@
-- AlterTable: tambah urlApi dan apiKey ke App
ALTER TABLE "App" ADD COLUMN "urlApi" TEXT;
ALTER TABLE "App" ADD COLUMN "apiKey" TEXT;
-- DataMigration: pindahkan nilai dari app_config ke App sebelum drop
UPDATE "App"
SET "urlApi" = (SELECT value FROM app_config WHERE key = 'URL_API_DESA_PLUS')
WHERE id = 'desa-plus';
UPDATE "App"
SET "apiKey" = (SELECT value FROM app_config WHERE key = 'API_KEY_DESA_PLUS')
WHERE id = 'desa-plus';
-- DropTable
DROP TABLE "app_config";

View File

@@ -0,0 +1 @@
ALTER TABLE "App" ADD COLUMN "active" BOOLEAN NOT NULL DEFAULT true;

View File

@@ -0,0 +1,2 @@
ALTER TABLE "App" ADD COLUMN "clientApiKey" TEXT;
CREATE UNIQUE INDEX "App_clientApiKey_key" ON "App"("clientApiKey");

View File

@@ -72,16 +72,19 @@ model Session {
} }
model App { model App {
id String @id @default(uuid()) id String @id @default(uuid())
name String name String
version String? version String?
minVersion String? minVersion String?
maintenance Boolean @default(false) maintenance Boolean @default(false)
createdAt DateTime @default(now()) active Boolean @default(true)
updatedAt DateTime @updatedAt urlApi String?
apiKey String?
clientApiKey String? @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
bugs Bug[] bugs Bug[]
} }
model Log { model Log {
@@ -145,7 +148,4 @@ model BugLog {
@@map("bug_log") @@map("bug_log")
} }

231
scripts/mcp-deploy.ts Normal file
View File

@@ -0,0 +1,231 @@
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
import { z } from 'zod'
const GH_TOKEN = process.env.GH_TOKEN ?? ''
const STACK_NAME = process.env.STACK_NAME ?? ''
const BASE_URL = process.env.BASE_URL ?? '' // https://api.github.com/repos/owner/repo
const STG_URL = process.env.STG_URL ?? '' // https://monitoring-stg.example.com
const VERSION_PATH = process.env.VERSION_PATH ?? '/api/system/version'
// ─── GitHub API helpers ────────────────────────────────────────────────────────
const ghHeaders = {
Authorization: `Bearer ${GH_TOKEN}`,
Accept: 'application/vnd.github+json',
'Content-Type': 'application/json',
'X-GitHub-Api-Version': '2022-11-28',
}
async function triggerWorkflow(workflow: string, inputs: Record<string, string>) {
const res = await fetch(`${BASE_URL}/actions/workflows/${workflow}/dispatches`, {
method: 'POST',
headers: ghHeaders,
body: JSON.stringify({ ref: 'main', inputs }),
})
if (!res.ok) throw new Error(`GitHub API error ${res.status}: ${await res.text()}`)
}
async function waitForWorkflow(
workflow: string,
afterTime: Date,
timeoutMs = 600_000,
): Promise<{ conclusion: string; url: string }> {
const deadline = Date.now() + timeoutMs
await Bun.sleep(8_000) // tunggu run muncul di API
while (Date.now() < deadline) {
const res = await fetch(`${BASE_URL}/actions/workflows/${workflow}/runs?per_page=5`, {
headers: ghHeaders,
})
const data = await res.json() as { workflow_runs: any[] }
const run = data.workflow_runs?.find(
(r: any) => new Date(r.created_at) >= afterTime,
)
if (run) {
if (run.status === 'completed') {
return { conclusion: run.conclusion ?? 'failure', url: run.html_url }
}
}
await Bun.sleep(12_000)
}
throw new Error(`Workflow ${workflow} timeout setelah ${timeoutMs / 1000}s`)
}
// ─── Shell helpers ─────────────────────────────────────────────────────────────
async function sh(cmd: string[]): Promise<{ out: string; err: string; ok: boolean }> {
const proc = Bun.spawn(cmd, { stdout: 'pipe', stderr: 'pipe', cwd: process.cwd() })
const [out, err, code] = await Promise.all([
new Response(proc.stdout).text(),
new Response(proc.stderr).text(),
proc.exited,
])
return { out: out.trim(), err: err.trim(), ok: code === 0 }
}
// ─── MCP Server ────────────────────────────────────────────────────────────────
const server = new McpServer({ name: 'deploy-stg', version: '1.0.0' })
// ─── Tool: publish (manual, single step) ──────────────────────────────────────
server.tool(
'publish',
'Trigger publish.yml untuk build & push Docker image staging',
{ tag: z.string().describe('Image tag, contoh: 1.0.0') },
async ({ tag }) => {
await triggerWorkflow('publish.yml', { stack_env: 'stg', tag })
return { content: [{ type: 'text', text: `✅ publish.yml dipicu → stg-${tag}` }] }
},
)
// ─── Tool: repull (manual, single step) ───────────────────────────────────────
server.tool(
'repull',
'Trigger re-pull.yml untuk redeploy stack staging di Portainer',
{},
async () => {
await triggerWorkflow('re-pull.yml', { stack_name: STACK_NAME, stack_env: 'stg' })
return { content: [{ type: 'text', text: `✅ re-pull.yml dipicu → ${STACK_NAME}-stg` }] }
},
)
// ─── Tool: deploy (full pipeline) ─────────────────────────────────────────────
server.tool(
'deploy',
[
'Full deploy pipeline ke staging:',
'1. Cek pending migrations',
'2. Version bump di package.json',
'3. Commit & push ke build/stg',
'4. Trigger publish.yml → tunggu selesai',
'5. Trigger re-pull.yml → tunggu selesai',
'6. Cek version di staging & local untuk konfirmasi',
].join('\n'),
{ tag: z.string().describe('Versi baru, contoh: 1.2.3') },
async ({ tag }) => {
const log: string[] = []
// ── 1. Cek & jalankan migrasi jika ada ─────────────────────────────────
const migrateStatus = await sh(['bunx', 'prisma', 'migrate', 'status'])
if (!migrateStatus.ok || migrateStatus.out.includes('not yet been applied')) {
log.push('⏳ Ada pending migrations — menjalankan migrate deploy...')
const migrateRun = await sh(['bunx', 'prisma', 'migrate', 'deploy'])
if (!migrateRun.ok) {
return {
content: [{
type: 'text',
text: [
...log,
'❌ Migrate deploy gagal:',
migrateRun.err || migrateRun.out,
].join('\n'),
}],
}
}
log.push('✅ Migrations: deployed')
} else {
log.push('✅ Migrations: up to date')
}
// ── 2. Version bump ──────────────────────────────────────────────────────
const pkgPath = `${process.cwd()}/package.json`
const pkg = await Bun.file(pkgPath).json()
const prevVersion = pkg.version as string
pkg.version = tag
await Bun.write(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
log.push(`✅ Version bump: ${prevVersion}${tag}`)
// ── 3. Commit & push build/stg ───────────────────────────────────────────
await sh(['git', 'add', 'package.json'])
const commit = await sh(['git', 'commit', '-m', `chore: bump version to ${tag}`])
if (!commit.ok) {
return { content: [{ type: 'text', text: `❌ git commit gagal:\n${commit.err}` }] }
}
log.push('✅ Committed')
const push = await sh(['git', 'push', 'build', 'HEAD:stg'])
if (!push.ok) {
return { content: [{ type: 'text', text: `❌ git push gagal:\n${push.err}` }] }
}
log.push('✅ Pushed → build/stg')
// ── 4. Publish workflow ──────────────────────────────────────────────────
log.push('⏳ Menjalankan publish.yml...')
const publishTriggeredAt = new Date()
await triggerWorkflow('publish.yml', { stack_env: 'stg', tag })
const publish = await waitForWorkflow('publish.yml', publishTriggeredAt)
if (publish.conclusion !== 'success') {
return {
content: [{
type: 'text',
text: [
...log,
`❌ publish.yml ${publish.conclusion}`,
`Detail: ${publish.url}`,
].join('\n'),
}],
}
}
log.push(`✅ publish.yml sukses → ${publish.url}`)
// ── 5. Re-pull workflow ──────────────────────────────────────────────────
log.push('⏳ Menjalankan re-pull.yml...')
const repullTriggeredAt = new Date()
await triggerWorkflow('re-pull.yml', { stack_name: STACK_NAME, stack_env: 'stg' })
const repull = await waitForWorkflow('re-pull.yml', repullTriggeredAt)
if (repull.conclusion !== 'success') {
return {
content: [{
type: 'text',
text: [
...log,
`❌ re-pull.yml ${repull.conclusion}`,
`Detail: ${repull.url}`,
].join('\n'),
}],
}
}
log.push(`✅ re-pull.yml sukses → ${repull.url}`)
// ── 6. Cek version ───────────────────────────────────────────────────────
await Bun.sleep(5_000) // tunggu container restart
log.push('⏳ Mengecek version di staging...')
const localCommitProc = await sh(['git', 'rev-parse', '--short', 'HEAD'])
const localCommit = localCommitProc.out
let stgInfo: { version?: string; commit?: string } = {}
try {
const versionRes = await fetch(`${STG_URL}${VERSION_PATH}`)
stgInfo = await versionRes.json()
} catch (e) {
log.push(`⚠️ Gagal mengecek version staging: ${e}`)
}
const versionMatch = stgInfo.version === tag
const commitMatch = stgInfo.commit === localCommit
log.push('')
log.push('─── Version Check ───────────────────────────')
log.push(`Local : version=${tag}, commit=${localCommit}`)
log.push(`Staging: version=${stgInfo.version ?? '?'}, commit=${stgInfo.commit ?? '?'}`)
log.push(versionMatch && commitMatch
? '✅ Staging sudah terupdate dan sesuai local'
: `⚠️ Mismatch — version: ${versionMatch ? 'OK' : 'BEDA'}, commit: ${commitMatch ? 'OK' : 'BEDA'}`,
)
return { content: [{ type: 'text', text: log.join('\n') }] }
},
)
const transport = new StdioServerTransport()
await server.connect(transport)

View File

@@ -11,6 +11,9 @@ import { getMinioDownloadUrl, uploadBugImage } from './lib/minio'
import { addConnection, broadcastToAdmins, getOnlineUserIds, removeConnection } from './lib/presence' import { addConnection, broadcastToAdmins, getOnlineUserIds, removeConnection } from './lib/presence'
import { parseSchema } from './lib/schema-parser' import { parseSchema } from './lib/schema-parser'
const isProduction = process.env.NODE_ENV === 'production'
const cookieFlags = isProduction ? '; Secure' : ''
function getPublicOrigin(request: Request): string { function getPublicOrigin(request: Request): string {
if (process.env.BUN_PUBLIC_BASE_URL) return process.env.BUN_PUBLIC_BASE_URL.replace(/\/$/, '') if (process.env.BUN_PUBLIC_BASE_URL) return process.env.BUN_PUBLIC_BASE_URL.replace(/\/$/, '')
const url = new URL(request.url) const url = new URL(request.url)
@@ -36,13 +39,6 @@ async function checkAuth(request: Request): Promise<AuthResult | null> {
} }
} }
const apiKey = request.headers.get('x-api-key')
if (apiKey && apiKey === env.API_KEY) {
const developer = await prisma.user.findFirst({ where: { role: 'DEVELOPER' } })
if (!developer) return null
return { actingUserId: developer.id, reporterUserId: null, isApiKey: true }
}
return null return null
} }
@@ -134,7 +130,7 @@ export function createApp() {
}) })
const headers = new Headers() const headers = new Headers()
headers.set('Location', `https://accounts.google.com/o/oauth2/v2/auth?${params}`) headers.set('Location', `https://accounts.google.com/o/oauth2/v2/auth?${params}`)
headers.set('Set-Cookie', `oauth_state=${state}; Path=/; HttpOnly; SameSite=Lax; Max-Age=600`) headers.set('Set-Cookie', `oauth_state=${state}; Path=/; HttpOnly; SameSite=Lax; Max-Age=600${cookieFlags}`)
return new Response(null, { status: 302, headers }) return new Response(null, { status: 302, headers })
}, { }, {
detail: { detail: {
@@ -203,6 +199,10 @@ export function createApp() {
}) })
} }
if (!user.active) {
return new Response(null, { status: 302, headers: { Location: '/login?error=account_disabled' } })
}
if (env.SUPER_ADMIN_EMAILS.includes(user.email) && user.role !== 'DEVELOPER') { if (env.SUPER_ADMIN_EMAILS.includes(user.email) && user.role !== 'DEVELOPER') {
user = await prisma.user.update({ where: { id: user.id }, data: { role: 'DEVELOPER' } }) user = await prisma.user.update({ where: { id: user.id }, data: { role: 'DEVELOPER' } })
} }
@@ -215,8 +215,8 @@ export function createApp() {
const redirectPath = user.role === 'DEVELOPER' ? '/dev' : user.role === 'USER' ? '/profile' : '/dashboard' const redirectPath = user.role === 'DEVELOPER' ? '/dev' : user.role === 'USER' ? '/profile' : '/dashboard'
const headers = new Headers() const headers = new Headers()
headers.append('Location', redirectPath) headers.append('Location', redirectPath)
headers.append('Set-Cookie', `session=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=86400`) headers.append('Set-Cookie', `session=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=86400${cookieFlags}`)
headers.append('Set-Cookie', 'oauth_state=; Path=/; HttpOnly; Max-Age=0') headers.append('Set-Cookie', `oauth_state=; Path=/; HttpOnly; Max-Age=0${cookieFlags}`)
return new Response(null, { status: 302, headers }) return new Response(null, { status: 302, headers })
}, { }, {
detail: { detail: {
@@ -233,6 +233,10 @@ export function createApp() {
set.status = 401 set.status = 401
return { error: 'Email atau password salah' } return { error: 'Email atau password salah' }
} }
if (!user.active) {
set.status = 403
return { error: 'Akun Anda telah dinonaktifkan. Hubungi admin untuk informasi lebih lanjut.' }
}
// Auto-promote super admin from env // Auto-promote super admin from env
if (env.SUPER_ADMIN_EMAILS.includes(user.email) && user.role !== 'DEVELOPER') { if (env.SUPER_ADMIN_EMAILS.includes(user.email) && user.role !== 'DEVELOPER') {
user = await prisma.user.update({ where: { id: user.id }, data: { role: 'DEVELOPER' } }) user = await prisma.user.update({ where: { id: user.id }, data: { role: 'DEVELOPER' } })
@@ -240,7 +244,7 @@ export function createApp() {
const token = crypto.randomUUID() const token = crypto.randomUUID()
const expiresAt = new Date(Date.now() + 24 * 60 * 60 * 1000) // 24 hours const expiresAt = new Date(Date.now() + 24 * 60 * 60 * 1000) // 24 hours
await prisma.session.create({ data: { token, userId: user.id, expiresAt } }) await prisma.session.create({ data: { token, userId: user.id, expiresAt } })
set.headers['set-cookie'] = `session=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=86400` set.headers['set-cookie'] = `session=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=86400${cookieFlags}`
await createSystemLog(user.id, 'LOGIN', 'Logged in successfully') await createSystemLog(user.id, 'LOGIN', 'Logged in successfully')
return { user: { id: user.id, name: user.name, email: user.email, role: user.role, image: user.image } } return { user: { id: user.id, name: user.name, email: user.email, role: user.role, image: user.image } }
}, { }, {
@@ -265,7 +269,7 @@ export function createApp() {
await prisma.session.deleteMany({ where: { token } }) await prisma.session.deleteMany({ where: { token } })
} }
} }
set.headers['set-cookie'] = 'session=; Path=/; HttpOnly; Max-Age=0' set.headers['set-cookie'] = `session=; Path=/; HttpOnly; Max-Age=0${cookieFlags}`
return { ok: true } return { ok: true }
}, { }, {
detail: { detail: {
@@ -281,13 +285,18 @@ export function createApp() {
if (!token) { set.status = 401; return { user: null } } if (!token) { set.status = 401; return { user: null } }
const session = await prisma.session.findUnique({ const session = await prisma.session.findUnique({
where: { token }, where: { token },
include: { user: { select: { id: true, name: true, email: true, role: true, image: true } } }, include: { user: { select: { id: true, name: true, email: true, role: true, image: true, active: true } } },
}) })
if (!session || session.expiresAt < new Date()) { if (!session || session.expiresAt < new Date()) {
if (session) await prisma.session.delete({ where: { id: session.id } }) if (session) await prisma.session.delete({ where: { id: session.id } })
set.status = 401 set.status = 401
return { user: null } return { user: null }
} }
if (!session.user.active) {
await prisma.session.deleteMany({ where: { userId: session.user.id } })
set.status = 401
return { user: null }
}
return { user: session.user } return { user: session.user }
}, { }, {
detail: { detail: {
@@ -339,7 +348,8 @@ export function createApp() {
// ─── Apps API ────────────────────────────────────── // ─── Apps API ──────────────────────────────────────
.get('/api/apps', async ({ query }) => { .get('/api/apps', async ({ query }) => {
const search = query.search || '' const search = query.search || ''
const where: any = {} const all = query.all === 'true'
const where: any = all ? {} : { active: true }
if (search) { if (search) {
where.name = { contains: search, mode: 'insensitive' } where.name = { contains: search, mode: 'insensitive' }
} }
@@ -356,18 +366,21 @@ export function createApp() {
return apps.map((app) => ({ return apps.map((app) => ({
id: app.id, id: app.id,
name: app.name, name: app.name,
status: app.maintenance ? 'warning' : app.bugs.length > 0 ? 'error' : 'active', status: app.active ? 'active' : 'inactive',
errors: app.bugs.length, errors: app.bugs.length,
version: app.version ?? '-', active: app.active,
maintenance: app.maintenance, urlApi: app.urlApi,
apiKey: app.apiKey ?? '',
clientApiKey: app.clientApiKey ?? '',
hasClientApiKey: !!app.clientApiKey,
})) }))
}, { }, {
query: t.Object({ query: t.Object({
search: t.Optional(t.String({ description: 'Filter berdasarkan nama aplikasi' })), search: t.Optional(t.String()),
all: t.Optional(t.String()),
}), }),
detail: { detail: {
summary: 'List Apps', summary: 'List Apps',
description: 'Mengembalikan semua aplikasi yang dimonitor beserta status (active/warning/error), jumlah bug OPEN, versi, dan mode maintenance.',
tags: ['Apps'], tags: ['Apps'],
}, },
}) })
@@ -389,11 +402,9 @@ export function createApp() {
return { return {
id: app.id, id: app.id,
name: app.name, name: app.name,
status: app.maintenance ? 'warning' : app.bugs.length > 0 ? 'error' : 'active', status: app.active ? 'active' : 'inactive',
errors: app.bugs.length, errors: app.bugs.length,
version: app.version ?? '-', urlApi: app.urlApi,
minVersion: app.minVersion,
maintenance: app.maintenance,
totalBugs: app._count.bugs, totalBugs: app._count.bugs,
} }
}, { }, {
@@ -407,6 +418,86 @@ export function createApp() {
}, },
}) })
.post('/api/apps', async ({ body, request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const { id, name, version, minVersion, maintenance, urlApi, apiKey } = body as any
if (!id || !name) { set.status = 400; return { error: 'id and name are required' } }
const existing = await prisma.app.findUnique({ where: { id } })
if (existing) { set.status = 409; return { error: 'App with this ID already exists' } }
const app = await prisma.app.create({
data: { id, name, version: version || null, minVersion: minVersion || null, maintenance: maintenance ?? false, urlApi: urlApi || null, apiKey: apiKey || null },
})
await createSystemLog(auth.userId, 'CREATE', `Created app: ${app.id}`)
return { id: app.id, name: app.name, version: app.version, minVersion: app.minVersion, maintenance: app.maintenance, urlApi: app.urlApi }
}, {
detail: { summary: 'Create App', tags: ['Apps'] },
})
.patch('/api/apps/:appId', async ({ params: { appId }, body, request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: appId } })
if (!app) { set.status = 404; return { error: 'App not found' } }
const { name, version, minVersion, maintenance, urlApi, apiKey } = body as any
const updated = await prisma.app.update({
where: { id: appId },
data: {
...(name !== undefined && { name }),
...(version !== undefined && { version: version || null }),
...(minVersion !== undefined && { minVersion: minVersion || null }),
...(maintenance !== undefined && { maintenance }),
...(urlApi !== undefined && { urlApi: urlApi || null }),
...(apiKey !== undefined && { apiKey: apiKey || null }),
},
})
await createSystemLog(auth.userId, 'UPDATE', `Updated app: ${appId}`)
return { id: updated.id, name: updated.name, version: updated.version, minVersion: updated.minVersion, maintenance: updated.maintenance, urlApi: updated.urlApi }
}, {
params: t.Object({ appId: t.String() }),
detail: { summary: 'Update App', tags: ['Apps'] },
})
.delete('/api/apps/:appId', async ({ params: { appId }, request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: appId } })
if (!app) { set.status = 404; return { error: 'App not found' } }
await prisma.app.update({ where: { id: appId }, data: { active: false } })
await createSystemLog(auth.userId, 'UPDATE', `Deactivated app: ${appId}`)
return { success: true }
}, {
params: t.Object({ appId: t.String() }),
detail: { summary: 'Deactivate App', tags: ['Apps'] },
})
.post('/api/apps/:appId/activate', async ({ params: { appId }, request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: appId } })
if (!app) { set.status = 404; return { error: 'App not found' } }
await prisma.app.update({ where: { id: appId }, data: { active: true } })
await createSystemLog(auth.userId, 'UPDATE', `Activated app: ${appId}`)
return { success: true }
}, {
params: t.Object({ appId: t.String() }),
detail: { summary: 'Activate App', tags: ['Apps'] },
})
.post('/api/apps/:appId/generate-key', async ({ params: { appId }, request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: appId } })
if (!app) { set.status = 404; return { error: 'App not found' } }
const key = `mapp_${Buffer.from(crypto.getRandomValues(new Uint8Array(24))).toString('hex')}`
await prisma.app.update({ where: { id: appId }, data: { clientApiKey: key } })
await createSystemLog(auth.userId, 'UPDATE', `Generated client API key for app: ${appId}`)
return { clientApiKey: key }
}, {
params: t.Object({ appId: t.String() }),
detail: { summary: 'Generate Client API Key', tags: ['Apps'] },
})
// ─── Logs API ────────────────────────────────────── // ─── Logs API ──────────────────────────────────────
.get('/api/logs', async ({ query }) => { .get('/api/logs', async ({ query }) => {
const page = Number(query.page) || 1 const page = Number(query.page) || 1
@@ -414,6 +505,8 @@ export function createApp() {
const search = query.search || '' const search = query.search || ''
const type = query.type as any const type = query.type as any
const userId = query.userId const userId = query.userId
const dateFrom = query.dateFrom
const dateTo = query.dateTo
const where: any = {} const where: any = {}
if (search) { if (search) {
@@ -428,6 +521,15 @@ export function createApp() {
if (userId && userId !== 'all') { if (userId && userId !== 'all') {
where.userId = userId where.userId = userId
} }
if (dateFrom || dateTo) {
where.createdAt = {}
if (dateFrom) where.createdAt.gte = new Date(dateFrom)
if (dateTo) {
const end = new Date(dateTo)
end.setHours(23, 59, 59, 999)
where.createdAt.lte = end
}
}
const [logs, total] = await Promise.all([ const [logs, total] = await Promise.all([
prisma.log.findMany({ prisma.log.findMany({
@@ -452,6 +554,8 @@ export function createApp() {
search: t.Optional(t.String({ description: 'Cari berdasarkan pesan log atau nama pengguna' })), search: t.Optional(t.String({ description: 'Cari berdasarkan pesan log atau nama pengguna' })),
type: t.Optional(t.String({ description: 'Filter tipe: CREATE | UPDATE | DELETE | LOGIN | LOGOUT | all' })), type: t.Optional(t.String({ description: 'Filter tipe: CREATE | UPDATE | DELETE | LOGIN | LOGOUT | all' })),
userId: t.Optional(t.String({ description: 'Filter berdasarkan ID pengguna, atau "all"' })), userId: t.Optional(t.String({ description: 'Filter berdasarkan ID pengguna, atau "all"' })),
dateFrom: t.Optional(t.String({ description: 'Filter dari tanggal (ISO string atau YYYY-MM-DD)' })),
dateTo: t.Optional(t.String({ description: 'Filter sampai tanggal (ISO string atau YYYY-MM-DD)' })),
}), }),
detail: { detail: {
summary: 'List Activity Logs', summary: 'List Activity Logs',
@@ -628,6 +732,10 @@ export function createApp() {
}, },
}) })
if (body.active === false) {
await prisma.session.deleteMany({ where: { userId: id } })
}
if (userId) { if (userId) {
await createSystemLog(userId, 'UPDATE', `Updated user: ${user.name} (${user.email})`) await createSystemLog(userId, 'UPDATE', `Updated user: ${user.name} (${user.email})`)
} }
@@ -753,12 +861,23 @@ export function createApp() {
}) })
.post('/api/bugs', async ({ body, request, set }) => { .post('/api/bugs', async ({ body, request, set }) => {
const auth = await checkAuth(request) let auth = await checkAuth(request)
if (!auth) {
const xKey = request.headers.get('x-api-key')
const appId = (body as any).app
if (xKey && appId) {
const app = await prisma.app.findUnique({ where: { id: appId, active: true } })
if (app?.clientApiKey && app.clientApiKey === xKey) {
const developer = await prisma.user.findFirst({ where: { role: 'DEVELOPER' } })
if (developer) auth = { actingUserId: developer.id, reporterUserId: null, isApiKey: true }
}
}
}
if (!auth) { if (!auth) {
set.status = 401 set.status = 401
return { error: 'Unauthorized: sertakan session cookie atau header X-API-Key' } return { error: 'Unauthorized: provide session cookie or valid X-API-Key' }
} }
const { actingUserId, reporterUserId, isApiKey } = auth const { actingUserId, reporterUserId } = auth
const bug = await prisma.bug.create({ const bug = await prisma.bug.create({
data: { data: {
@@ -980,6 +1099,39 @@ export function createApp() {
tags: ['System'], tags: ['System'],
}, },
}) })
.get('/api/system/version', async () => {
const pkg = await Bun.file('./package.json').json()
let commit = 'unknown'
let branch = 'unknown'
let changelog: { hash: string; date: string; author: string; message: string }[] = []
try {
const commitProc = Bun.spawn(['git', 'rev-parse', '--short', 'HEAD'], { stdout: 'pipe', stderr: 'pipe' })
commit = (await new Response(commitProc.stdout).text()).trim()
const branchProc = Bun.spawn(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], { stdout: 'pipe', stderr: 'pipe' })
branch = (await new Response(branchProc.stdout).text()).trim()
const logProc = Bun.spawn(
['git', 'log', '--pretty=format:%h|%aI|%an|%s', '-20'],
{ stdout: 'pipe', stderr: 'pipe' },
)
const logText = (await new Response(logProc.stdout).text()).trim()
changelog = logText.split('\n').filter(Boolean).map(line => {
const [hash, date, author, ...msgParts] = line.split('|')
return { hash, date, author, message: msgParts.join('|') }
})
} catch { /* git not available */ }
return {
version: pkg.version as string,
commit,
branch,
changelog,
}
}, {
detail: {
summary: 'Version Info',
description: 'Mengembalikan versi aplikasi, git commit hash, branch aktif, dan 20 commit terakhir sebagai changelog.',
tags: ['System'],
},
})
// ─── Example API ─────────────────────────────────── // ─── Example API ───────────────────────────────────
.get('/api/hello', () => ({ .get('/api/hello', () => ({
@@ -1041,6 +1193,7 @@ export function createApp() {
select: { id: true, name: true, email: true, role: true, active: true, createdAt: true }, select: { id: true, name: true, email: true, role: true, active: true, createdAt: true },
}) })
await appLog('info', `Role changed: ${user.email} ${target?.role}${role}`) await appLog('info', `Role changed: ${user.email} ${target?.role}${role}`)
await createSystemLog(auth.userId, 'UPDATE', `Role changed: ${user.name} (${user.email}) ${target?.role}${role}`)
return { user } return { user }
}) })
@@ -1056,6 +1209,7 @@ export function createApp() {
}) })
if (!active) await prisma.session.deleteMany({ where: { userId: params.id } }) if (!active) await prisma.session.deleteMany({ where: { userId: params.id } })
await appLog('info', `User ${active ? 'activated' : 'deactivated'}: ${user.email}`) await appLog('info', `User ${active ? 'activated' : 'deactivated'}: ${user.email}`)
await createSystemLog(auth.userId, active ? 'UPDATE' : 'DELETE', `User ${active ? 'activated' : 'deactivated'}: ${user.name} (${user.email})`)
return { user } return { user }
}) })
@@ -1487,4 +1641,95 @@ export function createApp() {
} }
return { sessions: result, summary: { totalSessions: result.length, activeSessions: active, expiredSessions: expired, onlineUsers: onlineIds.size, byRole } } return { sessions: result, summary: { totalSessions: result.length, activeSessions: active, expiredSessions: expired, onlineUsers: onlineIds.size, byRole } }
}) })
// ─── API Keys (proxied to desa-plus /api/monitoring/api-keys) ─────────────
.get('/api/admin/api-keys', async ({ request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: 'desa-plus' } })
if (!app?.urlApi) { set.status = 503; return { error: 'desa-plus belum dikonfigurasi' } }
const res = await fetch(`${app.urlApi.replace(/\/$/, '')}/api/monitoring/api-keys`, {
headers: { 'x-api-key': app.apiKey ?? '' },
})
const json = await res.json()
return { keys: json.data ?? [] }
})
.post('/api/admin/api-keys', async ({ request, set }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const body = await request.json() as { name?: string }
if (!body.name?.trim()) { set.status = 400; return { error: 'name wajib diisi' } }
const app = await prisma.app.findUnique({ where: { id: 'desa-plus' } })
if (!app?.urlApi) { set.status = 503; return { error: 'desa-plus belum dikonfigurasi: urlApi kosong' } }
if (!app?.apiKey) { set.status = 503; return { error: 'desa-plus belum dikonfigurasi: apiKey kosong' } }
try {
const res = await fetch(`${app.urlApi.replace(/\/$/, '')}/api/monitoring/api-keys`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': app.apiKey },
body: JSON.stringify({ name: body.name.trim() }),
})
const json = await res.json()
set.status = res.status
return { key: json.data ?? null }
} catch (e) {
set.status = 502
return { error: `Gagal menghubungi desa-plus: ${String(e)}` }
}
})
.patch('/api/admin/api-keys/:id', async ({ request, set, params }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const body = await request.json() as { isActive?: boolean }
const app = await prisma.app.findUnique({ where: { id: 'desa-plus' } })
if (!app?.urlApi) { set.status = 503; return { error: 'desa-plus belum dikonfigurasi' } }
const res = await fetch(`${app.urlApi.replace(/\/$/, '')}/api/monitoring/api-keys/${params.id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json', 'x-api-key': app.apiKey ?? '' },
body: JSON.stringify({ isActive: body.isActive }),
})
const json = await res.json()
set.status = res.status
return json
})
.delete('/api/admin/api-keys/:id', async ({ request, set, params }) => {
const auth = await requireDeveloper(request, set)
if (!auth) return { error: set.status === 401 ? 'Unauthorized' : 'Forbidden' }
const app = await prisma.app.findUnique({ where: { id: 'desa-plus' } })
if (!app?.urlApi) { set.status = 503; return { error: 'desa-plus belum dikonfigurasi' } }
const res = await fetch(`${app.urlApi.replace(/\/$/, '')}/api/monitoring/api-keys/${params.id}`, {
method: 'DELETE',
headers: { 'x-api-key': app.apiKey ?? '' },
})
const json = await res.json()
set.status = res.status
return json
})
// ─── Desa Plus Proxy ───────────────────────────────────────────────────────
.all('/api/proxy/desa-plus/*', async ({ request, set }) => {
const app = await prisma.app.findUnique({ where: { id: 'desa-plus' } })
if (!app?.urlApi) { set.status = 503; return { error: 'urlApi belum dikonfigurasi untuk app desa-plus.' } }
const base = app.urlApi.replace(/\/$/, '')
const url = new URL(request.url)
const upstream = `${base}${url.pathname.replace('/api/proxy/desa-plus', '')}${url.search}`
const headers = new Headers(request.headers)
headers.delete('host')
if (app.apiKey) headers.set('X-API-Key', app.apiKey)
try {
const res = await fetch(upstream, { method: request.method, headers, body: request.method !== 'GET' && request.method !== 'HEAD' ? request.body : undefined })
const contentType = res.headers.get('content-type') ?? 'application/json'
set.status = res.status
return new Response(res.body, { status: res.status, headers: { 'content-type': contentType } })
} catch (e) {
set.status = 502
return { error: 'Gagal menghubungi API desa-plus', detail: String(e) }
}
}, {
detail: { summary: 'Proxy Desa Plus API', tags: ['Proxy'] },
})
} }

View File

@@ -1,5 +1,6 @@
import { ColorSchemeScript, MantineProvider, createTheme } from '@mantine/core' import { ColorSchemeScript, MantineProvider, createTheme } from '@mantine/core'
import '@mantine/core/styles.css' import '@mantine/core/styles.css'
import '@mantine/dates/styles.css'
import '@mantine/notifications/styles.css' import '@mantine/notifications/styles.css'
import { ModalsProvider } from '@mantine/modals' import { ModalsProvider } from '@mantine/modals'
import { Notifications } from '@mantine/notifications' import { Notifications } from '@mantine/notifications'

View File

@@ -1,6 +1,6 @@
import { Avatar, Button, Card, Group, Stack, Text, useComputedColorScheme } from '@mantine/core' import { Avatar, Badge, Button, Card, Group, Stack, Text, useComputedColorScheme } from '@mantine/core'
import { Link } from '@tanstack/react-router' import { Link } from '@tanstack/react-router'
import { TbChevronRight, TbDeviceMobile } from 'react-icons/tb' import { TbAlertTriangle, TbChevronRight, TbDeviceMobile } from 'react-icons/tb'
interface AppCardProps { interface AppCardProps {
id: string id: string
@@ -12,8 +12,9 @@ interface AppCardProps {
maintenance?: boolean maintenance?: boolean
} }
export function AppCard({ id, name, status, errors, version }: AppCardProps) { export function AppCard({ id, name, status, errors, version, maintenance }: AppCardProps) {
const statusColor = status === 'active' ? 'teal' : status === 'warning' ? 'orange' : 'red' const statusColor = maintenance ? 'gray' : status === 'active' ? 'teal' : status === 'warning' ? 'orange' : 'red'
const statusLabel = maintenance ? 'Maintenance' : status === 'active' ? 'Active' : status === 'warning' ? 'Warning' : 'Error'
const scheme = useComputedColorScheme('light', { getInitialValueInEffect: true }) const scheme = useComputedColorScheme('light', { getInitialValueInEffect: true })
return ( return (
@@ -35,7 +36,7 @@ export function AppCard({ id, name, status, errors, version }: AppCardProps) {
}, },
})} })}
> >
<Group justify="space-between" mb="lg"> <Group justify="space-between" mb="md">
<Group gap="md"> <Group gap="md">
<Avatar <Avatar
variant="gradient" variant="gradient"
@@ -45,39 +46,27 @@ export function AppCard({ id, name, status, errors, version }: AppCardProps) {
> >
<TbDeviceMobile size={26} /> <TbDeviceMobile size={26} />
</Avatar> </Avatar>
<Stack gap={0}> <Stack gap={2}>
<Text fw={700} size="lg" style={{ letterSpacing: '-0.3px' }}>{name}</Text> <Text fw={700} size="lg" style={{ letterSpacing: '-0.3px' }}>{name}</Text>
{/* <Text size="xs" c="dimmed" fw={600}>VERSION {version}</Text> */} {/* <Text size="xs" c="dimmed" fw={600} tt="uppercase">v{version}</Text> */}
</Stack> </Stack>
</Group> </Group>
{/* <Badge color={statusColor} variant="dot" size="sm"> <Badge color={statusColor} variant="dot" size="sm">
{status.toUpperCase()} {statusLabel}
</Badge> */} </Badge>
</Group> </Group>
{/* <Stack gap="md" mt="sm"> <Group justify="space-between" align="center" mb="xs">
<Box> <Text size="xs" c="dimmed" fw={500}>Open Errors</Text>
<Group justify="space-between" mb={6}> <Badge
<Group gap="xs"> color={errors > 0 ? 'red' : 'teal'}
<TbActivity size={16} color="#2563EB" /> variant="light"
<Text size="xs" fw={700} c="dimmed">USER ADOPTION</Text> size="sm"
</Group> leftSection={errors > 0 ? <TbAlertTriangle size={10} /> : undefined}
<Text size="sm" fw={700}>{users.toLocaleString()}</Text> >
</Group> {errors > 0 ? errors : 'None'}
<Progress value={85} size="sm" color="brand-blue" radius="xl" /> </Badge>
</Box> </Group>
<Box>
<Group justify="space-between" mb={6}>
<Group gap="xs">
<TbAlertTriangle size={16} color={errors > 0 ? '#ef4444' : '#64748b'} />
<Text size="xs" fw={700} c="dimmed">ERROR</Text>
</Group>
<Text size="sm" fw={700} color={errors > 0 ? 'red' : 'dimmed'}>{errors}</Text>
</Group>
<Progress value={errors > 0 ? 30 : 0} size="sm" color="red" radius="xl" />
</Box>
</Stack> */}
<Button <Button
component={Link} component={Link}
@@ -85,7 +74,7 @@ export function AppCard({ id, name, status, errors, version }: AppCardProps) {
variant="light" variant="light"
color="brand-blue" color="brand-blue"
fullWidth fullWidth
mt="xl" mt="md"
radius="md" radius="md"
rightSection={<TbChevronRight size={16} />} rightSection={<TbChevronRight size={16} />}
styles={{ styles={{
@@ -97,7 +86,7 @@ export function AppCard({ id, name, status, errors, version }: AppCardProps) {
} }
}} }}
> >
View Open Dashboard
</Button> </Button>
</Card> </Card>
) )

View File

@@ -1,7 +1,8 @@
import { BarChart, LineChart } from '@mantine/charts' import { AreaChart, BarChart } from '@mantine/charts'
import { import {
Badge, Badge,
Box, Box,
Button,
Group, Group,
Paper, Paper,
Stack, Stack,
@@ -11,14 +12,29 @@ import {
} from '@mantine/core' } from '@mantine/core'
import { TbArrowUpRight, TbChartBar, TbTimeline } from 'react-icons/tb' import { TbArrowUpRight, TbChartBar, TbTimeline } from 'react-icons/tb'
type DailyRange = 7 | 30 | 90
interface ChartProps { interface ChartProps {
data?: any[] data?: any[]
isLoading?: boolean isLoading?: boolean
} }
export function VillageActivityLineChart({ data = [], isLoading }: ChartProps) { interface ActivityChartProps extends ChartProps {
range?: DailyRange
onRangeChange?: (range: DailyRange) => void
}
const RANGE_OPTIONS: { value: DailyRange; label: string }[] = [
{ value: 7, label: '7D' },
{ value: 30, label: '30D' },
{ value: 90, label: '3M' },
]
export function VillageActivityLineChart({ data = [], isLoading, range = 7, onRangeChange }: ActivityChartProps) {
const theme = useMantineTheme() const theme = useMantineTheme()
const rangeLabel = range === 7 ? 'last 7 days' : range === 30 ? 'last 30 days' : 'last 3 months'
return ( return (
<Paper withBorder p="xl" radius="2xl" className="glass h-full"> <Paper withBorder p="xl" radius="2xl" className="glass h-full">
<Stack gap="md" h="100%"> <Stack gap="md" h="100%">
@@ -29,21 +45,28 @@ export function VillageActivityLineChart({ data = [], isLoading }: ChartProps) {
</ThemeIcon> </ThemeIcon>
<Box> <Box>
<Text fw={700} size="sm">DAILY ACTIVITY - ALL VILLAGES</Text> <Text fw={700} size="sm">DAILY ACTIVITY - ALL VILLAGES</Text>
<Text size="xs" c="dimmed">Trend over the last 7 days</Text> <Text size="xs" c="dimmed">Trend over the {rangeLabel}</Text>
</Box> </Box>
</Group> </Group>
{ <Group gap={4}>
isLoading && ( {RANGE_OPTIONS.map((opt) => (
<Badge variant="light" color="blue" size="sm" rightSection={<TbArrowUpRight size={12} />}> <Button
... key={opt.value}
</Badge> size="compact-xs"
) variant={range === opt.value ? 'filled' : 'subtle'}
} color="blue"
radius="md"
onClick={() => onRangeChange?.(opt.value)}
loading={isLoading && range === opt.value}
>
{opt.label}
</Button>
))}
</Group>
</Group> </Group>
<Box h={300} mt="lg"> <Box h={300} mt="lg">
<LineChart <AreaChart
h={300} h={300}
data={data} data={data}
dataKey="date" dataKey="date"
@@ -53,12 +76,33 @@ export function VillageActivityLineChart({ data = [], isLoading }: ChartProps) {
gridAxis="x" gridAxis="x"
withTooltip withTooltip
tooltipAnimationDuration={200} tooltipAnimationDuration={200}
fillOpacity={0.4}
tooltipProps={{ tooltipProps={{
allowEscapeViewBox: { x: true, y: false }, content: ({ active, payload, label }: any) => {
if (!active || !payload?.length) return null
return (
<div style={{
backgroundColor: '#1A1B1E',
padding: '8px 12px',
borderRadius: '6px',
border: '1px solid #373A40',
boxShadow: '0 4px 12px rgba(0,0,0,0.5)',
pointerEvents: 'none',
whiteSpace: 'nowrap',
}}>
<div style={{ fontSize: '12px', fontWeight: 600, color: '#C1C2C5', marginBottom: '4px' }}>
{label}
</div>
<div style={{ fontSize: '11px', color: '#2563EB' }}>
Activity: <span style={{ fontWeight: 700 }}>{payload[0].value}</span>
</div>
</div>
)
},
}} }}
styles={{ styles={{
root: { root: {
'.recharts-line-curve': { '.recharts-area-curve': {
strokeWidth: 3, strokeWidth: 3,
filter: 'drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3))' filter: 'drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3))'
} }
@@ -71,9 +115,11 @@ export function VillageActivityLineChart({ data = [], isLoading }: ChartProps) {
) )
} }
export function VillageComparisonBarChart({ data = [], isLoading }: ChartProps) { export function VillageComparisonBarChart({ data = [], isLoading, range = 7, onRangeChange }: ActivityChartProps) {
const theme = useMantineTheme() const theme = useMantineTheme()
const rangeLabel = range === 7 ? 'last 7 days' : range === 30 ? 'last 30 days' : 'last 3 months'
return ( return (
<Paper withBorder p="xl" radius="2xl" className="glass h-full"> <Paper withBorder p="xl" radius="2xl" className="glass h-full">
<Stack gap="md" h="100%"> <Stack gap="md" h="100%">
@@ -84,9 +130,24 @@ export function VillageComparisonBarChart({ data = [], isLoading }: ChartProps)
</ThemeIcon> </ThemeIcon>
<Box> <Box>
<Text fw={700} size="sm">USAGE COMPARISON BETWEEN VILLAGES</Text> <Text fw={700} size="sm">USAGE COMPARISON BETWEEN VILLAGES</Text>
<Text size="xs" c="dimmed">Most active village deployments</Text> <Text size="xs" c="dimmed">Most active village deployments {rangeLabel}</Text>
</Box> </Box>
</Group> </Group>
<Group gap={4}>
{RANGE_OPTIONS.map((opt) => (
<Button
key={opt.value}
size="compact-xs"
variant={range === opt.value ? 'filled' : 'subtle'}
color="violet"
radius="md"
onClick={() => onRangeChange?.(opt.value)}
loading={isLoading && range === opt.value}
>
{opt.label}
</Button>
))}
</Group>
</Group> </Group>
<Box h={300} mt="lg"> <Box h={300} mt="lg">

View File

@@ -201,12 +201,6 @@ export function DashboardLayout({ children }: DashboardLayoutProps) {
> >
Profile Profile
</Menu.Item> </Menu.Item>
<Menu.Item
leftSection={<TbSettings size={16} />}
onClick={() => navigate({ to: '/dashboard' })}
>
Settings
</Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Label>Danger Zone</Menu.Label> <Menu.Label>Danger Zone</Menu.Label>
<Menu.Item <Menu.Item

View File

@@ -6,32 +6,63 @@ import {
Divider, Divider,
Drawer, Drawer,
Group, Group,
Loader,
Paper, Paper,
ScrollArea, ScrollArea,
SimpleGrid,
Stack, Stack,
Table, Table,
Text, Text,
Title ThemeIcon,
Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { useQuery } from '@tanstack/react-query'
import { Link } from '@tanstack/react-router' import { Link } from '@tanstack/react-router'
import { useState } from 'react' import dayjs from 'dayjs'
import { forwardRef, useImperativeHandle, useState } from 'react'
import { TbBug, TbExternalLink, TbHistory, TbMessageReport } from 'react-icons/tb' import { TbBug, TbExternalLink, TbHistory, TbMessageReport } from 'react-icons/tb'
import useSWR from 'swr'
export interface ErrorDataTableHandle {
refresh: () => void
}
export interface ErrorDataTableProps { export interface ErrorDataTableProps {
appId?: string appId?: string
} }
export function ErrorDataTable({ appId }: ErrorDataTableProps) { const STATUS_COLOR: Record<string, string> = {
OPEN: 'red',
IN_PROGRESS: 'blue',
ON_HOLD: 'orange',
RESOLVED: 'teal',
RELEASED: 'green',
CLOSED: 'gray',
}
const STATUS_LABEL: Record<string, string> = {
OPEN: 'Open',
ON_HOLD: 'On Hold',
IN_PROGRESS: 'In Progress',
RESOLVED: 'Resolved',
RELEASED: 'Released',
CLOSED: 'Closed',
}
const fetcher = (url: string) => fetch(url).then((r) => r.json())
export const ErrorDataTable = forwardRef<ErrorDataTableHandle, ErrorDataTableProps>(
function ErrorDataTable({ appId }, ref) {
const [opened, { open, close }] = useDisclosure(false) const [opened, { open, close }] = useDisclosure(false)
const [selectedError, setSelectedError] = useState<any>(null) const [selectedError, setSelectedError] = useState<any>(null)
const [showStackTrace, setShowStackTrace] = useState(false) const [showStackTrace, setShowStackTrace] = useState(false)
const { data: bugsData, isLoading } = useQuery({ const { data: bugsData, isLoading, mutate } = useSWR(
queryKey: ['bugs', appId], `/api/bugs?app=${appId || 'all'}&limit=10`,
queryFn: () => fetch(`/api/bugs?app=${appId || 'all'}&limit=10`).then((r) => r.json()), fetcher
}) )
useImperativeHandle(ref, () => ({ refresh: mutate }))
const bugs = bugsData?.data || [] const bugs = bugsData?.data || []
@@ -41,54 +72,62 @@ export function ErrorDataTable({ appId }: ErrorDataTableProps) {
open() open()
} }
const getSeverityColor = (sev: string) => {
switch (sev?.toUpperCase()) {
case 'OPEN': return 'red'
case 'IN_PROGRESS': return 'orange'
case 'ON_HOLD': return 'yellow'
default: return 'gray'
}
}
return ( return (
<> <>
<Paper withBorder radius="2xl" className="glass overflow-hidden"> <Paper withBorder radius="2xl" className="glass" style={{ overflow: 'hidden' }}>
<Box p="xl" style={{ borderBottom: '1px solid rgba(255, 255, 255, 0.08)' }}> <Box p="lg" style={{ borderBottom: '1px solid rgba(255,255,255,0.08)' }}>
<Group justify="space-between"> <Group justify="space-between">
<Group gap="sm"> <Group gap="sm">
<ThemeIcon variant="light" color="red" size="lg" radius="md"> <ThemeIcon variant="light" color="red" size="lg" radius="md">
<TbBug size={20} /> <TbBug size={20} />
</ThemeIcon> </ThemeIcon>
<Text fw={700}>LATEST ERROR REPORTS</Text> <Stack gap={0}>
<Text fw={700} size="sm">Latest Error Reports</Text>
<Text size="xs" c="dimmed">Most recent open bugs</Text>
</Stack>
</Group> </Group>
<Button component={Link} to={appId ? `/apps/${appId}/errors` : '/bug-reports'} variant="subtle" size="compact-xs" color="blue" rightSection={<TbExternalLink size={14} />}> <Tooltip label="View all reports" withArrow>
View All Reports <Button
</Button> component={Link}
to={appId ? `/apps/${appId}/errors` : '/bug-reports'}
variant="subtle"
size="compact-sm"
color="blue"
rightSection={<TbExternalLink size={14} />}
>
View All
</Button>
</Tooltip>
</Group> </Group>
</Box> </Box>
<ScrollArea> <ScrollArea>
<Table verticalSpacing="md" highlightOnHover className="data-table"> <Table verticalSpacing="sm" highlightOnHover className="data-table">
<Table.Thead bg="rgba(0,0,0,0.1)"> <Table.Thead>
<Table.Tr> <Table.Tr>
<Table.Th px="xl">Error Message</Table.Th> <Table.Th px="lg">Error Description</Table.Th>
<Table.Th>Reporter</Table.Th> <Table.Th>Reporter</Table.Th>
<Table.Th>App Version</Table.Th> <Table.Th>Version</Table.Th>
<Table.Th>Timestamp</Table.Th> <Table.Th>Reported</Table.Th>
<Table.Th pr="xl">Severity</Table.Th> <Table.Th pr="lg">Status</Table.Th>
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
{isLoading ? ( {isLoading ? (
<Table.Tr> <Table.Tr>
<Table.Td colSpan={5} align="center" py="xl"> <Table.Td colSpan={5}>
Loading errors... <Group justify="center" py="xl">
<Loader size="sm" type="dots" />
</Group>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
) : bugs.length === 0 ? ( ) : bugs.length === 0 ? (
<Table.Tr> <Table.Tr>
<Table.Td colSpan={5} align="center" py="xl"> <Table.Td colSpan={5}>
No errors found. <Stack align="center" gap="xs" py="xl">
<TbBug size={32} style={{ opacity: 0.25 }} />
<Text size="sm" c="dimmed">No error reports found.</Text>
</Stack>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
) : bugs.map((error: any) => ( ) : bugs.map((error: any) => (
@@ -97,24 +136,34 @@ export function ErrorDataTable({ appId }: ErrorDataTableProps) {
onClick={() => handleRowClick(error)} onClick={() => handleRowClick(error)}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<Table.Td px="xl"> <Table.Td px="lg">
<Text size="sm" fw={600} lineClamp={1}>{error.description}</Text> <Text size="sm" fw={600} lineClamp={1}>{error.description}</Text>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Badge variant="dot" color="brand-blue" radius="sm">{error.user?.name || error.userId || 'System'}</Badge> <Badge variant="light" color="brand-blue" size="sm">
{error.user?.name || error.userId || 'System'}
</Badge>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Text size="xs" fw={700} c="dimmed">{error.affectedVersion || 'N/A'}</Text> <Badge variant="light" color="gray" size="sm">
v{error.affectedVersion || 'N/A'}
</Badge>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Group gap={6}> <Group gap={4}>
<TbHistory size={12} color="gray" /> <TbHistory size={12} color="gray" />
<Text size="xs" c="dimmed">{new Date(error.createdAt).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })}</Text> <Text size="xs" c="dimmed">
{dayjs(error.createdAt).format('D MMM YYYY, HH:mm')}
</Text>
</Group> </Group>
</Table.Td> </Table.Td>
<Table.Td pr="xl"> <Table.Td pr="lg">
<Badge color={getSeverityColor(error.status)} variant="light" size="sm"> <Badge
{(error.status || '').toUpperCase()} color={STATUS_COLOR[error.status?.toUpperCase()] ?? 'gray'}
variant="light"
size="sm"
>
{STATUS_LABEL[error.status?.toUpperCase()] ?? error.status}
</Badge> </Badge>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
@@ -131,37 +180,68 @@ export function ErrorDataTable({ appId }: ErrorDataTableProps) {
size="md" size="md"
title={ title={
<Group gap="xs"> <Group gap="xs">
<TbMessageReport color="#ef4444" size={24} /> <TbMessageReport color="#ef4444" size={22} />
<Title order={4}>Error Investigation</Title> <Title order={4}>Error Detail</Title>
</Group> </Group>
} }
styles={{ styles={{
header: { padding: '24px', borderBottom: '1px solid var(--mantine-color-default-border)' }, header: { padding: '20px 24px', borderBottom: '1px solid var(--mantine-color-default-border)' },
}} }}
> >
{selectedError && ( {selectedError && (
<Stack p="lg" gap="xl"> <Stack p="lg" gap="xl">
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>MESSAGE</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Description</Text>
<Text fw={700} size="lg" color="red">{selectedError.description}</Text> <Text fw={600} size="sm">{selectedError.description}</Text>
</Box> </Box>
<SimpleGrid cols={2} spacing="lg"> <SimpleGrid cols={2} spacing="lg">
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>SOURCE</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Status</Text>
<Text fw={600}>{selectedError.source}</Text> <Badge
color={STATUS_COLOR[selectedError.status?.toUpperCase()] ?? 'gray'}
variant="light"
size="sm"
>
{STATUS_LABEL[selectedError.status?.toUpperCase()] ?? selectedError.status}
</Badge>
</Box> </Box>
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>APP VERSION</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Source</Text>
<Badge variant="outline">{selectedError.affectedVersion || 'N/A'}</Badge> <Badge variant="light" color="gray" size="sm">{selectedError.source}</Badge>
</Box>
<Box>
<Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">App Version</Text>
<Badge variant="light" color="gray" size="sm">v{selectedError.affectedVersion || 'N/A'}</Badge>
</Box>
<Box>
<Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Reported</Text>
<Text size="sm" fw={500}>{dayjs(selectedError.createdAt).format('D MMM YYYY, HH:mm')}</Text>
</Box> </Box>
</SimpleGrid> </SimpleGrid>
{selectedError.device && (
<Box>
<Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Device</Text>
<Text size="sm">{selectedError.device} · {selectedError.os}</Text>
</Box>
)}
{selectedError.feedBack && (
<>
<Divider opacity={0.1} />
<Box>
<Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Developer Feedback</Text>
<Text size="sm" style={{ whiteSpace: 'pre-wrap' }}>{selectedError.feedBack}</Text>
</Box>
</>
)}
<Divider opacity={0.1} /> <Divider opacity={0.1} />
<Box> <Box>
<Group justify="space-between" mb="sm"> <Group justify="space-between" mb="sm">
<Text size="xs" fw={700} c="dimmed">STACK TRACE</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">Stack Trace</Text>
<Button <Button
variant="subtle" variant="subtle"
size="compact-xs" size="compact-xs"
@@ -172,8 +252,12 @@ export function ErrorDataTable({ appId }: ErrorDataTableProps) {
</Button> </Button>
</Group> </Group>
{showStackTrace && ( {showStackTrace && (
<Code block color="red" style={{ whiteSpace: 'pre-wrap', lineHeight: 1.6, border: '1px solid var(--mantine-color-default-border)' }}> <Code
{selectedError.stackTrace} block
color="red"
style={{ whiteSpace: 'pre-wrap', lineHeight: 1.6, fontSize: 11, border: '1px solid var(--mantine-color-default-border)' }}
>
{selectedError.stackTrace || '(no stack trace)'}
</Code> </Code>
)} )}
</Box> </Box>
@@ -182,6 +266,4 @@ export function ErrorDataTable({ appId }: ErrorDataTableProps) {
</Drawer> </Drawer>
</> </>
) )
} })
import { SimpleGrid, ThemeIcon } from '@mantine/core'

View File

@@ -14,18 +14,21 @@ interface StatsCardProps {
} }
export function StatsCard({ title, value, description, icon: Icon, color, trend }: StatsCardProps) { export function StatsCard({ title, value, description, icon: Icon, color, trend }: StatsCardProps) {
const accentColor = `var(--mantine-color-${color ?? 'brand-blue'}-5)`
return ( return (
<Card <Card
withBorder withBorder
padding="lg" padding="lg"
radius="xl" radius="xl"
className="premium-card" className="premium-card"
styles={(theme) => ({ styles={{
root: { root: {
backgroundColor: 'var(--mantine-color-body)', backgroundColor: 'var(--mantine-color-body)',
borderColor: 'rgba(128,128,128,0.1)', borderColor: 'rgba(128,128,128,0.1)',
borderTop: `3px solid ${accentColor}`,
}, },
})} }}
> >
<Group justify="space-between" mb="xs"> <Group justify="space-between" mb="xs">
<ThemeIcon <ThemeIcon

View File

@@ -1,32 +1,49 @@
export const API_BASE_URL = import.meta.env.VITE_URL_API_DESA_PLUS const DESA_PLUS_PROXY = '/api/proxy/desa-plus'
export const API_URLS = { export const API_URLS = {
getVillages: (page: number, search: string) => getVillages: (page: number, search: string) =>
`${API_BASE_URL}/api/monitoring/get-villages?page=${page}&search=${encodeURIComponent(search)}`, `${DESA_PLUS_PROXY}/api/monitoring/get-villages?page=${page}&search=${encodeURIComponent(search)}`,
infoVillages: (id: string) => infoVillages: (id: string) =>
`${API_BASE_URL}/api/monitoring/info-villages?id=${id}`, `${DESA_PLUS_PROXY}/api/monitoring/info-villages?id=${id}`,
gridVillages: (id: string) => gridVillages: (id: string) =>
`${API_BASE_URL}/api/monitoring/grid-villages?id=${id}`, `${DESA_PLUS_PROXY}/api/monitoring/grid-villages?id=${id}`,
graphLogVillages: (id: string, time: string) => graphLogVillages: (id: string, time: string) =>
`${API_BASE_URL}/api/monitoring/graph-log-villages?id=${id}&time=${time}`, `${DESA_PLUS_PROXY}/api/monitoring/graph-log-villages?id=${id}&time=${time}`,
getUsers: (page: number, search: string) => getUsers: (page: number, search: string, isActive?: string, idUserRole?: string, idVillage?: string, orderBy?: string, orderDir?: string) => {
`${API_BASE_URL}/api/monitoring/user?page=${page}&search=${encodeURIComponent(search)}`, const params = new URLSearchParams({ page: String(page), search })
getLogsAllVillages: (page: number, search: string) => if (isActive !== undefined) params.set('isActive', isActive)
`${API_BASE_URL}/api/monitoring/log-all-villages?page=${page}&search=${encodeURIComponent(search)}`, if (idUserRole) params.set('idUserRole', idUserRole)
getGridOverview: () => `${API_BASE_URL}/api/monitoring/grid-overview`, if (idVillage) params.set('idVillage', idVillage)
getDailyActivity: () => `${API_BASE_URL}/api/monitoring/daily-activity`, if (orderBy) params.set('orderBy', orderBy)
getComparisonActivity: () => `${API_BASE_URL}/api/monitoring/comparison-activity`, if (orderDir) params.set('orderDir', orderDir)
postVersionUpdate: () => `${API_BASE_URL}/api/monitoring/version-update`, return `${DESA_PLUS_PROXY}/api/monitoring/user?${params}`
createVillages: () => `${API_BASE_URL}/api/monitoring/create-villages`, },
createUser: () => `${API_BASE_URL}/api/monitoring/create-user`, getLogsAllVillages: (page: number, search: string, action?: string, idVillage?: string, dateFrom?: string, dateTo?: string) => {
listRole: () => `${API_BASE_URL}/api/monitoring/list-userrole-villages`, const params = new URLSearchParams({ page: String(page), search })
listGroup: (id: string) => `${API_BASE_URL}/api/monitoring/list-group-villages?id=${id}`, if (action) params.set('action', action)
listPosition: (id: string) => `${API_BASE_URL}/api/monitoring/list-position-villages?id=${id}`, if (idVillage) params.set('idVillage', idVillage)
editUser: () => `${API_BASE_URL}/api/monitoring/edit-user`, if (dateFrom) params.set('dateFrom', dateFrom)
updateStatusVillages: () => `${API_BASE_URL}/api/monitoring/update-status-villages`, if (dateTo) params.set('dateTo', dateTo)
editVillages: () => `${API_BASE_URL}/api/monitoring/edit-villages`, return `${DESA_PLUS_PROXY}/api/monitoring/log-all-villages?${params}`
getGlobalLogs: (page: number, search: string, type: string, userId: string) => },
`/api/logs?page=${page}&search=${encodeURIComponent(search)}&type=${type}&userId=${userId}`, getGridOverview: () => `${DESA_PLUS_PROXY}/api/monitoring/grid-overview`,
getDailyActivity: (range: 7 | 30 | 90 = 7) => `${DESA_PLUS_PROXY}/api/monitoring/daily-activity?range=${range}`,
getComparisonActivity: (range: 7 | 30 | 90 = 7) => `${DESA_PLUS_PROXY}/api/monitoring/comparison-activity?range=${range}`,
postVersionUpdate: () => `${DESA_PLUS_PROXY}/api/monitoring/version-update`,
createVillages: () => `${DESA_PLUS_PROXY}/api/monitoring/create-villages`,
createUser: () => `${DESA_PLUS_PROXY}/api/monitoring/create-user`,
listRole: () => `${DESA_PLUS_PROXY}/api/monitoring/list-userrole-villages`,
listGroup: (id: string) => `${DESA_PLUS_PROXY}/api/monitoring/list-group-villages?id=${id}`,
listPosition: (id: string) => `${DESA_PLUS_PROXY}/api/monitoring/list-position-villages?id=${id}`,
editUser: () => `${DESA_PLUS_PROXY}/api/monitoring/edit-user`,
updateStatusVillages: () => `${DESA_PLUS_PROXY}/api/monitoring/update-status-villages`,
editVillages: () => `${DESA_PLUS_PROXY}/api/monitoring/edit-villages`,
getGlobalLogs: (page: number, search: string, type: string, userId: string, dateFrom?: string, dateTo?: string) => {
const params = new URLSearchParams({ page: String(page), search, type, userId })
if (dateFrom) params.set('dateFrom', dateFrom)
if (dateTo) params.set('dateTo', dateTo)
return `/api/logs?${params}`
},
getLogOperators: () => `/api/logs/operators`, getLogOperators: () => `/api/logs/operators`,
getOperators: (page: number, search: string) => getOperators: (page: number, search: string) =>
`/api/operators?page=${page}&search=${encodeURIComponent(search)}`, `/api/operators?page=${page}&search=${encodeURIComponent(search)}`,

View File

@@ -21,12 +21,14 @@ import {
TextInput, TextInput,
ThemeIcon, ThemeIcon,
Timeline, Timeline,
Title Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications' import { notifications } from '@mantine/notifications'
import { useQuery } from '@tanstack/react-query' import { useQuery } from '@tanstack/react-query'
import { createFileRoute, useParams } from '@tanstack/react-router' import { createFileRoute, useParams } from '@tanstack/react-router'
import dayjs from 'dayjs'
import { useState } from 'react' import { useState } from 'react'
import { import {
TbAlertTriangle, TbAlertTriangle,
@@ -35,7 +37,6 @@ import {
TbCircleX, TbCircleX,
TbDeviceDesktop, TbDeviceDesktop,
TbDeviceMobile, TbDeviceMobile,
TbFilter,
TbHistory, TbHistory,
TbPhoto, TbPhoto,
TbPlus, TbPlus,
@@ -47,43 +48,48 @@ export const Route = createFileRoute('/apps/$appId/errors')({
component: AppErrorsPage, component: AppErrorsPage,
}) })
const STATUS_COLOR: Record<string, string> = {
OPEN: 'red',
IN_PROGRESS: 'blue',
ON_HOLD: 'orange',
RESOLVED: 'teal',
RELEASED: 'green',
CLOSED: 'gray',
}
const STATUS_LABEL: Record<string, string> = {
OPEN: 'Open',
ON_HOLD: 'On Hold',
IN_PROGRESS: 'In Progress',
RESOLVED: 'Resolved',
RELEASED: 'Released',
CLOSED: 'Closed',
}
function AppErrorsPage() { function AppErrorsPage() {
const { appId } = useParams({ from: '/apps/$appId/errors' }) const { appId } = useParams({ from: '/apps/$appId/errors' })
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [search, setSearch] = useState('') const [search, setSearch] = useState('')
const [app, setApp] = useState(appId)
const [status, setStatus] = useState('all') const [status, setStatus] = useState('all')
const [showLogs, setShowLogs] = useState<Record<string, boolean>>({}) const [showLogs, setShowLogs] = useState<Record<string, boolean>>({})
const [showStackTrace, setShowStackTrace] = useState<Record<string, boolean>>({}) const [showStackTrace, setShowStackTrace] = useState<Record<string, boolean>>({})
const toggleLogs = (bugId: string) => { const toggleLogs = (bugId: string) => setShowLogs((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
setShowLogs((prev) => ({ ...prev, [bugId]: !prev[bugId] })) const toggleStackTrace = (bugId: string) => setShowStackTrace((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
}
const toggleStackTrace = (bugId: string) => {
setShowStackTrace((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
}
const { data, isLoading, refetch } = useQuery({ const { data, isLoading, refetch } = useQuery({
queryKey: ['bugs', { page, search, app, status }], queryKey: ['bugs', { page, search, app: appId, status }],
queryFn: () => queryFn: () => fetch(API_URLS.getBugs(page, search, appId, status)).then((r) => r.json()),
fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
}) })
// Fetch apps for the dropdown
const { data: appsList } = useQuery({ const { data: appsList } = useQuery({
queryKey: ['apps-list'], queryKey: ['apps-list'],
queryFn: () => fetch('/api/apps').then((r) => r.json()), queryFn: () => fetch('/api/apps').then((r) => r.json()),
}) })
// Image Preview
const [previewImage, setPreviewImage] = useState<string | null>(null) const [previewImage, setPreviewImage] = useState<string | null>(null)
// Create Bug Modal Logic
const [opened, { open, close }] = useDisclosure(false) const [opened, { open, close }] = useDisclosure(false)
const [isSubmitting, setIsSubmitting] = useState(false) const [isSubmitting, setIsSubmitting] = useState(false)
const [imageFiles, setImageFiles] = useState<File[]>([]) const [imageFiles, setImageFiles] = useState<File[]>([])
@@ -97,25 +103,17 @@ function AppErrorsPage() {
stackTrace: '', stackTrace: '',
}) })
// Update Status Modal Logic
const [updateModalOpened, { open: openUpdateModal, close: closeUpdateModal }] = useDisclosure(false) const [updateModalOpened, { open: openUpdateModal, close: closeUpdateModal }] = useDisclosure(false)
const [isUpdating, setIsUpdating] = useState(false) const [isUpdating, setIsUpdating] = useState(false)
const [selectedBugId, setSelectedBugId] = useState<string | null>(null) const [selectedBugId, setSelectedBugId] = useState<string | null>(null)
const [updateForm, setUpdateForm] = useState({ const [updateForm, setUpdateForm] = useState({ status: '', description: '' })
status: '',
description: '',
})
// Feedback Modal Logic
const [feedbackModalOpened, { open: openFeedbackModal, close: closeFeedbackModal }] = useDisclosure(false) const [feedbackModalOpened, { open: openFeedbackModal, close: closeFeedbackModal }] = useDisclosure(false)
const [isUpdatingFeedback, setIsUpdatingFeedback] = useState(false) const [isUpdatingFeedback, setIsUpdatingFeedback] = useState(false)
const [feedbackForm, setFeedbackForm] = useState({ const [feedbackForm, setFeedbackForm] = useState({ feedBack: '' })
feedBack: '',
})
const handleUpdateFeedback = async () => { const handleUpdateFeedback = async () => {
if (!selectedBugId || !feedbackForm.feedBack) return if (!selectedBugId || !feedbackForm.feedBack) return
setIsUpdatingFeedback(true) setIsUpdatingFeedback(true)
try { try {
const res = await fetch(API_URLS.updateBugFeedback(selectedBugId), { const res = await fetch(API_URLS.updateBugFeedback(selectedBugId), {
@@ -123,27 +121,16 @@ function AppErrorsPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(feedbackForm), body: JSON.stringify(feedbackForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ notifications.show({ title: 'Success', message: 'Feedback has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> })
title: 'Success',
message: 'Feedback has been updated.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
closeFeedbackModal() closeFeedbackModal()
setFeedbackForm({ feedBack: '' }) setFeedbackForm({ feedBack: '' })
} else { } else {
throw new Error('Failed to update feedback') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsUpdatingFeedback(false) setIsUpdatingFeedback(false)
} }
@@ -151,7 +138,6 @@ function AppErrorsPage() {
const handleUpdateStatus = async () => { const handleUpdateStatus = async () => {
if (!selectedBugId || !updateForm.status) return if (!selectedBugId || !updateForm.status) return
setIsUpdating(true) setIsUpdating(true)
try { try {
const res = await fetch(API_URLS.updateBugStatus(selectedBugId), { const res = await fetch(API_URLS.updateBugStatus(selectedBugId), {
@@ -159,27 +145,16 @@ function AppErrorsPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updateForm), body: JSON.stringify(updateForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ notifications.show({ title: 'Success', message: 'Status has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> })
title: 'Success',
message: 'Status has been updated.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
closeUpdateModal() closeUpdateModal()
setUpdateForm({ status: '', description: '' }) setUpdateForm({ status: '', description: '' })
} else { } else {
throw new Error('Failed to update status') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsUpdating(false) setIsUpdating(false)
} }
@@ -187,14 +162,9 @@ function AppErrorsPage() {
const handleCreateBug = async () => { const handleCreateBug = async () => {
if (!createForm.description || !createForm.affectedVersion || !createForm.device || !createForm.os) { if (!createForm.description || !createForm.affectedVersion || !createForm.device || !createForm.os) {
notifications.show({ notifications.show({ title: 'Validation Error', message: 'Please fill in all required fields.', color: 'red' })
title: 'Validation Error',
message: 'Please fill in all required fields.',
color: 'red',
})
return return
} }
setIsSubmitting(true) setIsSubmitting(true)
try { try {
const imageUrls: string[] = [] const imageUrls: string[] = []
@@ -202,52 +172,31 @@ function AppErrorsPage() {
const formData = new FormData() const formData = new FormData()
formData.append('file', file) formData.append('file', file)
const uploadRes = await fetch(API_URLS.uploadImage(), { method: 'POST', body: formData }) const uploadRes = await fetch(API_URLS.uploadImage(), { method: 'POST', body: formData })
if (!uploadRes.ok) throw new Error('Gagal mengupload gambar') if (!uploadRes.ok) throw new Error('Failed to upload image')
const { url } = await uploadRes.json() const { url } = await uploadRes.json()
imageUrls.push(url) imageUrls.push(url)
} }
const res = await fetch(API_URLS.createBug(), { const res = await fetch(API_URLS.createBug(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...createForm, imageUrls: imageUrls.length ? imageUrls : undefined }), body: JSON.stringify({ ...createForm, imageUrls: imageUrls.length ? imageUrls : undefined }),
}) })
if (res.ok) { if (res.ok) {
await fetch(API_URLS.createLog(), { await fetch(API_URLS.createLog(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'CREATE', message: `Report error baru ditambahkan: ${createForm.description.substring(0, 50)}${createForm.description.length > 50 ? '...' : ''}` }) body: JSON.stringify({ type: 'CREATE', message: `New error report added: ${createForm.description.substring(0, 50)}${createForm.description.length > 50 ? '...' : ''}` }),
}).catch(console.error) }).catch(console.error)
notifications.show({ title: 'Success', message: 'Error report has been created.', color: 'teal', icon: <TbCircleCheck size={18} /> })
notifications.show({
title: 'Success',
message: 'Error report has been created.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
close() close()
setImageFiles([]) setImageFiles([])
setCreateForm({ setCreateForm({ description: '', app: appId, source: 'USER', affectedVersion: '', device: '', os: '', stackTrace: '' })
description: '',
app: appId,
source: 'USER',
affectedVersion: '',
device: '',
os: '',
stackTrace: '',
})
} else { } else {
throw new Error('Failed to create error report') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsSubmitting(false) setIsSubmitting(false)
} }
@@ -257,16 +206,19 @@ function AppErrorsPage() {
const totalPages = data?.totalPages || 1 const totalPages = data?.totalPages || 1
return ( return (
<Stack gap="xl"> <Stack gap="xl" py="md">
<Group justify="space-between" align="center"> <Group justify="space-between" align="flex-start">
<Stack gap={0}> <Stack gap={4}>
<Title order={3}>Error Reporting Center</Title> <Title order={3}>Error Reports</Title>
<Text size="sm" c="dimmed">Advanced analysis of health issues and crashes for <b>{appId}</b>.</Text> <Text size="sm" c="dimmed">
Bug reports and crash tracking for this application.
</Text>
</Stack> </Stack>
<Button <Button
variant="gradient" variant="gradient"
gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }} gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }}
leftSection={<TbPlus size={18} />} leftSection={<TbPlus size={18} />}
size="sm"
onClick={open} onClick={open}
> >
Report Error Report Error
@@ -278,7 +230,7 @@ function AppErrorsPage() {
opened={!!previewImage} opened={!!previewImage}
onClose={() => setPreviewImage(null)} onClose={() => setPreviewImage(null)}
size="xl" size="xl"
radius="xl" radius="md"
padding={0} padding={0}
withCloseButton={false} withCloseButton={false}
overlayProps={{ backgroundOpacity: 0.75, blur: 6 }} overlayProps={{ backgroundOpacity: 0.75, blur: 6 }}
@@ -286,12 +238,7 @@ function AppErrorsPage() {
onClick={() => setPreviewImage(null)} onClick={() => setPreviewImage(null)}
> >
{previewImage && ( {previewImage && (
<Image <Image src={previewImage} alt="Preview" fit="contain" style={{ maxHeight: '85vh', width: '100%' }} />
src={previewImage}
alt="Preview"
fit="contain"
style={{ maxHeight: '85vh', width: '100%' }}
/>
)} )}
</Modal> </Modal>
@@ -299,28 +246,21 @@ function AppErrorsPage() {
opened={updateModalOpened} opened={updateModalOpened}
onClose={closeUpdateModal} onClose={closeUpdateModal}
title={<Text fw={700} size="lg">Update Bug Status</Text>} title={<Text fw={700} size="lg">Update Bug Status</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
<Select <Select
label="New Status" label="New Status"
placeholder="Select status" placeholder="Select a status"
required required
data={[ data={Object.entries(STATUS_LABEL).map(([value, label]) => ({ value, label }))}
{ value: 'OPEN', label: 'Open' },
{ value: 'ON_HOLD', label: 'On Hold' },
{ value: 'IN_PROGRESS', label: 'In Progress' },
{ value: 'RESOLVED', label: 'Resolved' },
{ value: 'RELEASED', label: 'Released' },
{ value: 'CLOSED', label: 'Closed' },
]}
value={updateForm.status} value={updateForm.status}
onChange={(val) => setUpdateForm({ ...updateForm, status: val || '' })} onChange={(val) => setUpdateForm({ ...updateForm, status: val || '' })}
/> />
<Textarea <Textarea
label="Update Note (Optional)" label="Update Note (Optional)"
placeholder="E.g. Fixed in commit xxxxx / Assigned to team" placeholder="e.g. Fixed in commit abc123 / Assigned to team"
minRows={3} minRows={3}
value={updateForm.description} value={updateForm.description}
onChange={(e) => setUpdateForm({ ...updateForm, description: e.target.value })} onChange={(e) => setUpdateForm({ ...updateForm, description: e.target.value })}
@@ -342,7 +282,7 @@ function AppErrorsPage() {
opened={feedbackModalOpened} opened={feedbackModalOpened}
onClose={closeFeedbackModal} onClose={closeFeedbackModal}
title={<Text fw={700} size="lg">Developer Feedback</Text>} title={<Text fw={700} size="lg">Developer Feedback</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
@@ -353,7 +293,7 @@ function AppErrorsPage() {
required required
minRows={4} minRows={4}
value={feedbackForm.feedBack} value={feedbackForm.feedBack}
onChange={(e) => setFeedbackForm({ ...feedbackForm, feedBack: e.target.value })} onChange={(e) => setFeedbackForm({ feedBack: e.target.value })}
/> />
<Button <Button
fullWidth fullWidth
@@ -370,9 +310,9 @@ function AppErrorsPage() {
<Modal <Modal
opened={opened} opened={opened}
onClose={() => { close(); setImageFiles([]); }} onClose={() => { close(); setImageFiles([]) }}
title={<Text fw={700} size="lg">Report New Error</Text>} title={<Text fw={700} size="lg">Report New Error</Text>}
radius="xl" radius="md"
size="lg" size="lg"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
@@ -385,7 +325,6 @@ function AppErrorsPage() {
value={createForm.description} value={createForm.description}
onChange={(e) => setCreateForm({ ...createForm, description: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, description: e.target.value })}
/> />
<SimpleGrid cols={2}> <SimpleGrid cols={2}>
<Select <Select
label="Application" label="Application"
@@ -406,19 +345,17 @@ function AppErrorsPage() {
onChange={(val) => setCreateForm({ ...createForm, source: val as any })} onChange={(val) => setCreateForm({ ...createForm, source: val as any })}
/> />
</SimpleGrid> </SimpleGrid>
<TextInput <TextInput
label="Version" label="Affected Version"
placeholder="e.g. 2.4.1" placeholder="e.g. 2.4.1"
required required
value={createForm.affectedVersion} value={createForm.affectedVersion}
onChange={(e) => setCreateForm({ ...createForm, affectedVersion: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, affectedVersion: e.target.value })}
/> />
<SimpleGrid cols={2}> <SimpleGrid cols={2}>
<TextInput <TextInput
label="Device" label="Device"
placeholder="e.g. iPhone 13, Windows 11 PC" placeholder="e.g. iPhone 13, Windows PC"
required required
value={createForm.device} value={createForm.device}
onChange={(e) => setCreateForm({ ...createForm, device: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, device: e.target.value })}
@@ -431,17 +368,16 @@ function AppErrorsPage() {
onChange={(e) => setCreateForm({ ...createForm, os: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, os: e.target.value })}
/> />
</SimpleGrid> </SimpleGrid>
<FileInput <FileInput
label="Screenshot (Optional)" label="Screenshots (Optional)"
placeholder="Klik untuk upload gambar..." placeholder="Click to upload images..."
accept="image/*" accept="image/*"
leftSection={<TbPhoto size={16} />} leftSection={<TbPhoto size={16} />}
description="Maks 3 gambar · 5MB per file · JPG, PNG, WEBP" description="Max 3 images · 5 MB each · JPG, PNG, WEBP"
value={imageFiles} value={imageFiles}
onChange={(files) => { onChange={(files) => {
if (files.length > 3) { if (files.length > 3) {
notifications.show({ title: 'Error', message: 'Maksimal 3 gambar', color: 'red' }) notifications.show({ title: 'Error', message: 'Maximum 3 images allowed.', color: 'red' })
return return
} }
setImageFiles(files) setImageFiles(files)
@@ -449,16 +385,14 @@ function AppErrorsPage() {
clearable clearable
multiple multiple
/> />
<Textarea <Textarea
label="Stack Trace (Optional)" label="Stack Trace (Optional)"
placeholder="Paste code or error logs here..." placeholder="Paste error logs or stack trace here..."
style={{ fontFamily: 'monospace' }} style={{ fontFamily: 'monospace' }}
minRows={2} minRows={2}
value={createForm.stackTrace} value={createForm.stackTrace}
onChange={(e) => setCreateForm({ ...createForm, stackTrace: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, stackTrace: e.target.value })}
/> />
<Button <Button
fullWidth fullWidth
mt="md" mt="md"
@@ -473,47 +407,49 @@ function AppErrorsPage() {
</Modal> </Modal>
<Paper withBorder radius="2xl" className="glass" p="md"> <Paper withBorder radius="2xl" className="glass" p="md">
<SimpleGrid cols={{ base: 1, sm: 3 }} mb="md"> <SimpleGrid cols={{ base: 1, sm: 3 }} mb="lg">
<TextInput <TextInput
placeholder="Search description, device, os..." label="Search"
placeholder="Description, device, OS..."
leftSection={<TbSearch size={16} />} leftSection={<TbSearch size={16} />}
value={search} value={search}
onChange={(e) => setSearch(e.currentTarget.value)} onChange={(e) => setSearch(e.currentTarget.value)}
radius="md" radius="md"
size="sm"
/> />
<Select <Select
placeholder="Status" label="Status"
size="sm"
data={[ data={[
{ value: 'all', label: 'All Status' }, { value: 'all', label: 'All Status' },
{ value: 'OPEN', label: 'Open' }, ...Object.entries(STATUS_LABEL).map(([value, label]) => ({ value, label })),
{ value: 'ON_HOLD', label: 'On Hold' },
{ value: 'IN_PROGRESS', label: 'In Progress' },
{ value: 'RESOLVED', label: 'Resolved' },
{ value: 'RELEASED', label: 'Released' },
{ value: 'CLOSED', label: 'Closed' },
]} ]}
value={status} value={status}
onChange={(val) => setStatus(val || 'all')} onChange={(val) => setStatus(val || 'all')}
radius="md" radius="md"
/> />
<Group justify="flex-end"> <Stack justify="flex-end">
<Button variant="subtle" color="gray" leftSection={<TbFilter size={16} />} onClick={() => { setSearch(''); setStatus('all') }}> <Button
Reset variant="filled"
color="violet"
size="sm"
onClick={() => { setSearch(''); setStatus('all') }}
>
Reset Filters
</Button> </Button>
</Group> </Stack>
</SimpleGrid> </SimpleGrid>
{isLoading ? ( {isLoading ? (
<Stack align="center" py="xl"> <Stack align="center" py="xl">
<Loader size="lg" type="dots" /> <Loader size="md" type="dots" />
<Text size="sm" c="dimmed">Loading error reports...</Text>
</Stack> </Stack>
) : bugs.length === 0 ? ( ) : bugs.length === 0 ? (
<Paper p="xl" withBorder style={{ borderStyle: 'dashed', textAlign: 'center' }}> <Stack align="center" py="xl" gap="xs">
<TbBug size={48} color="gray" style={{ marginBottom: 12, opacity: 0.5 }} /> <TbBug size={40} style={{ opacity: 0.25 }} />
<Text fw={600}>No error reports found</Text> <Text fw={600} size="sm">No error reports found</Text>
<Text size="sm" c="dimmed">Try adjusting your filters or search terms.</Text> <Text size="sm" c="dimmed">Try adjusting your filters or search terms.</Text>
</Paper> </Stack>
) : ( ) : (
<Accordion variant="separated" radius="xl"> <Accordion variant="separated" radius="xl">
{bugs.map((bug: any) => ( {bugs.map((bug: any) => (
@@ -523,19 +459,13 @@ function AppErrorsPage() {
style={{ style={{
border: '1px solid var(--mantine-color-default-border)', border: '1px solid var(--mantine-color-default-border)',
background: 'var(--mantine-color-default)', background: 'var(--mantine-color-default)',
marginBottom: '12px', marginBottom: 12,
}} }}
> >
<Accordion.Control> <Accordion.Control>
<Group wrap="nowrap"> <Group wrap="nowrap">
<ThemeIcon <ThemeIcon
color={ color={STATUS_COLOR[bug.status] ?? 'gray'}
bug.status === 'OPEN'
? 'red'
: bug.status === 'IN_PROGRESS'
? 'blue'
: 'teal'
}
variant="light" variant="light"
size="lg" size="lg"
radius="md" radius="md"
@@ -544,37 +474,27 @@ function AppErrorsPage() {
</ThemeIcon> </ThemeIcon>
<Box style={{ flex: 1 }}> <Box style={{ flex: 1 }}>
<Group justify="space-between"> <Group justify="space-between">
<Text size="sm" fw={600} lineClamp={1}> <Text size="sm" fw={600} lineClamp={1}>{bug.description}</Text>
{bug.description}
</Text>
<Badge <Badge
color={ color={STATUS_COLOR[bug.status] ?? 'gray'}
bug.status === 'OPEN'
? 'red'
: bug.status === 'IN_PROGRESS'
? 'blue'
: 'teal'
}
variant="dot" variant="dot"
size="xs" size="sm"
> >
{bug.status} {STATUS_LABEL[bug.status] ?? bug.status}
</Badge> </Badge>
</Group> </Group>
<Group gap="md"> <Text size="xs" c="dimmed">
<Text size="xs" c="dimmed"> {dayjs(bug.createdAt).format('D MMM YYYY, HH:mm')} · {bug.appId?.toUpperCase()} · v{bug.affectedVersion}
{new Date(bug.createdAt).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })} {bug.appId?.toUpperCase()} v{bug.affectedVersion} </Text>
</Text>
</Group>
</Box> </Box>
</Group> </Group>
</Accordion.Control> </Accordion.Control>
<Accordion.Panel> <Accordion.Panel>
<Stack gap="lg" py="xs"> <Stack gap="lg" py="xs">
{/* Device Info */}
<SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg">
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>DEVICE METADATA</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Device Metadata</Text>
<Group gap="xs"> <Group gap="xs">
{bug.device.toLowerCase().includes('windows') || bug.device.toLowerCase().includes('mac') || bug.device.toLowerCase().includes('pc') ? ( {bug.device.toLowerCase().includes('windows') || bug.device.toLowerCase().includes('mac') || bug.device.toLowerCase().includes('pc') ? (
<TbDeviceDesktop size={14} color="gray" /> <TbDeviceDesktop size={14} color="gray" />
@@ -585,17 +505,16 @@ function AppErrorsPage() {
</Group> </Group>
</Box> </Box>
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>SOURCE</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Source</Text>
<Badge variant="light" color="gray" size="sm">{bug.source}</Badge> <Badge variant="light" color="gray" size="sm">{bug.source}</Badge>
</Box> </Box>
</SimpleGrid> </SimpleGrid>
{/* Feedback & Reporter Info */}
{(bug.user || bug.feedBack) && ( {(bug.user || bug.feedBack) && (
<SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg">
{bug.user && ( {bug.user && (
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>REPORTED BY</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Reported By</Text>
<Group gap="xs"> <Group gap="xs">
<Avatar src={bug.user.image} radius="xl" size="sm" color="blue"> <Avatar src={bug.user.image} radius="xl" size="sm" color="blue">
{bug.user.name?.charAt(0).toUpperCase()} {bug.user.name?.charAt(0).toUpperCase()}
@@ -606,24 +525,18 @@ function AppErrorsPage() {
)} )}
{bug.feedBack && ( {bug.feedBack && (
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>DEVELOPER FEEDBACK</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Developer Feedback</Text>
<Text size="sm" style={{ whiteSpace: 'pre-wrap' }}>{bug.feedBack}</Text> <Text size="sm" style={{ whiteSpace: 'pre-wrap' }}>{bug.feedBack}</Text>
</Box> </Box>
)} )}
</SimpleGrid> </SimpleGrid>
)} )}
{/* Stack Trace */}
{bug.stackTrace && ( {bug.stackTrace && (
<Box> <Box>
<Group justify="space-between" mb={4}> <Group justify="space-between" mb={showStackTrace[bug.id] ? 8 : 0}>
<Text size="xs" fw={700} c="dimmed">STACK TRACE</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">Stack Trace</Text>
<Button <Button variant="subtle" size="compact-xs" color="gray" onClick={() => toggleStackTrace(bug.id)}>
variant="subtle"
size="compact-xs"
color="gray"
onClick={() => toggleStackTrace(bug.id)}
>
{showStackTrace[bug.id] ? 'Hide' : 'Show'} {showStackTrace[bug.id] ? 'Hide' : 'Show'}
</Button> </Button>
</Group> </Group>
@@ -631,12 +544,7 @@ function AppErrorsPage() {
<Code <Code
block block
color="red" color="red"
style={{ style={{ fontFamily: 'monospace', whiteSpace: 'pre-wrap', fontSize: 11, border: '1px solid var(--mantine-color-default-border)' }}
fontFamily: 'monospace',
whiteSpace: 'pre-wrap',
fontSize: '11px',
border: '1px solid var(--mantine-color-default-border)',
}}
> >
{bug.stackTrace} {bug.stackTrace}
</Code> </Code>
@@ -644,43 +552,41 @@ function AppErrorsPage() {
</Box> </Box>
)} )}
{/* Images */}
{bug.images && bug.images.length > 0 && ( {bug.images && bug.images.length > 0 && (
<Box> <Box>
<Group gap="xs" mb={8}> <Group gap="xs" mb={8}>
<TbPhoto size={16} color="gray" /> <TbPhoto size={14} color="gray" />
<Text size="xs" fw={700} c="dimmed">ATTACHED IMAGES ({bug.images.length})</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">
Attached Images ({bug.images.length})
</Text>
</Group> </Group>
<SimpleGrid cols={{ base: 2, sm: 4 }} spacing="xs"> <SimpleGrid cols={{ base: 2, sm: 4 }} spacing="xs">
{bug.images.map((img: any) => ( {bug.images.map((img: any) => (
<Paper <Tooltip key={img.id} label="Click to preview" withArrow>
key={img.id} <Paper
withBorder withBorder
radius="md" radius="md"
style={{ overflow: 'hidden', cursor: 'zoom-in' }} style={{ overflow: 'hidden', cursor: 'zoom-in' }}
onClick={() => setPreviewImage(img.imageUrl)} onClick={() => setPreviewImage(img.imageUrl)}
> >
<Image src={img.imageUrl} alt="Error screenshot" height={100} fit="cover" /> <Image src={img.imageUrl} alt="Error screenshot" height={100} fit="cover" />
</Paper> </Paper>
</Tooltip>
))} ))}
</SimpleGrid> </SimpleGrid>
</Box> </Box>
)} )}
{/* Logs / History */}
{bug.logs && bug.logs.length > 0 && ( {bug.logs && bug.logs.length > 0 && (
<Box> <Box>
<Group justify="space-between" mb={showLogs[bug.id] ? 12 : 0}> <Group justify="space-between" mb={showLogs[bug.id] ? 12 : 0}>
<Group gap="xs"> <Group gap="xs">
<TbHistory size={16} color="gray" /> <TbHistory size={14} color="gray" />
<Text size="xs" fw={700} c="dimmed">ACTIVITY LOG ({bug.logs.length})</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">
Activity Log ({bug.logs.length})
</Text>
</Group> </Group>
<Button <Button variant="subtle" size="compact-xs" color="gray" onClick={() => toggleLogs(bug.id)}>
variant="subtle"
size="compact-xs"
color="gray"
onClick={() => toggleLogs(bug.id)}
>
{showLogs[bug.id] ? 'Hide' : 'Show'} {showLogs[bug.id] ? 'Hide' : 'Show'}
</Button> </Button>
</Group> </Group>
@@ -690,12 +596,16 @@ function AppErrorsPage() {
<Timeline.Item <Timeline.Item
key={log.id} key={log.id}
bullet={ bullet={
<Badge size="xs" circle color={log.status === 'RESOLVED' ? 'teal' : 'blue'}> </Badge> <Badge size="xs" circle color={STATUS_COLOR[log.status] ?? 'blue'}> </Badge>
}
title={
<Text size="sm" fw={600}>
{STATUS_LABEL[log.status] ?? log.status}
</Text>
} }
title={<Text size="sm" fw={600}>{log.status}</Text>}
> >
<Text size="xs" c="dimmed" mb={4}> <Text size="xs" c="dimmed" mb={4}>
{new Date(log.createdAt).toLocaleString()} by {log.user?.name || 'Unknown'} {dayjs(log.createdAt).format('D MMM YYYY, HH:mm')} · {log.user?.name ?? 'Unknown'}
</Text> </Text>
<Text size="sm">{log.description}</Text> <Text size="sm">{log.description}</Text>
</Timeline.Item> </Timeline.Item>
@@ -706,16 +616,30 @@ function AppErrorsPage() {
)} )}
<Group justify="flex-end" pt="sm"> <Group justify="flex-end" pt="sm">
<Button variant="light" size="compact-xs" color="blue" onClick={() => { <Button
setSelectedBugId(bug.id) variant="light"
setFeedbackForm({ feedBack: bug.feedBack || '' }) size="compact-sm"
openFeedbackModal() color="blue"
}}>Developer Feedback</Button> onClick={() => {
<Button variant="light" size="compact-xs" color="teal" onClick={() => { setSelectedBugId(bug.id)
setSelectedBugId(bug.id) setFeedbackForm({ feedBack: bug.feedBack || '' })
setUpdateForm({ status: bug.status, description: '' }) openFeedbackModal()
openUpdateModal() }}
}}>Update Status</Button> >
Developer Feedback
</Button>
<Button
variant="light"
size="compact-sm"
color="teal"
onClick={() => {
setSelectedBugId(bug.id)
setUpdateForm({ status: bug.status, description: '' })
openUpdateModal()
}}
>
Update Status
</Button>
</Group> </Group>
</Stack> </Stack>
</Accordion.Panel> </Accordion.Panel>
@@ -726,7 +650,7 @@ function AppErrorsPage() {
{totalPages > 1 && ( {totalPages > 1 && (
<Group justify="center" mt="xl"> <Group justify="center" mt="xl">
<Pagination total={totalPages} value={page} onChange={setPage} radius="xl" /> <Pagination total={totalPages} value={page} onChange={setPage} size="sm" radius="xl" />
</Group> </Group>
)} )}
</Paper> </Paper>

View File

@@ -1,9 +1,9 @@
import { useQuery } from '@tanstack/react-query'
import { VillageActivityLineChart, VillageComparisonBarChart } from '@/frontend/components/DashboardCharts' import { VillageActivityLineChart, VillageComparisonBarChart } from '@/frontend/components/DashboardCharts'
import { ErrorDataTable } from '@/frontend/components/ErrorDataTable' import { ErrorDataTable, type ErrorDataTableHandle } from '@/frontend/components/ErrorDataTable'
import { SummaryCard } from '@/frontend/components/SummaryCard' import { SummaryCard } from '@/frontend/components/SummaryCard'
import { useSession } from '@/frontend/hooks/useAuth' import { useSession } from '@/frontend/hooks/useAuth'
import { import {
ActionIcon,
Badge, Badge,
Button, Button,
Group, Group,
@@ -14,17 +14,19 @@ import {
Text, Text,
Textarea, Textarea,
TextInput, TextInput,
Title Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications' import { notifications } from '@mantine/notifications'
import { createFileRoute, useNavigate, useParams } from '@tanstack/react-router' import { createFileRoute, useNavigate, useParams } from '@tanstack/react-router'
import { useEffect, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { import {
TbActivity, TbActivity,
TbAlertTriangle, TbAlertTriangle,
TbBuildingCommunity, TbBuildingCommunity,
TbVersions TbRefresh,
TbVersions,
} from 'react-icons/tb' } from 'react-icons/tb'
import useSWR from 'swr' import useSWR from 'swr'
import { API_URLS } from '../config/api' import { API_URLS } from '../config/api'
@@ -42,42 +44,46 @@ function AppOverviewPage() {
const [versionModalOpened, { open: openVersionModal, close: closeVersionModal }] = useDisclosure(false) const [versionModalOpened, { open: openVersionModal, close: closeVersionModal }] = useDisclosure(false)
const { data: session } = useSession() const { data: session } = useSession()
const isDeveloper = session?.user?.role === 'DEVELOPER' const isDeveloper = session?.user?.role === 'DEVELOPER'
const errorTableRef = useRef<ErrorDataTableHandle>(null)
// Form State
const [latestVersion, setLatestVersion] = useState('') const [latestVersion, setLatestVersion] = useState('')
const [minVersion, setMinVersion] = useState('') const [minVersion, setMinVersion] = useState('')
const [messageUpdate, setMessageUpdate] = useState('') const [messageUpdate, setMessageUpdate] = useState('')
const [maintenance, setMaintenance] = useState(false) const [maintenance, setMaintenance] = useState(false)
const [isSaving, setIsSaving] = useState(false) const [isSaving, setIsSaving] = useState(false)
// Data Fetching const [dailyRange, setDailyRange] = useState<7 | 30 | 90>(7)
const { data: gridRes, isLoading: gridLoading, mutate: mutateGrid } = useSWR(isDesaPlus ? API_URLS.getGridOverview() : null, fetcher) const [comparisonRange, setComparisonRange] = useState<7 | 30 | 90>(7)
const { data: dailyRes, isLoading: dailyLoading, mutate: mutateDaily } = useSWR(isDesaPlus ? API_URLS.getDailyActivity() : null, fetcher)
const { data: comparisonRes, isLoading: comparisonLoading, mutate: mutateComparison } = useSWR(isDesaPlus ? API_URLS.getComparisonActivity() : null, fetcher)
const { data: appData, isLoading: appLoading } = useQuery({ const { data: gridRes, isLoading: gridLoading, mutate: mutateGrid } = useSWR(isDesaPlus ? API_URLS.getGridOverview() : null, fetcher)
queryKey: ['apps', appId], const { data: dailyRes, isLoading: dailyLoading, mutate: mutateDaily } = useSWR(isDesaPlus ? API_URLS.getDailyActivity(dailyRange) : null, fetcher)
queryFn: () => fetch(`/api/apps/${appId}`).then((r) => r.json()), const { data: comparisonRes, isLoading: comparisonLoading, mutate: mutateComparison } = useSWR(isDesaPlus ? API_URLS.getComparisonActivity(comparisonRange) : null, fetcher)
})
const { data: appData, isLoading: appLoading } = useSWR(`/api/apps/${appId}`, fetcher)
const grid = gridRes?.data const grid = gridRes?.data
const dailyData = dailyRes?.data || [] const dailyData = dailyRes?.data || []
const comparisonData = comparisonRes?.data || [] const comparisonData = comparisonRes?.data || []
// Initialize form when data loads or modal opens // Ref so the modal-sync effect always reads current grid without re-running on every background refetch
const gridRef = useRef(grid)
gridRef.current = grid
useEffect(() => { useEffect(() => {
if (grid?.version && versionModalOpened) { if (versionModalOpened && gridRef.current?.version) {
setLatestVersion(grid.version.mobile_latest_version || '') const v = gridRef.current.version
setMinVersion(grid.version.mobile_minimum_version || '') setLatestVersion(v.mobile_latest_version || '')
setMessageUpdate(grid.version.mobile_message_update || '') setMinVersion(v.mobile_minimum_version || '')
setMaintenance(grid.version.mobile_maintenance === 'true') setMessageUpdate(v.mobile_message_update || '')
setMaintenance(v.mobile_maintenance === 'true')
} }
}, [grid, versionModalOpened]) }, [versionModalOpened])
const handleRefresh = () => { const handleRefresh = () => {
mutateGrid() mutateGrid()
mutateDaily() mutateDaily()
mutateComparison() mutateComparison()
errorTableRef.current?.refresh()
} }
const handleSaveVersion = async () => { const handleSaveVersion = async () => {
@@ -98,37 +104,33 @@ function AppOverviewPage() {
await fetch(API_URLS.createLog(), { await fetch(API_URLS.createLog(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'UPDATE', message: `Update version information: ${JSON.stringify({ latestVersion, minVersion, maintenance, messageUpdate })}` }) body: JSON.stringify({ type: 'UPDATE', message: `Updated version info: latest=${latestVersion}, min=${minVersion}, maintenance=${maintenance}` }),
}).catch(console.error) }).catch(console.error)
notifications.show({ notifications.show({ title: 'Updated', message: 'Application version information has been saved.', color: 'teal' })
title: 'Update Successful',
message: 'Application version information has been updated.',
color: 'teal',
})
mutateGrid() mutateGrid()
closeVersionModal() closeVersionModal()
} else { } else {
notifications.show({ notifications.show({ title: 'Failed', message: 'Could not update version info. Please try again.', color: 'red' })
title: 'Update Failed',
message: 'Failed to update version information. Please check your data.',
color: 'red',
})
} }
} catch (error) { } catch {
notifications.show({ notifications.show({ title: 'Network Error', message: 'Could not connect to the server.', color: 'red' })
title: 'Network Error',
message: 'Could not connect to the server. Please try again later.',
color: 'red',
})
} finally { } finally {
setIsSaving(false) setIsSaving(false)
} }
} }
const maintenanceOn = grid?.version?.mobile_maintenance === 'true'
return ( return (
<> <>
<Modal opened={versionModalOpened} onClose={closeVersionModal} title="Update Version Information" radius="md"> <Modal
opened={versionModalOpened}
onClose={closeVersionModal}
title={<Text fw={700} size="lg">Update Version Info</Text>}
radius="xl"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
>
<Stack gap="md"> <Stack gap="md">
<TextInput <TextInput
label="Active Version" label="Active Version"
@@ -156,22 +158,39 @@ function AppOverviewPage() {
checked={maintenance} checked={maintenance}
onChange={(e) => setMaintenance(e.currentTarget.checked)} onChange={(e) => setMaintenance(e.currentTarget.checked)}
/> />
<Button fullWidth onClick={handleSaveVersion} loading={isSaving}>Save Changes</Button> <Button
fullWidth
mt="md"
variant="gradient"
gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }}
onClick={handleSaveVersion}
loading={isSaving}
>
Save Changes
</Button>
</Stack> </Stack>
</Modal> </Modal>
<Stack gap="xl"> <Stack gap="xl">
<Group justify="space-between"> <Group justify="space-between" align="flex-start">
<Stack gap={0}> <Stack gap={4}>
<Title order={3}>Overview</Title> <Title order={3}>Overview</Title>
<Text size="sm" c="dimmed">Detailed metrics for {isDesaPlus ? 'Desa+' : appId}</Text> <Text size="sm" c="dimmed">
Real-time metrics and activity for {isDesaPlus ? 'Desa+' : appId}.
</Text>
</Stack> </Stack>
<Tooltip label="Refresh data" withArrow>
{/* <Group gap="md"> <ActionIcon
<ActionIcon variant="light" color="brand-blue" size="lg" radius="md" onClick={handleRefresh}> variant="light"
<TbRefresh size={20} /> color="brand-blue"
size="lg"
radius="md"
onClick={handleRefresh}
loading={gridLoading || dailyLoading || comparisonLoading}
>
<TbRefresh size={18} />
</ActionIcon> </ActionIcon>
</Group> */} </Tooltip>
</Group> </Group>
<SimpleGrid cols={{ base: 1, sm: 2, lg: 4 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 2, lg: 4 }} spacing="lg">
@@ -185,12 +204,12 @@ function AppOverviewPage() {
<Group justify="space-between" mt="md"> <Group justify="space-between" mt="md">
<Stack gap={0}> <Stack gap={0}>
<Text size="xs" c="dimmed">Min. Version</Text> <Text size="xs" c="dimmed">Min. Version</Text>
<Text size="sm" fw={600}>{grid?.version?.mobile_minimum_version || '-'}</Text> <Text size="sm" fw={600}>{grid?.version?.mobile_minimum_version || ''}</Text>
</Stack> </Stack>
<Stack gap={0} align="flex-end"> <Stack gap={0} align="flex-end">
<Text size="xs" c="dimmed">Maintenance</Text> <Text size="xs" c="dimmed">Maintenance</Text>
<Badge size="sm" color={grid?.version?.mobile_maintenance === 'true' ? 'red' : 'gray'} variant="light"> <Badge size="sm" color={maintenanceOn ? 'orange' : 'teal'} variant="light">
{grid?.version?.mobile_maintenance?.toUpperCase() || 'FALSE'} {maintenanceOn ? 'On' : 'Off'}
</Badge> </Badge>
</Stack> </Stack>
</Group> </Group>
@@ -198,41 +217,50 @@ function AppOverviewPage() {
<SummaryCard <SummaryCard
title="Total Activity Today" title="Total Activity Today"
value={gridLoading ? '...' : (grid?.activity?.today?.toLocaleString() || '0')} value={gridLoading ? '...' : (grid?.activity?.today?.toLocaleString() ?? '0')}
icon={TbActivity} icon={TbActivity}
color="teal" color="teal"
trend={grid?.activity?.increase ? { value: `${grid.activity.increase}%`, positive: grid.activity.increase > 0 } : undefined} trend={grid?.activity?.increase != null && Number(grid.activity.increase) !== 0
? { value: `${grid.activity.increase}%`, positive: Number(grid.activity.increase) > 0 }
: undefined}
/> />
<SummaryCard <SummaryCard
title="Total Villages Active" title="Active Villages"
value={gridLoading ? '...' : (grid?.village?.active || '0')} value={gridLoading ? '...' : (grid?.village?.active ?? '0')}
icon={TbBuildingCommunity} icon={TbBuildingCommunity}
color="indigo" color="indigo"
onClick={() => navigate({ to: `/apps/${appId}/villages` })} onClick={() => navigate({ to: `/apps/${appId}/villages` })}
> >
<Group justify="space-between" mt="md"> <Group justify="space-between" mt="md">
<Text size="xs" c="dimmed">Nonactive Villages</Text> <Text size="xs" c="dimmed">Inactive</Text>
<Badge size="sm" color="red" variant="light">{grid?.village?.inactive || 0}</Badge> <Badge size="sm" color="red" variant="light">{grid?.village?.inactive ?? 0}</Badge>
</Group> </Group>
</SummaryCard> </SummaryCard>
<SummaryCard <SummaryCard
title="Errors Open" title="Open Errors"
value={appLoading ? '...' : (appData?.errors || '0')} value={appLoading ? '...' : (appData?.errors ?? 0)}
icon={TbAlertTriangle} icon={TbAlertTriangle}
color="red" color="red"
isError={true} isError
onClick={() => navigate({ to: `/apps/${appId}/errors` })} onClick={() => navigate({ to: `/apps/${appId}/errors` })}
/> />
</SimpleGrid> </SimpleGrid>
<Group justify="space-between" align="flex-end">
<Stack gap={2}>
<Title order={4}>Analytics</Title>
<Text size="sm" c="dimmed">Activity trends and village comparisons.</Text>
</Stack>
</Group>
<SimpleGrid cols={{ base: 1, lg: 2 }} spacing="lg"> <SimpleGrid cols={{ base: 1, lg: 2 }} spacing="lg">
<VillageActivityLineChart data={dailyData} isLoading={dailyLoading} /> <VillageActivityLineChart data={dailyData} isLoading={dailyLoading} range={dailyRange} onRangeChange={setDailyRange} />
<VillageComparisonBarChart data={comparisonData} isLoading={comparisonLoading} /> <VillageComparisonBarChart data={comparisonData} isLoading={comparisonLoading} range={comparisonRange} onRangeChange={setComparisonRange} />
</SimpleGrid> </SimpleGrid>
<ErrorDataTable appId={appId} /> <ErrorDataTable ref={errorTableRef} appId={appId} />
</Stack> </Stack>
</> </>
) )

View File

@@ -1,34 +1,33 @@
import { useState } from 'react' import { useEffect, useState } from 'react'
import useSWR from 'swr' import useSWR from 'swr'
import { import {
Badge,
Group,
Stack,
Text,
Title,
Paper,
Table,
TextInput,
ActionIcon, ActionIcon,
Avatar, Avatar,
Badge,
Code, Code,
Button, Group,
Box, Loader,
Pagination, Pagination,
ThemeIcon, Paper,
ScrollArea, ScrollArea,
Container, Select,
Stack,
Table,
Text,
TextInput,
Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useMediaQuery } from '@mantine/hooks' import { useDebouncedValue, useMediaQuery } from '@mantine/hooks'
import { DatePickerInput } from '@mantine/dates'
import { createFileRoute, useParams } from '@tanstack/react-router' import { createFileRoute, useParams } from '@tanstack/react-router'
import { import {
TbSearch, TbAlertCircle,
TbDownload,
TbX,
TbHistory,
TbCalendar, TbCalendar,
TbUser, TbHistory,
TbHome2 TbHome2,
TbSearch,
TbX,
} from 'react-icons/tb' } from 'react-icons/tb'
import { API_URLS } from '../config/api' import { API_URLS } from '../config/api'
@@ -47,26 +46,83 @@ interface LogEntry {
const fetcher = (url: string) => fetch(url).then((res) => res.json()) const fetcher = (url: string) => fetch(url).then((res) => res.json())
const ACTION_COLOR: Record<string, string> = {
LOGIN: 'teal',
LOGOUT: 'gray',
CREATE: 'blue',
UPDATE: 'yellow',
DELETE: 'red',
}
const ACTION_OPTIONS = [
{ value: 'LOGIN', label: 'Login' },
{ value: 'LOGOUT', label: 'Logout' },
{ value: 'CREATE', label: 'Create' },
{ value: 'UPDATE', label: 'Update' },
{ value: 'DELETE', label: 'Delete' },
]
function getActionColor(action: string) {
return ACTION_COLOR[action.toUpperCase()] ?? 'brand-blue'
}
function LogTimestamp({ value }: { value: string }) {
if (value.endsWith('lalu')) {
return <Text size="xs" fw={600}>{value}</Text>
}
const [time, ...dateParts] = value.split(' ')
return (
<Stack gap={0}>
<Text size="xs" fw={600}>{dateParts.join(' ')}</Text>
<Text size="xs" c="dimmed">{time}</Text>
</Stack>
)
}
function AppLogsPage() { function AppLogsPage() {
const { appId } = useParams({ from: '/apps/$appId/logs' }) const { appId } = useParams({ from: '/apps/$appId/logs' })
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [search, setSearch] = useState('') const [search, setSearch] = useState('')
const [searchQuery, setSearchQuery] = useState('') const [searchQuery, setSearchQuery] = useState('')
const [debouncedSearch] = useDebouncedValue(search, 400)
const [filterAction, setFilterAction] = useState<string | null>(null)
const [filterVillageSearch, setFilterVillageSearch] = useState('')
const [filterVillageId, setFilterVillageId] = useState<string | null>(null)
const [dateRange, setDateRange] = useState<[string | null, string | null]>([null, null])
const isDesaPlus = appId === 'desa-plus' const isDesaPlus = appId === 'desa-plus'
const isMobile = useMediaQuery('(max-width: 768px)') const isMobile = useMediaQuery('(max-width: 768px)')
const apiUrl = isDesaPlus ? API_URLS.getLogsAllVillages(page, searchQuery) : null const [dateFrom, dateTo] = dateRange
const apiUrl = isDesaPlus
? API_URLS.getLogsAllVillages(
page,
searchQuery,
filterAction ?? undefined,
filterVillageId ?? undefined,
dateFrom ?? undefined,
dateTo ?? undefined,
)
: null
const { data: response, error, isLoading } = useSWR(apiUrl, fetcher) const { data: response, error, isLoading } = useSWR(apiUrl, fetcher)
const logs: LogEntry[] = response?.data?.log || [] const logs: LogEntry[] = response?.data?.log || []
const handleSearchChange = (val: string) => { const { data: filterVillagesResp } = useSWR(
setSearch(val) isDesaPlus && filterVillageSearch.length >= 1 ? API_URLS.getVillages(1, filterVillageSearch) : null,
if (val.length >= 3 || val.length === 0) { fetcher
setSearchQuery(val) )
const filterVillagesOptions = (filterVillagesResp?.data || []).map((v: any) => ({ value: v.id, label: v.name }))
useEffect(() => {
if (debouncedSearch.length >= 3 || debouncedSearch.length === 0) {
setSearchQuery(debouncedSearch)
setPage(1) setPage(1)
} }
} }, [debouncedSearch])
useEffect(() => {
setPage(1)
}, [filterAction, filterVillageId, dateFrom, dateTo])
const handleClearSearch = () => { const handleClearSearch = () => {
setSearch('') setSearch('')
@@ -74,158 +130,169 @@ function AppLogsPage() {
setPage(1) setPage(1)
} }
const getActionColor = (action: string) => {
const a = action.toUpperCase()
if (a === 'LOGIN') return 'blue'
if (a === 'LOGOUT') return 'gray'
if (a === 'CREATE') return 'teal'
if (a === 'UPDATE') return 'orange'
if (a === 'DELETE') return 'red'
return 'brand-blue'
}
if (!isDesaPlus) { if (!isDesaPlus) {
return ( return (
<Container size="xl" py="xl"> <Paper withBorder radius="2xl" className="glass" p="xl">
<Paper p="xl" radius="xl" className="glass" style={{ textAlign: 'center' }}> <Stack align="center" gap="xs" py="xl">
<TbHistory size={48} color="gray" opacity={0.5} /> <TbHistory size={36} style={{ opacity: 0.25 }} />
<Title order={3} mt="md">Activity Logs</Title> <Text fw={600} size="sm">Activity Logs Coming Soon</Text>
<Text c="dimmed">This feature is currently customized for Desa+. Other apps coming soon.</Text> <Text size="sm" c="dimmed">This feature is currently available for Desa+. Other apps coming soon.</Text>
</Paper> </Stack>
</Container> </Paper>
) )
} }
return ( return (
<Stack gap="xl" py="md"> <Stack gap="xl" py="md">
<Paper withBorder radius="2xl" p="xl" className="glass" style={{ borderLeft: '6px solid #7C3AED' }}> <Group justify="space-between" align="flex-start">
<Stack gap="lg"> <Stack gap={4}>
<Group justify="space-between" align="center"> <Title order={3}>Activity Logs</Title>
<Stack gap={4}> <Text size="sm" c="dimmed">
<Group gap="xs"> {isLoading
<ThemeIcon variant="light" color="violet" size="lg" radius="md"> ? 'Loading logs...'
<TbHistory size={22} /> : `${(response?.data?.total ?? 0).toLocaleString()} events across all villages`}
</ThemeIcon> </Text>
<Title order={3}>Activity Logs</Title> </Stack>
</Group> </Group>
<Text size="sm" c="dimmed" ml={40}>
{isLoading ? 'Loading logs...' : `Auditing ${response?.data?.total || 0} events across all villages`}
</Text>
</Stack>
{/* <Button
variant="light"
color="gray"
leftSection={<TbDownload size={18} />}
radius="md"
size="md"
>
Export
</Button> */}
</Group>
<Paper withBorder p="md" className="glass">
<Stack gap="sm">
<TextInput <TextInput
placeholder="Search action or village..." placeholder="Search by user name or village..."
leftSection={<TbSearch size={18} />} leftSection={<TbSearch size={16} />}
size="md" size="sm"
rightSection={ rightSection={
search ? ( search ? (
<ActionIcon variant="transparent" color="gray" onClick={handleClearSearch} size="md"> <Tooltip label="Clear search" withArrow>
<TbX size={18} /> <ActionIcon variant="transparent" color="gray" onClick={handleClearSearch} size="sm">
</ActionIcon> <TbX size={16} />
</ActionIcon>
</Tooltip>
) : null ) : null
} }
value={search} value={search}
onChange={(e) => handleSearchChange(e.currentTarget.value)} onChange={(e) => setSearch(e.currentTarget.value)}
radius="md" radius="md"
style={{ maxWidth: 500 }}
ml={40}
/> />
<Group gap="sm" wrap="nowrap">
<Select
size="sm"
placeholder="All actions"
data={ACTION_OPTIONS}
value={filterAction}
onChange={setFilterAction}
radius="md"
clearable
style={{ flex: 1 }}
/>
<Select
size="sm"
placeholder="Search village..."
searchable
onSearchChange={setFilterVillageSearch}
data={filterVillagesOptions}
value={filterVillageId}
onChange={setFilterVillageId}
radius="md"
clearable
style={{ flex: 1 }}
/>
<DatePickerInput
type="range"
size="sm"
placeholder="Date range"
leftSection={<TbCalendar size={16} />}
value={dateRange}
onChange={setDateRange}
radius="md"
clearable
style={{ flex: 1 }}
maxDate={new Date()}
/>
</Group>
</Stack> </Stack>
</Paper> </Paper>
{isLoading ? ( {isLoading ? (
<Paper p="xl" radius="xl" withBorder style={{ textAlign: 'center' }}> <Group justify="center" py="xl">
<Text c="dimmed">Fetching activity logs...</Text> <Loader type="dots" />
</Paper> </Group>
) : error ? ( ) : error ? (
<Paper p="xl" radius="xl" withBorder style={{ textAlign: 'center' }}> <Paper withBorder radius="2xl" className="glass" p="md">
<Text c="red">Failed to load logs from API.</Text> <Stack align="center" gap="xs" py="xl">
<TbAlertCircle size={32} style={{ opacity: 0.4, color: 'var(--mantine-color-red-6)' }} />
<Text size="sm" c="dimmed">Failed to load logs from the API.</Text>
</Stack>
</Paper> </Paper>
) : logs.length === 0 ? ( ) : logs.length === 0 ? (
<Paper p="xl" radius="xl" withBorder style={{ textAlign: 'center' }}> <Paper withBorder radius="2xl" className="glass" p="md">
<TbHistory size={40} color="gray" opacity={0.4} /> <Stack align="center" gap="xs" py="xl">
<Text c="dimmed" mt="md">No activity found for this search.</Text> <TbHistory size={32} style={{ opacity: 0.25 }} />
<Text size="sm" c="dimmed">
{searchQuery || filterAction || filterVillageId || dateFrom ? 'No activity found for this filter.' : 'No activity logs yet.'}
</Text>
</Stack>
</Paper> </Paper>
) : ( ) : (
<Paper withBorder radius="2xl" className="glass" style={{ overflow: 'hidden' }}> <Paper withBorder radius="2xl" className="glass" style={{ overflow: 'hidden' }}>
<ScrollArea h={isMobile ? undefined : 'auto'} offsetScrollbars> <ScrollArea h={isMobile ? undefined : 'auto'} offsetScrollbars>
<Table <Table
verticalSpacing="lg" className="data-table"
horizontalSpacing="xl" verticalSpacing="sm"
highlightOnHover horizontalSpacing="lg"
highlightOnHover
withColumnBorders={false} withColumnBorders={false}
style={{ style={{
tableLayout: isMobile ? 'auto' : 'fixed', tableLayout: isMobile ? 'auto' : 'fixed',
width: '100%', width: '100%',
minWidth: isMobile ? 900 : 'unset' minWidth: isMobile ? 900 : 'unset',
}} }}
> >
<Table.Thead bg="rgba(0,0,0,0.05)"> <Table.Thead>
<Table.Tr> <Table.Tr>
<Table.Th style={{ border: 'none', width: isMobile ? undefined : '15%' }}>Timestamp</Table.Th> <Table.Th style={{ width: isMobile ? undefined : '18%' }}>Timestamp</Table.Th>
<Table.Th style={{ border: 'none', width: isMobile ? undefined : '20%' }}>User & Village</Table.Th> <Table.Th style={{ width: isMobile ? undefined : '22%' }}>User & Village</Table.Th>
<Table.Th style={{ border: 'none', width: isMobile ? undefined : '15%' }}>Action</Table.Th> <Table.Th style={{ width: isMobile ? undefined : '14%' }}>Action</Table.Th>
<Table.Th style={{ border: 'none', width: isMobile ? undefined : '40%' }}>Description</Table.Th> <Table.Th>Description</Table.Th>
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
{logs.map((log) => ( {logs.map((log) => (
<Table.Tr key={log.id} style={{ borderBottom: '1px solid rgba(255,255,255,0.05)' }}> <Table.Tr key={log.id}>
<Table.Td> <Table.Td>
<Group gap={8} wrap="nowrap" align="flex-start"> <LogTimestamp value={log.createdAt} />
<ThemeIcon variant="transparent" color="gray" size="sm">
<TbCalendar size={14} />
</ThemeIcon>
<Stack gap={0}>
<Text size="xs" fw={700}>
{log.createdAt.split(' ').slice(1).join(' ')}
</Text>
<Text size="xs" c="dimmed">
{log.createdAt.split(' ')[0]}
</Text>
</Stack>
</Group>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Stack gap={4} style={{ overflow: 'hidden' }}> <Stack gap={4} style={{ overflow: 'hidden' }}>
<Group gap={8} wrap="nowrap"> <Group gap={6} wrap="nowrap">
<Avatar size="xs" radius="xl" color="brand-blue" variant="light"> <Avatar size="xs" radius="xl" color="brand-blue" variant="light">
{log.username.charAt(0)} {log.username.charAt(0)}
</Avatar> </Avatar>
<Text size="xs" fw={700} truncate="end">{log.username}</Text> <Text size="xs" fw={600} truncate="end">{log.username}</Text>
</Group> </Group>
<Group gap={8} wrap="nowrap"> <Group gap={6} wrap="nowrap">
<TbHome2 size={12} color="gray" /> <TbHome2 size={12} color="gray" />
<Text size="xs" c="dimmed" truncate="end">{log.village}</Text> <Text size="xs" c="dimmed" truncate="end">{log.village}</Text>
</Group> </Group>
</Stack> </Stack>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Badge <Badge
variant="dot" variant="light"
color={getActionColor(log.action)} color={getActionColor(log.action)}
radius="sm" size="sm"
size="xs" tt="capitalize"
styles={{
root: { fontWeight: 800 },
label: { textOverflow: 'clip', overflow: 'visible' }
}}
> >
{log.action} {log.action}
</Badge> </Badge>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Code color="brand-blue" bg="rgba(37, 99, 235, 0.05)" fw={600} style={{ fontSize: '11px', display: 'block', whiteSpace: 'normal' }}> <Code
color="brand-blue"
bg="rgba(37, 99, 235, 0.05)"
fw={600}
style={{ fontSize: 11, display: 'block', whiteSpace: 'normal' }}
>
{log.desc} {log.desc}
</Code> </Code>
</Table.Td> </Table.Td>
@@ -237,12 +304,13 @@ function AppLogsPage() {
</Paper> </Paper>
)} )}
{!isLoading && !error && response?.data?.totalPage > 0 && ( {!isLoading && !error && response?.data?.totalPage > 1 && (
<Group justify="center" mt="xl"> <Group justify="center">
<Pagination <Pagination
value={page} value={page}
onChange={setPage} onChange={setPage}
total={response.data.totalPage} total={response.data.totalPage}
size="sm"
radius="md" radius="md"
withEdges={false} withEdges={false}
siblings={1} siblings={1}

View File

@@ -1,38 +1,101 @@
import { DashboardLayout } from '@/frontend/components/DashboardLayout' import { DashboardLayout } from '@/frontend/components/DashboardLayout'
import { APP_CONFIGS } from '@/frontend/config/appMenus'
import { import {
Badge,
Box, Box,
Container, Container,
Divider, Divider,
Group, Group,
Skeleton,
Stack, Stack,
Text, Text,
Title Title,
} from '@mantine/core' } from '@mantine/core'
import { createFileRoute, Outlet, useNavigate, useParams } from '@tanstack/react-router' import { useQuery } from '@tanstack/react-query'
import { createFileRoute, Outlet, useParams } from '@tanstack/react-router'
import { TbAlertTriangle, TbTools } from 'react-icons/tb'
export const Route = createFileRoute('/apps/$appId')({ export const Route = createFileRoute('/apps/$appId')({
component: AppDetailLayout, component: AppDetailLayout,
}) })
const STATUS_COLOR: Record<string, string> = {
active: 'teal',
warning: 'orange',
error: 'red',
}
const STATUS_LABEL: Record<string, string> = {
active: 'Active',
warning: 'Warning',
error: 'Error',
}
function AppDetailLayout() { function AppDetailLayout() {
const { appId } = useParams({ from: '/apps/$appId' }) const { appId } = useParams({ from: '/apps/$appId' })
const navigate = useNavigate()
// Format app ID for display (e.g., desa-plus -> Desa+) const { data: appData, isLoading } = useQuery({
const appName = appId queryKey: ['apps', appId],
.split('-') queryFn: () => fetch(`/api/apps/${appId}`).then((r) => r.json()),
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) staleTime: 30_000,
.join(' ') })
.replace('Plus', '+')
const configName = APP_CONFIGS[appId]?.name
const displayName = appData?.name ?? configName ?? appId
const statusKey = appData?.maintenance ? 'maintenance' : (appData?.status ?? 'active')
const statusColor = appData?.maintenance ? 'gray' : (STATUS_COLOR[appData?.status] ?? 'gray')
const statusLabel = appData?.maintenance ? 'Maintenance' : (STATUS_LABEL[appData?.status] ?? appData?.status)
return ( return (
<DashboardLayout> <DashboardLayout>
<Container size="xl" py="lg"> <Container size="xl" py="lg">
<Stack gap="md"> <Stack gap="md">
<Group justify="space-between" align="flex-end"> <Group justify="space-between" align="flex-start">
<Stack gap={4}> <Stack gap={6}>
<Title order={1} className="gradient-text" style={{ fontSize: '2.5rem' }}>{appName}</Title> <Group gap="sm" align="center">
<Text c="dimmed" size="sm" fw={500}>Application ID: <span style={{ fontFamily: 'monospace' }}>{appId}</span></Text> {isLoading ? (
<Skeleton height={36} width={180} radius="md" />
) : (
<Title order={2} className="gradient-text">{displayName}</Title>
)}
{!isLoading && appData && (
<Badge color={statusColor} variant="dot" size="md">
{statusLabel}
</Badge>
)}
</Group>
<Group gap="xs" align="center">
<Text size="xs" c="dimmed" fw={500} style={{ fontFamily: 'monospace' }}>
{appId}
</Text>
{isLoading ? (
<Skeleton height={20} width={60} radius="xl" />
) : (
<>
{(appData?.errors ?? 0) > 0 && (
<Badge
variant="light"
color="red"
size="sm"
leftSection={<TbAlertTriangle size={10} />}
>
{appData.errors} open {appData.errors === 1 ? 'error' : 'errors'}
</Badge>
)}
{appData?.maintenance && (
<Badge
variant="light"
color="orange"
size="sm"
leftSection={<TbTools size={10} />}
>
Maintenance mode
</Badge>
)}
</>
)}
</Group>
</Stack> </Stack>
</Group> </Group>

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,22 @@
import { AreaChart } from '@mantine/charts' import { AreaChart } from '@mantine/charts'
import { import {
Badge,
Box, Box,
Button, Button,
Card, Card,
Group, Group,
Loader,
Modal, Modal,
Paper, Paper,
SegmentedControl, SegmentedControl,
SimpleGrid, SimpleGrid,
Stack, Stack,
Switch,
Text, Text,
Textarea, Textarea,
TextInput, TextInput,
ThemeIcon, ThemeIcon,
Title Title,
} from '@mantine/core' } from '@mantine/core'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications' import { notifications } from '@mantine/notifications'
@@ -30,6 +33,7 @@ import {
TbLayoutKanban, TbLayoutKanban,
TbMapPin, TbMapPin,
TbPower, TbPower,
TbTestPipe,
TbUser, TbUser,
TbUsers, TbUsers,
TbUsersGroup, TbUsersGroup,
@@ -110,7 +114,7 @@ function ActivityChart({ villageId }: { villageId: string }) {
{isLoading ? ( {isLoading ? (
<Stack h={280} align="center" justify="center"> <Stack h={280} align="center" justify="center">
<Text size="sm" c="dimmed">Loading chart data...</Text> <Loader type="dots" />
</Stack> </Stack>
) : ( ) : (
<AreaChart <AreaChart
@@ -119,16 +123,44 @@ function ActivityChart({ villageId }: { villageId: string }) {
dataKey="label" dataKey="label"
series={[{ name: 'activity', color: '#2563EB' }]} series={[{ name: 'activity', color: '#2563EB' }]}
curveType="monotone" curveType="monotone"
withTooltip={true} withTooltip
withDots={true} withDots
withPointLabels={false} withPointLabels={false}
tickLine="none"
gridAxis="x"
fillOpacity={0.4}
tooltipAnimationDuration={150} tooltipAnimationDuration={150}
tooltipProps={{ tooltipProps={{
allowEscapeViewBox: { x: true, y: false }, content: ({ active, payload, label }: any) => {
if (!active || !payload?.length) return null
return (
<div style={{
backgroundColor: '#1A1B1E',
padding: '8px 12px',
borderRadius: '6px',
border: '1px solid #373A40',
boxShadow: '0 4px 12px rgba(0,0,0,0.5)',
pointerEvents: 'none',
whiteSpace: 'nowrap',
}}>
<div style={{ fontSize: '12px', fontWeight: 600, color: '#C1C2C5', marginBottom: '4px' }}>
{label}
</div>
<div style={{ fontSize: '11px', color: '#2563EB' }}>
Activity: <span style={{ fontWeight: 700 }}>{payload[0].value}</span>
</div>
</div>
)
},
}} }}
activeDotProps={{ activeDotProps={{ r: 6, strokeWidth: 2 }}
r: 6, styles={{
strokeWidth: 2, root: {
'.recharts-area-curve': {
strokeWidth: 3,
filter: 'drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3))',
},
},
}} }}
/> />
)} )}
@@ -152,7 +184,7 @@ function VillageDetailPage() {
const [editModalOpened, { open: openEditModal, close: closeEditModal }] = useDisclosure(false) const [editModalOpened, { open: openEditModal, close: closeEditModal }] = useDisclosure(false)
const [isUpdating, setIsUpdating] = useState(false) const [isUpdating, setIsUpdating] = useState(false)
const [isEditing, setIsEditing] = useState(false) const [isEditing, setIsEditing] = useState(false)
const [editForm, setEditForm] = useState({ name: '', desc: '' }) const [editForm, setEditForm] = useState({ name: '', desc: '', isDummy: false })
const village = infoRes?.data const village = infoRes?.data
const stats = gridRes?.data const stats = gridRes?.data
@@ -160,7 +192,8 @@ function VillageDetailPage() {
const openEdit = () => { const openEdit = () => {
setEditForm({ setEditForm({
name: village?.name || '', name: village?.name || '',
desc: village?.desc || '' desc: village?.desc || '',
isDummy: village?.isDummy ?? false,
}) })
openEditModal() openEditModal()
} }
@@ -187,7 +220,8 @@ function VillageDetailPage() {
body: JSON.stringify({ body: JSON.stringify({
id: village.id, id: village.id,
name: editForm.name, name: editForm.name,
desc: editForm.desc desc: editForm.desc,
isDummy: editForm.isDummy,
}) })
}) })
@@ -195,7 +229,7 @@ function VillageDetailPage() {
await fetch(API_URLS.createLog(), { await fetch(API_URLS.createLog(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'UPDATE', message: `Data desa (${appId}) diperbarui: ${editForm.name}-${village.id}` }) body: JSON.stringify({ type: 'UPDATE', message: `Village data updated (${appId}): ${editForm.name} - ${village.id}` })
}).catch(console.error) }).catch(console.error)
notifications.show({ notifications.show({
@@ -212,7 +246,7 @@ function VillageDetailPage() {
color: 'red' color: 'red'
}) })
} }
} catch (error) { } catch {
notifications.show({ notifications.show({
title: 'Error', title: 'Error',
message: 'A network error occurred.', message: 'A network error occurred.',
@@ -243,7 +277,7 @@ function VillageDetailPage() {
await fetch(API_URLS.createLog(), { await fetch(API_URLS.createLog(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'UPDATE', message: `Status desa (${appId}) diperbarui (${!village.isActive ? 'activated' : 'deactivated'}): ${village.name}-${village.id}` }) body: JSON.stringify({ type: 'UPDATE', message: `Village status updated (${appId}): ${village.name} ${!village.isActive ? 'activated' : 'deactivated'} - ${village.id}` })
}).catch(console.error) }).catch(console.error)
notifications.show({ notifications.show({
@@ -260,7 +294,7 @@ function VillageDetailPage() {
color: 'red' color: 'red'
}) })
} }
} catch (error) { } catch {
notifications.show({ notifications.show({
title: 'Error', title: 'Error',
message: 'A network error occurred.', message: 'A network error occurred.',
@@ -275,9 +309,9 @@ function VillageDetailPage() {
if (infoLoading || gridLoading) { if (infoLoading || gridLoading) {
return ( return (
<Stack align="center" py="xl" gap="md"> <Group justify="center" py="xl">
<Text c="dimmed">Loading village data...</Text> <Loader type="dots" />
</Stack> </Group>
) )
} }
@@ -321,7 +355,7 @@ function VillageDetailPage() {
loading={isUpdating} loading={isUpdating}
disabled={!isDeveloper} disabled={!isDeveloper}
> >
{village.isActive ? 'Deactivate' : 'Active'} {village.isActive ? 'Deactivate' : 'Activate'}
</Button> </Button>
<Button <Button
variant="light" variant="light"
@@ -360,7 +394,20 @@ function VillageDetailPage() {
</ThemeIcon> </ThemeIcon>
<Stack gap={6}> <Stack gap={6}>
<Title order={2} style={{ color: 'white', lineHeight: 1.1 }}>{village.name}</Title> <Group gap="xs" align="center">
<Title order={2} style={{ color: 'white', lineHeight: 1.1 }}>{village.name}</Title>
{village.isDummy && (
<Badge
size="sm"
variant="light"
color="yellow"
leftSection={<TbTestPipe size={11} />}
style={{ textTransform: 'none' }}
>
Dummy
</Badge>
)}
</Group>
<Group gap={6}> <Group gap={6}>
<TbMapPin size={14} color="rgba(255,255,255,0.8)" /> <TbMapPin size={14} color="rgba(255,255,255,0.8)" />
@@ -476,9 +523,10 @@ function VillageDetailPage() {
<Modal <Modal
opened={confirmModalOpened} opened={confirmModalOpened}
onClose={closeConfirmModal} onClose={closeConfirmModal}
title={<Text fw={700}>Confirm Status Change</Text>} radius="md"
radius="xl" title={<Text fw={700} size="lg">Confirm Status Change</Text>}
centered centered
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
<Text size="sm"> <Text size="sm">
@@ -505,7 +553,7 @@ function VillageDetailPage() {
opened={editModalOpened} opened={editModalOpened}
onClose={closeEditModal} onClose={closeEditModal}
title={<Text fw={700}>Edit Village Details</Text>} title={<Text fw={700}>Edit Village Details</Text>}
radius="xl" radius="md"
size="md" size="md"
> >
<Stack gap="md"> <Stack gap="md">
@@ -524,6 +572,12 @@ function VillageDetailPage() {
value={editForm.desc} value={editForm.desc}
onChange={(e) => setEditForm(prev => ({ ...prev, desc: e.currentTarget.value }))} onChange={(e) => setEditForm(prev => ({ ...prev, desc: e.currentTarget.value }))}
/> />
<Switch
label="Dummy Village"
description="Tandai desa ini sebagai data dummy"
checked={editForm.isDummy}
onChange={(e) => setEditForm(prev => ({ ...prev, isDummy: e.currentTarget.checked }))}
/>
<Group justify="flex-end" gap="sm" mt="md"> <Group justify="flex-end" gap="sm" mt="md">
<Button variant="light" color="gray" onClick={closeEditModal} radius="md"> <Button variant="light" color="gray" onClick={closeEditModal} radius="md">
Cancel Cancel

View File

@@ -36,6 +36,7 @@ import {
TbMapPin, TbMapPin,
TbPlus, TbPlus,
TbSearch, TbSearch,
TbTestPipe,
TbUser, TbUser,
TbX, TbX,
} from 'react-icons/tb' } from 'react-icons/tb'
@@ -50,6 +51,7 @@ interface APIVillage {
id: string id: string
name: string name: string
isActive: boolean isActive: boolean
isDummy: boolean
createdAt: string createdAt: string
perbekel: string | null perbekel: string | null
} }
@@ -95,9 +97,16 @@ function VillageGridCard({ village, onClick }: { village: APIVillage; onClick: (
> >
<TbHome2 size={22} /> <TbHome2 size={22} />
</ThemeIcon> </ThemeIcon>
<Badge color={cfg.color} variant="light" radius="sm" size="sm"> <Group gap={6}>
{cfg.label} {village.isDummy && (
</Badge> <Badge color="yellow" variant="light" radius="sm" size="sm" leftSection={<TbTestPipe size={11} />}>
Dummy
</Badge>
)}
<Badge color={cfg.color} variant="light" radius="sm" size="sm">
{cfg.label}
</Badge>
</Group>
</Group> </Group>
<Text fw={800} size="lg" mb={2}> <Text fw={800} size="lg" mb={2}>
@@ -175,6 +184,11 @@ function VillageListRow({ village, onClick }: { village: APIVillage; onClick: ()
<Stack gap={2}> <Stack gap={2}>
<Group gap="sm"> <Group gap="sm">
<Text fw={700} size="sm">{village.name}</Text> <Text fw={700} size="sm">{village.name}</Text>
{village.isDummy && (
<Badge color="yellow" variant="light" radius="sm" size="xs" leftSection={<TbTestPipe size={10} />}>
Dummy
</Badge>
)}
<Badge color={cfg.color} variant="light" radius="sm" size="xs"> <Badge color={cfg.color} variant="light" radius="sm" size="xs">
{cfg.label} {cfg.label}
</Badge> </Badge>
@@ -408,7 +422,7 @@ function AppVillagesIndexPage() {
<Select <Select
label="Gender" label="Gender"
placeholder="Select gender" placeholder="Select gender"
data={['Male', 'Female']} data={[{ label: 'Male', value: 'M' }, { label: 'Female', value: 'F' }]}
mt="sm" mt="sm"
required required
value={form.gender} value={form.gender}

View File

@@ -9,6 +9,7 @@ import {
Code, Code,
Collapse, Collapse,
Container, Container,
FileInput,
Group, Group,
Image, Image,
Loader, Loader,
@@ -19,36 +20,54 @@ import {
SimpleGrid, SimpleGrid,
Stack, Stack,
Text, Text,
ThemeIcon,
FileInput,
TextInput, TextInput,
Textarea, Textarea,
Title, ThemeIcon,
Timeline, Timeline,
Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useQuery } from '@tanstack/react-query'
import { createFileRoute } from '@tanstack/react-router'
import { useState } from 'react'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications' import { notifications } from '@mantine/notifications'
import { useQuery } from '@tanstack/react-query'
import { createFileRoute } from '@tanstack/react-router'
import dayjs from 'dayjs'
import { useState } from 'react'
import { import {
TbAlertTriangle, TbAlertTriangle,
TbBug, TbBug,
TbCircleCheck,
TbCircleX,
TbDeviceDesktop, TbDeviceDesktop,
TbDeviceMobile, TbDeviceMobile,
TbFilter, TbFilter,
TbSearch,
TbHistory, TbHistory,
TbPhoto, TbPhoto,
TbPlus, TbPlus,
TbCircleCheck, TbSearch,
TbCircleX,
} from 'react-icons/tb' } from 'react-icons/tb'
export const Route = createFileRoute('/bug-reports')({ export const Route = createFileRoute('/bug-reports')({
component: ListErrorsPage, component: ListErrorsPage,
}) })
const STATUS_COLOR: Record<string, string> = {
OPEN: 'red',
IN_PROGRESS: 'blue',
ON_HOLD: 'orange',
RESOLVED: 'teal',
RELEASED: 'green',
CLOSED: 'gray',
}
const STATUS_LABEL: Record<string, string> = {
OPEN: 'Open',
ON_HOLD: 'On Hold',
IN_PROGRESS: 'In Progress',
RESOLVED: 'Resolved',
RELEASED: 'Released',
CLOSED: 'Closed',
}
function ListErrorsPage() { function ListErrorsPage() {
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [search, setSearch] = useState('') const [search, setSearch] = useState('')
@@ -58,29 +77,21 @@ function ListErrorsPage() {
const [showLogs, setShowLogs] = useState<Record<string, boolean>>({}) const [showLogs, setShowLogs] = useState<Record<string, boolean>>({})
const [showStackTrace, setShowStackTrace] = useState<Record<string, boolean>>({}) const [showStackTrace, setShowStackTrace] = useState<Record<string, boolean>>({})
const toggleLogs = (bugId: string) => { const toggleLogs = (bugId: string) => setShowLogs((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
setShowLogs((prev) => ({ ...prev, [bugId]: !prev[bugId] })) const toggleStackTrace = (bugId: string) => setShowStackTrace((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
}
const toggleStackTrace = (bugId: string) => {
setShowStackTrace((prev) => ({ ...prev, [bugId]: !prev[bugId] }))
}
const { data, isLoading, refetch } = useQuery({ const { data, isLoading, refetch } = useQuery({
queryKey: ['bugs', { page, search, app, status }], queryKey: ['bugs', { page, search, app, status }],
queryFn: () => queryFn: () => fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
}) })
// Fetch apps for the dropdown
const { data: appsList } = useQuery({ const { data: appsList } = useQuery({
queryKey: ['apps-list'], queryKey: ['apps-list'],
queryFn: () => fetch('/api/apps').then((r) => r.json()), queryFn: () => fetch('/api/apps').then((r) => r.json()),
}) })
// Image Preview
const [previewImage, setPreviewImage] = useState<string | null>(null) const [previewImage, setPreviewImage] = useState<string | null>(null)
// Create Bug Modal Logic
const [opened, { open, close }] = useDisclosure(false) const [opened, { open, close }] = useDisclosure(false)
const [isSubmitting, setIsSubmitting] = useState(false) const [isSubmitting, setIsSubmitting] = useState(false)
const [imageFiles, setImageFiles] = useState<File[]>([]) const [imageFiles, setImageFiles] = useState<File[]>([])
@@ -94,25 +105,17 @@ function ListErrorsPage() {
stackTrace: '', stackTrace: '',
}) })
// Update Status Modal Logic
const [updateModalOpened, { open: openUpdateModal, close: closeUpdateModal }] = useDisclosure(false) const [updateModalOpened, { open: openUpdateModal, close: closeUpdateModal }] = useDisclosure(false)
const [isUpdating, setIsUpdating] = useState(false) const [isUpdating, setIsUpdating] = useState(false)
const [selectedBugId, setSelectedBugId] = useState<string | null>(null) const [selectedBugId, setSelectedBugId] = useState<string | null>(null)
const [updateForm, setUpdateForm] = useState({ const [updateForm, setUpdateForm] = useState({ status: '', description: '' })
status: '',
description: '',
})
// Feedback Modal Logic
const [feedbackModalOpened, { open: openFeedbackModal, close: closeFeedbackModal }] = useDisclosure(false) const [feedbackModalOpened, { open: openFeedbackModal, close: closeFeedbackModal }] = useDisclosure(false)
const [isUpdatingFeedback, setIsUpdatingFeedback] = useState(false) const [isUpdatingFeedback, setIsUpdatingFeedback] = useState(false)
const [feedbackForm, setFeedbackForm] = useState({ const [feedbackForm, setFeedbackForm] = useState({ feedBack: '' })
feedBack: '',
})
const handleUpdateFeedback = async () => { const handleUpdateFeedback = async () => {
if (!selectedBugId || !feedbackForm.feedBack) return if (!selectedBugId || !feedbackForm.feedBack) return
setIsUpdatingFeedback(true) setIsUpdatingFeedback(true)
try { try {
const res = await fetch(API_URLS.updateBugFeedback(selectedBugId), { const res = await fetch(API_URLS.updateBugFeedback(selectedBugId), {
@@ -120,27 +123,16 @@ function ListErrorsPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(feedbackForm), body: JSON.stringify(feedbackForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ notifications.show({ title: 'Success', message: 'Feedback has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> })
title: 'Success',
message: 'Feedback has been updated.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
closeFeedbackModal() closeFeedbackModal()
setFeedbackForm({ feedBack: '' }) setFeedbackForm({ feedBack: '' })
} else { } else {
throw new Error('Failed to update feedback') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsUpdatingFeedback(false) setIsUpdatingFeedback(false)
} }
@@ -148,7 +140,6 @@ function ListErrorsPage() {
const handleUpdateStatus = async () => { const handleUpdateStatus = async () => {
if (!selectedBugId || !updateForm.status) return if (!selectedBugId || !updateForm.status) return
setIsUpdating(true) setIsUpdating(true)
try { try {
const res = await fetch(API_URLS.updateBugStatus(selectedBugId), { const res = await fetch(API_URLS.updateBugStatus(selectedBugId), {
@@ -156,27 +147,16 @@ function ListErrorsPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updateForm), body: JSON.stringify(updateForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ notifications.show({ title: 'Success', message: 'Status has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> })
title: 'Success',
message: 'Status has been updated.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
closeUpdateModal() closeUpdateModal()
setUpdateForm({ status: '', description: '' }) setUpdateForm({ status: '', description: '' })
} else { } else {
throw new Error('Failed to update status') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsUpdating(false) setIsUpdating(false)
} }
@@ -184,14 +164,9 @@ function ListErrorsPage() {
const handleCreateBug = async () => { const handleCreateBug = async () => {
if (!createForm.description || !createForm.affectedVersion || !createForm.device || !createForm.os) { if (!createForm.description || !createForm.affectedVersion || !createForm.device || !createForm.os) {
notifications.show({ notifications.show({ title: 'Validation Error', message: 'Please fill in all required fields.', color: 'red' })
title: 'Validation Error',
message: 'Please fill in all required fields.',
color: 'red',
})
return return
} }
setIsSubmitting(true) setIsSubmitting(true)
try { try {
const imageUrls: string[] = [] const imageUrls: string[] = []
@@ -199,52 +174,31 @@ function ListErrorsPage() {
const formData = new FormData() const formData = new FormData()
formData.append('file', file) formData.append('file', file)
const uploadRes = await fetch(API_URLS.uploadImage(), { method: 'POST', body: formData }) const uploadRes = await fetch(API_URLS.uploadImage(), { method: 'POST', body: formData })
if (!uploadRes.ok) throw new Error('Gagal mengupload gambar') if (!uploadRes.ok) throw new Error('Failed to upload image')
const { url } = await uploadRes.json() const { url } = await uploadRes.json()
imageUrls.push(url) imageUrls.push(url)
} }
const res = await fetch(API_URLS.createBug(), { const res = await fetch(API_URLS.createBug(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...createForm, imageUrls: imageUrls.length ? imageUrls : undefined }), body: JSON.stringify({ ...createForm, imageUrls: imageUrls.length ? imageUrls : undefined }),
}) })
if (res.ok) { if (res.ok) {
await fetch(API_URLS.createLog(), { await fetch(API_URLS.createLog(), {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ type: 'CREATE', message: `Report error baru ditambahkan: ${createForm.description.substring(0, 50)}${createForm.description.length > 50 ? '...' : ''}` }) body: JSON.stringify({ type: 'CREATE', message: `New error report added: ${createForm.description.substring(0, 50)}${createForm.description.length > 50 ? '...' : ''}` }),
}).catch(console.error) }).catch(console.error)
notifications.show({ title: 'Success', message: 'Error report has been created.', color: 'teal', icon: <TbCircleCheck size={18} /> })
notifications.show({
title: 'Success',
message: 'Error report has been created.',
color: 'teal',
icon: <TbCircleCheck size={18} />,
})
refetch() refetch()
close() close()
setImageFiles([]) setImageFiles([])
setCreateForm({ setCreateForm({ description: '', app: 'desa-plus', source: 'USER', affectedVersion: '', device: '', os: '', stackTrace: '' })
description: '',
app: 'desa-plus',
source: 'USER',
affectedVersion: '',
device: '',
os: '',
stackTrace: '',
})
} else { } else {
throw new Error('Failed to create error report') throw new Error()
} }
} catch (e) { } catch {
notifications.show({ notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
title: 'Error',
message: 'Something went wrong.',
color: 'red',
icon: <TbCircleX size={18} />,
})
} finally { } finally {
setIsSubmitting(false) setIsSubmitting(false)
} }
@@ -257,28 +211,22 @@ function ListErrorsPage() {
<DashboardLayout> <DashboardLayout>
<Container size="xl" py="lg"> <Container size="xl" py="lg">
<Stack gap="xl"> <Stack gap="xl">
<Group justify="space-between" align="center"> <Group justify="space-between" align="flex-start">
<Stack gap={0}> <Stack gap={4}>
<Title order={2} className="gradient-text"> <Title order={2} className="gradient-text">Error Reports</Title>
Error Reports
</Title>
<Text size="sm" c="dimmed"> <Text size="sm" c="dimmed">
Centralized error tracking and analysis for all applications. Centralized error tracking and analysis for all applications.
</Text> </Text>
</Stack> </Stack>
<Group> <Button
<Button variant="gradient"
variant="gradient" gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }}
gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }} leftSection={<TbPlus size={18} />}
leftSection={<TbPlus size={18} />} size="sm"
onClick={open} onClick={open}
> >
Report Error Report Error
</Button> </Button>
{/* <Button variant="light" color="red" leftSection={<TbBug size={16} />}>
Generate Report
</Button> */}
</Group>
</Group> </Group>
{/* Image Preview Modal */} {/* Image Preview Modal */}
@@ -286,7 +234,7 @@ function ListErrorsPage() {
opened={!!previewImage} opened={!!previewImage}
onClose={() => setPreviewImage(null)} onClose={() => setPreviewImage(null)}
size="xl" size="xl"
radius="xl" radius="md"
padding={0} padding={0}
withCloseButton={false} withCloseButton={false}
overlayProps={{ backgroundOpacity: 0.75, blur: 6 }} overlayProps={{ backgroundOpacity: 0.75, blur: 6 }}
@@ -294,12 +242,7 @@ function ListErrorsPage() {
onClick={() => setPreviewImage(null)} onClick={() => setPreviewImage(null)}
> >
{previewImage && ( {previewImage && (
<Image <Image src={previewImage} alt="Preview" fit="contain" style={{ maxHeight: '85vh', width: '100%' }} />
src={previewImage}
alt="Preview"
fit="contain"
style={{ maxHeight: '85vh', width: '100%' }}
/>
)} )}
</Modal> </Modal>
@@ -307,28 +250,21 @@ function ListErrorsPage() {
opened={updateModalOpened} opened={updateModalOpened}
onClose={closeUpdateModal} onClose={closeUpdateModal}
title={<Text fw={700} size="lg">Update Bug Status</Text>} title={<Text fw={700} size="lg">Update Bug Status</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
<Select <Select
label="New Status" label="New Status"
placeholder="Select status" placeholder="Select a status"
required required
data={[ data={Object.entries(STATUS_LABEL).map(([value, label]) => ({ value, label }))}
{ value: 'OPEN', label: 'Open' },
{ value: 'ON_HOLD', label: 'On Hold' },
{ value: 'IN_PROGRESS', label: 'In Progress' },
{ value: 'RESOLVED', label: 'Resolved' },
{ value: 'RELEASED', label: 'Released' },
{ value: 'CLOSED', label: 'Closed' },
]}
value={updateForm.status} value={updateForm.status}
onChange={(val) => setUpdateForm({ ...updateForm, status: val || '' })} onChange={(val) => setUpdateForm({ ...updateForm, status: val || '' })}
/> />
<Textarea <Textarea
label="Update Note (Optional)" label="Update Note (Optional)"
placeholder="E.g. Fixed in commit xxxxx / Assigned to team" placeholder="e.g. Fixed in commit abc123 / Assigned to team"
minRows={3} minRows={3}
value={updateForm.description} value={updateForm.description}
onChange={(e) => setUpdateForm({ ...updateForm, description: e.target.value })} onChange={(e) => setUpdateForm({ ...updateForm, description: e.target.value })}
@@ -350,7 +286,7 @@ function ListErrorsPage() {
opened={feedbackModalOpened} opened={feedbackModalOpened}
onClose={closeFeedbackModal} onClose={closeFeedbackModal}
title={<Text fw={700} size="lg">Developer Feedback</Text>} title={<Text fw={700} size="lg">Developer Feedback</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
@@ -361,7 +297,7 @@ function ListErrorsPage() {
required required
minRows={4} minRows={4}
value={feedbackForm.feedBack} value={feedbackForm.feedBack}
onChange={(e) => setFeedbackForm({ ...feedbackForm, feedBack: e.target.value })} onChange={(e) => setFeedbackForm({ feedBack: e.target.value })}
/> />
<Button <Button
fullWidth fullWidth
@@ -378,9 +314,9 @@ function ListErrorsPage() {
<Modal <Modal
opened={opened} opened={opened}
onClose={() => { close(); setImageFiles([]); }} onClose={() => { close(); setImageFiles([]) }}
title={<Text fw={700} size="lg">Report New Error</Text>} title={<Text fw={700} size="lg">Report New Error</Text>}
radius="xl" radius="md"
size="lg" size="lg"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
@@ -393,7 +329,6 @@ function ListErrorsPage() {
value={createForm.description} value={createForm.description}
onChange={(e) => setCreateForm({ ...createForm, description: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, description: e.target.value })}
/> />
<SimpleGrid cols={2}> <SimpleGrid cols={2}>
<Select <Select
label="Application" label="Application"
@@ -414,19 +349,17 @@ function ListErrorsPage() {
onChange={(val) => setCreateForm({ ...createForm, source: val as any })} onChange={(val) => setCreateForm({ ...createForm, source: val as any })}
/> />
</SimpleGrid> </SimpleGrid>
<TextInput <TextInput
label="Version" label="Affected Version"
placeholder="e.g. 2.4.1" placeholder="e.g. 2.4.1"
required required
value={createForm.affectedVersion} value={createForm.affectedVersion}
onChange={(e) => setCreateForm({ ...createForm, affectedVersion: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, affectedVersion: e.target.value })}
/> />
<SimpleGrid cols={2}> <SimpleGrid cols={2}>
<TextInput <TextInput
label="Device" label="Device"
placeholder="e.g. iPhone 13, Windows 11 PC" placeholder="e.g. iPhone 13, Windows PC"
required required
value={createForm.device} value={createForm.device}
onChange={(e) => setCreateForm({ ...createForm, device: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, device: e.target.value })}
@@ -439,17 +372,16 @@ function ListErrorsPage() {
onChange={(e) => setCreateForm({ ...createForm, os: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, os: e.target.value })}
/> />
</SimpleGrid> </SimpleGrid>
<FileInput <FileInput
label="Screenshot (Optional)" label="Screenshots (Optional)"
placeholder="Klik untuk upload gambar..." placeholder="Click to upload images..."
accept="image/*" accept="image/*"
leftSection={<TbPhoto size={16} />} leftSection={<TbPhoto size={16} />}
description="Maks 3 gambar · 5MB per file · JPG, PNG, WEBP" description="Max 3 images · 5 MB each · JPG, PNG, WEBP"
value={imageFiles} value={imageFiles}
onChange={(files) => { onChange={(files) => {
if (files.length > 3) { if (files.length > 3) {
notifications.show({ title: 'Error', message: 'Maksimal 3 gambar', color: 'red' }) notifications.show({ title: 'Error', message: 'Maximum 3 images allowed.', color: 'red' })
return return
} }
setImageFiles(files) setImageFiles(files)
@@ -457,16 +389,14 @@ function ListErrorsPage() {
clearable clearable
multiple multiple
/> />
<Textarea <Textarea
label="Stack Trace (Optional)" label="Stack Trace (Optional)"
placeholder="Paste code or error logs here..." placeholder="Paste error logs or stack trace here..."
style={{ fontFamily: 'monospace' }} style={{ fontFamily: 'monospace' }}
minRows={2} minRows={2}
value={createForm.stackTrace} value={createForm.stackTrace}
onChange={(e) => setCreateForm({ ...createForm, stackTrace: e.target.value })} onChange={(e) => setCreateForm({ ...createForm, stackTrace: e.target.value })}
/> />
<Button <Button
fullWidth fullWidth
mt="md" mt="md"
@@ -481,16 +411,19 @@ function ListErrorsPage() {
</Modal> </Modal>
<Paper withBorder radius="2xl" className="glass" p="md"> <Paper withBorder radius="2xl" className="glass" p="md">
<SimpleGrid cols={{ base: 1, sm: 4 }} mb="md"> <SimpleGrid cols={{ base: 1, sm: 4 }} mb="lg">
<TextInput <TextInput
placeholder="Search description, device, os..." label="Search"
placeholder="Description, device, OS..."
leftSection={<TbSearch size={16} />} leftSection={<TbSearch size={16} />}
value={search} value={search}
onChange={(e) => setSearch(e.currentTarget.value)} onChange={(e) => setSearch(e.currentTarget.value)}
radius="md" radius="md"
size="sm"
/> />
<Select <Select
placeholder="Application" label="Application"
size="sm"
data={[ data={[
{ value: 'all', label: 'All Applications' }, { value: 'all', label: 'All Applications' },
...(appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []), ...(appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []),
@@ -501,38 +434,38 @@ function ListErrorsPage() {
disabled={!appsList} disabled={!appsList}
/> />
<Select <Select
placeholder="Status" label="Status"
size="sm"
data={[ data={[
{ value: 'all', label: 'All Status' }, { value: 'all', label: 'All Status' },
{ value: 'OPEN', label: 'Open' }, ...Object.entries(STATUS_LABEL).map(([value, label]) => ({ value, label })),
{ value: 'ON_HOLD', label: 'On Hold' },
{ value: 'IN_PROGRESS', label: 'In Progress' },
{ value: 'RESOLVED', label: 'Resolved' },
{ value: 'RELEASED', label: 'Released' },
{ value: 'CLOSED', label: 'Closed' },
]} ]}
value={status} value={status}
onChange={(val) => setStatus(val || 'all')} onChange={(val) => setStatus(val || 'all')}
radius="md" radius="md"
/> />
<Group justify="flex-end"> <Stack justify="flex-end">
<Button variant="subtle" color="gray" leftSection={<TbFilter size={16} />} onClick={() => {setSearch(''); setApp('all'); setStatus('all')}}> <Button
Reset variant="filled"
color="violet"
size="sm"
onClick={() => { setSearch(''); setApp('all'); setStatus('all') }}
>
Reset Filters
</Button> </Button>
</Group> </Stack>
</SimpleGrid> </SimpleGrid>
{isLoading ? ( {isLoading ? (
<Stack align="center" py="xl"> <Stack align="center" py="xl">
<Loader size="lg" type="dots" /> <Loader size="md" type="dots" />
<Text size="sm" c="dimmed">Loading error reports...</Text>
</Stack> </Stack>
) : bugs.length === 0 ? ( ) : bugs.length === 0 ? (
<Paper p="xl" withBorder style={{ borderStyle: 'dashed', textAlign: 'center' }}> <Stack align="center" py="xl" gap="xs">
<TbBug size={48} color="gray" style={{ marginBottom: 12, opacity: 0.5 }} /> <TbBug size={40} style={{ opacity: 0.25 }} />
<Text fw={600}>No error reports found</Text> <Text fw={600} size="sm">No error reports found</Text>
<Text size="sm" c="dimmed">Try adjusting your filters or search terms.</Text> <Text size="sm" c="dimmed">Try adjusting your filters or search terms.</Text>
</Paper> </Stack>
) : ( ) : (
<Accordion variant="separated" radius="xl"> <Accordion variant="separated" radius="xl">
{bugs.map((bug: any) => ( {bugs.map((bug: any) => (
@@ -542,19 +475,13 @@ function ListErrorsPage() {
style={{ style={{
border: '1px solid var(--mantine-color-default-border)', border: '1px solid var(--mantine-color-default-border)',
background: 'var(--mantine-color-default)', background: 'var(--mantine-color-default)',
marginBottom: '12px', marginBottom: 12,
}} }}
> >
<Accordion.Control> <Accordion.Control>
<Group wrap="nowrap"> <Group wrap="nowrap">
<ThemeIcon <ThemeIcon
color={ color={STATUS_COLOR[bug.status] ?? 'gray'}
bug.status === 'OPEN'
? 'red'
: bug.status === 'IN_PROGRESS'
? 'blue'
: 'teal'
}
variant="light" variant="light"
size="lg" size="lg"
radius="md" radius="md"
@@ -563,37 +490,27 @@ function ListErrorsPage() {
</ThemeIcon> </ThemeIcon>
<Box style={{ flex: 1 }}> <Box style={{ flex: 1 }}>
<Group justify="space-between"> <Group justify="space-between">
<Text size="sm" fw={600} lineClamp={1}> <Text size="sm" fw={600} lineClamp={1}>{bug.description}</Text>
{bug.description}
</Text>
<Badge <Badge
color={ color={STATUS_COLOR[bug.status] ?? 'gray'}
bug.status === 'OPEN'
? 'red'
: bug.status === 'IN_PROGRESS'
? 'blue'
: 'teal'
}
variant="dot" variant="dot"
size="xs" size="sm"
> >
{bug.status} {STATUS_LABEL[bug.status] ?? bug.status}
</Badge> </Badge>
</Group> </Group>
<Group gap="md"> <Text size="xs" c="dimmed">
<Text size="xs" c="dimmed"> {dayjs(bug.createdAt).format('D MMM YYYY, HH:mm')} · {bug.appId?.toUpperCase()} · v{bug.affectedVersion}
{new Date(bug.createdAt).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })} {bug.appId?.toUpperCase()} v{bug.affectedVersion} </Text>
</Text>
</Group>
</Box> </Box>
</Group> </Group>
</Accordion.Control> </Accordion.Control>
<Accordion.Panel> <Accordion.Panel>
<Stack gap="lg" py="xs"> <Stack gap="lg" py="xs">
{/* Device Info */}
<SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg">
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>DEVICE METADATA</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Device Metadata</Text>
<Group gap="xs"> <Group gap="xs">
{bug.device.toLowerCase().includes('windows') || bug.device.toLowerCase().includes('mac') || bug.device.toLowerCase().includes('pc') ? ( {bug.device.toLowerCase().includes('windows') || bug.device.toLowerCase().includes('mac') || bug.device.toLowerCase().includes('pc') ? (
<TbDeviceDesktop size={14} color="gray" /> <TbDeviceDesktop size={14} color="gray" />
@@ -604,17 +521,16 @@ function ListErrorsPage() {
</Group> </Group>
</Box> </Box>
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>SOURCE</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Source</Text>
<Badge variant="light" color="gray" size="sm">{bug.source}</Badge> <Badge variant="light" color="gray" size="sm">{bug.source}</Badge>
</Box> </Box>
</SimpleGrid> </SimpleGrid>
{/* Feedback & Reporter Info */}
{(bug.user || bug.feedBack) && ( {(bug.user || bug.feedBack) && (
<SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 2 }} spacing="lg">
{bug.user && ( {bug.user && (
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>REPORTED BY</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Reported By</Text>
<Group gap="xs"> <Group gap="xs">
<Avatar src={bug.user.image} radius="xl" size="sm" color="blue"> <Avatar src={bug.user.image} radius="xl" size="sm" color="blue">
{bug.user.name?.charAt(0).toUpperCase()} {bug.user.name?.charAt(0).toUpperCase()}
@@ -625,24 +541,18 @@ function ListErrorsPage() {
)} )}
{bug.feedBack && ( {bug.feedBack && (
<Box> <Box>
<Text size="xs" fw={700} c="dimmed" mb={4}>DEVELOPER FEEDBACK</Text> <Text size="xs" fw={700} c="dimmed" mb={4} tt="uppercase">Developer Feedback</Text>
<Text size="sm" style={{ whiteSpace: 'pre-wrap' }}>{bug.feedBack}</Text> <Text size="sm" style={{ whiteSpace: 'pre-wrap' }}>{bug.feedBack}</Text>
</Box> </Box>
)} )}
</SimpleGrid> </SimpleGrid>
)} )}
{/* Stack Trace */}
{bug.stackTrace && ( {bug.stackTrace && (
<Box> <Box>
<Group justify="space-between" mb={showStackTrace[bug.id] ? 8 : 0}> <Group justify="space-between" mb={showStackTrace[bug.id] ? 8 : 0}>
<Text size="xs" fw={700} c="dimmed">STACK TRACE</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">Stack Trace</Text>
<Button <Button variant="subtle" size="compact-xs" color="gray" onClick={() => toggleStackTrace(bug.id)}>
variant="subtle"
size="compact-xs"
color="gray"
onClick={() => toggleStackTrace(bug.id)}
>
{showStackTrace[bug.id] ? 'Hide' : 'Show'} {showStackTrace[bug.id] ? 'Hide' : 'Show'}
</Button> </Button>
</Group> </Group>
@@ -650,12 +560,7 @@ function ListErrorsPage() {
<Code <Code
block block
color="red" color="red"
style={{ style={{ fontFamily: 'monospace', whiteSpace: 'pre-wrap', fontSize: 11, border: '1px solid var(--mantine-color-default-border)' }}
fontFamily: 'monospace',
whiteSpace: 'pre-wrap',
fontSize: '11px',
border: '1px solid var(--mantine-color-default-border)',
}}
> >
{bug.stackTrace} {bug.stackTrace}
</Code> </Code>
@@ -663,43 +568,41 @@ function ListErrorsPage() {
</Box> </Box>
)} )}
{/* Images */}
{bug.images && bug.images.length > 0 && ( {bug.images && bug.images.length > 0 && (
<Box> <Box>
<Group gap="xs" mb={8}> <Group gap="xs" mb={8}>
<TbPhoto size={16} color="gray" /> <TbPhoto size={14} color="gray" />
<Text size="xs" fw={700} c="dimmed">ATTACHED IMAGES ({bug.images.length})</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">
Attached Images ({bug.images.length})
</Text>
</Group> </Group>
<SimpleGrid cols={{ base: 2, sm: 4 }} spacing="xs"> <SimpleGrid cols={{ base: 2, sm: 4 }} spacing="xs">
{bug.images.map((img: any) => ( {bug.images.map((img: any) => (
<Paper <Tooltip key={img.id} label="Click to preview" withArrow>
key={img.id} <Paper
withBorder withBorder
radius="md" radius="md"
style={{ overflow: 'hidden', cursor: 'zoom-in' }} style={{ overflow: 'hidden', cursor: 'zoom-in' }}
onClick={() => setPreviewImage(img.imageUrl)} onClick={() => setPreviewImage(img.imageUrl)}
> >
<Image src={img.imageUrl} alt="Error screenshot" height={100} fit="cover" /> <Image src={img.imageUrl} alt="Error screenshot" height={100} fit="cover" />
</Paper> </Paper>
</Tooltip>
))} ))}
</SimpleGrid> </SimpleGrid>
</Box> </Box>
)} )}
{/* Logs / History */}
{bug.logs && bug.logs.length > 0 && ( {bug.logs && bug.logs.length > 0 && (
<Box> <Box>
<Group justify="space-between" mb={showLogs[bug.id] ? 12 : 0}> <Group justify="space-between" mb={showLogs[bug.id] ? 12 : 0}>
<Group gap="xs"> <Group gap="xs">
<TbHistory size={16} color="gray" /> <TbHistory size={14} color="gray" />
<Text size="xs" fw={700} c="dimmed">ACTIVITY LOG ({bug.logs.length})</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">
Activity Log ({bug.logs.length})
</Text>
</Group> </Group>
<Button <Button variant="subtle" size="compact-xs" color="gray" onClick={() => toggleLogs(bug.id)}>
variant="subtle"
size="compact-xs"
color="gray"
onClick={() => toggleLogs(bug.id)}
>
{showLogs[bug.id] ? 'Hide' : 'Show'} {showLogs[bug.id] ? 'Hide' : 'Show'}
</Button> </Button>
</Group> </Group>
@@ -709,12 +612,16 @@ function ListErrorsPage() {
<Timeline.Item <Timeline.Item
key={log.id} key={log.id}
bullet={ bullet={
<Badge size="xs" circle color={log.status === 'RESOLVED' ? 'teal' : 'blue'}> </Badge> <Badge size="xs" circle color={STATUS_COLOR[log.status] ?? 'blue'}> </Badge>
}
title={
<Text size="sm" fw={600}>
{STATUS_LABEL[log.status] ?? log.status}
</Text>
} }
title={<Text size="sm" fw={600}>{log.status}</Text>}
> >
<Text size="xs" c="dimmed" mb={4}> <Text size="xs" c="dimmed" mb={4}>
{new Date(log.createdAt).toLocaleString()} by {log.user?.name || 'Unknown'} {dayjs(log.createdAt).format('D MMM YYYY, HH:mm')} · {log.user?.name ?? 'Unknown'}
</Text> </Text>
<Text size="sm">{log.description}</Text> <Text size="sm">{log.description}</Text>
</Timeline.Item> </Timeline.Item>
@@ -725,16 +632,30 @@ function ListErrorsPage() {
)} )}
<Group justify="flex-end" pt="sm"> <Group justify="flex-end" pt="sm">
<Button variant="light" size="compact-xs" color="blue" onClick={() => { <Button
setSelectedBugId(bug.id) variant="light"
setFeedbackForm({ feedBack: bug.feedBack || '' }) size="compact-sm"
openFeedbackModal() color="blue"
}}>Developer Feedback</Button> onClick={() => {
<Button variant="light" size="compact-xs" color="teal" onClick={() => { setSelectedBugId(bug.id)
setSelectedBugId(bug.id) setFeedbackForm({ feedBack: bug.feedBack || '' })
setUpdateForm({ status: bug.status, description: '' }) openFeedbackModal()
openUpdateModal() }}
}}>Update Status</Button> >
Developer Feedback
</Button>
<Button
variant="light"
size="compact-sm"
color="teal"
onClick={() => {
setSelectedBugId(bug.id)
setUpdateForm({ status: bug.status, description: '' })
openUpdateModal()
}}
>
Update Status
</Button>
</Group> </Group>
</Stack> </Stack>
</Accordion.Panel> </Accordion.Panel>
@@ -745,7 +666,7 @@ function ListErrorsPage() {
{totalPages > 1 && ( {totalPages > 1 && (
<Group justify="center" mt="xl"> <Group justify="center" mt="xl">
<Pagination total={totalPages} value={page} onChange={setPage} radius="xl" /> <Pagination total={totalPages} value={page} onChange={setPage} size="sm" radius="xl" />
</Group> </Group>
)} )}
</Paper> </Paper>

View File

@@ -14,10 +14,11 @@ import {
Table, Table,
Text, Text,
Title, Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useQuery } from '@tanstack/react-query' import { useQuery } from '@tanstack/react-query'
import { createFileRoute, Link, redirect } from '@tanstack/react-router' import { createFileRoute, Link, redirect } from '@tanstack/react-router'
import { TbApps, TbChevronRight, TbMessageReport, TbUsers } from 'react-icons/tb' import { TbAlertCircle, TbApps, TbChevronRight, TbMessageReport, TbUsers } from 'react-icons/tb'
export const Route = createFileRoute('/dashboard')({ export const Route = createFileRoute('/dashboard')({
beforeLoad: async ({ context }) => { beforeLoad: async ({ context }) => {
@@ -35,6 +36,39 @@ export const Route = createFileRoute('/dashboard')({
component: DashboardPage, component: DashboardPage,
}) })
function getGreeting() {
const hour = new Date().getHours()
if (hour < 12) return 'Good morning'
if (hour < 17) return 'Good afternoon'
return 'Good evening'
}
function formatTimeAgo(dateStr: string) {
const diff = new Date().getTime() - new Date(dateStr).getTime()
const minutes = Math.floor(diff / 60000)
if (minutes < 1) return 'Just now'
if (minutes < 60) return `${minutes}m ago`
const hours = Math.floor(minutes / 60)
if (hours < 24) return `${hours}h ago`
const days = Math.floor(hours / 24)
if (days === 1) return 'Yesterday'
if (days < 7) return `${days}d ago`
return new Date(dateStr).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' })
}
const SEVERITY_COLOR: Record<string, string> = {
OPEN: 'red',
IN_PROGRESS: 'blue',
ON_HOLD: 'orange',
RESOLVED: 'teal',
RELEASED: 'green',
CLOSED: 'gray',
}
function formatSeverityLabel(s: string) {
return s.replace(/_/g, ' ')
}
function DashboardPage() { function DashboardPage() {
const { data: sessionData } = useSession() const { data: sessionData } = useSession()
const user = sessionData?.user const user = sessionData?.user
@@ -54,34 +88,42 @@ function DashboardPage() {
queryFn: () => fetch('/api/dashboard/recent-errors').then((r) => r.json()), queryFn: () => fetch('/api/dashboard/recent-errors').then((r) => r.json()),
}) })
const formatTimeAgo = (dateStr: string) => { const today = new Date().toLocaleDateString('en-GB', {
const diff = new Date().getTime() - new Date(dateStr).getTime() weekday: 'long',
const minutes = Math.floor(diff / 60000) day: 'numeric',
if (minutes < 60) return `${minutes || 1} mins ago` month: 'long',
const hours = Math.floor(minutes / 60) year: 'numeric',
if (hours < 24) return `${hours} hours ago` })
return `${Math.floor(hours / 24)} days ago`
} const firstName = user?.name?.split(' ')[0] ?? user?.name
return ( return (
<DashboardLayout> <DashboardLayout>
<Container size="xl" py="lg"> <Container size="xl" py="lg">
<Stack gap="xl"> <Stack gap="xl">
<Group justify="space-between" align="center"> <Group justify="space-between" align="flex-start">
<Stack gap={0}> <Stack gap={4}>
<Title order={2} className="gradient-text">Overview Dashboard</Title> <Text size="xs" c="dimmed" fw={500} tt="uppercase" style={{ letterSpacing: '0.05em' }}>
<Text size="sm" c="dimmed">Welcome back, {user?.name}. Here is what's happening today.</Text> {today}
</Text>
<Title order={2} className="gradient-text">
{getGreeting()}, {firstName}.
</Title>
<Text size="sm" c="dimmed">
Here's a real-time overview of all your monitored applications.
</Text>
</Stack> </Stack>
{/* <Button <Button
variant="gradient" variant="gradient"
gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }} gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }}
leftSection={<TbApps size={18} />} leftSection={<TbApps size={18} />}
radius="md" radius="md"
component={Link} component={Link}
to="/apps" to="/apps"
size="sm"
> >
Manage All Apps Manage Apps
</Button> */} </Button>
</Group> </Group>
{statsLoading ? ( {statsLoading ? (
@@ -89,33 +131,43 @@ function DashboardPage() {
) : ( ) : (
<SimpleGrid cols={{ base: 1, sm: 3 }}> <SimpleGrid cols={{ base: 1, sm: 3 }}>
<StatsCard <StatsCard
title="Total Applications" title="Applications"
value={stats?.totalApps || 0} value={stats?.totalApps ?? 0}
description="Registered platforms"
icon={TbApps} icon={TbApps}
color="brand-blue" color="brand-blue"
// trend={{ value: stats?.trends?.totalApps.toString() || '0', positive: true }}
/> />
<StatsCard <StatsCard
title="New Errors" title="Open Errors"
value={stats?.newErrors || 0} value={stats?.newErrors ?? 0}
description="Unresolved bug reports"
icon={TbMessageReport} icon={TbMessageReport}
color="brand-purple" color="red"
// trend={{ value: stats?.trends?.newErrors.toString() || '0', positive: false }}
/> />
<StatsCard <StatsCard
title="Users" title="Operators"
value={stats?.activeUsers || 0} value={stats?.activeUsers ?? 0}
description="Active platform users"
icon={TbUsers} icon={TbUsers}
color="teal" color="teal"
// trend={{ value: stats?.trends?.activeUsers.toString() || '0', positive: true }}
/> />
</SimpleGrid> </SimpleGrid>
)} )}
<Group justify="space-between" mt="md"> <Group justify="space-between" align="flex-end" mt="md">
<Title order={3}>Registered Applications</Title> <Stack gap={2}>
<Button variant="subtle" color="brand-blue" rightSection={<TbChevronRight size={16} />} component={Link} to="/apps"> <Title order={3}>Registered Applications</Title>
View All Apps <Text size="sm" c="dimmed">All monitored apps on this platform.</Text>
</Stack>
<Button
variant="subtle"
color="brand-blue"
rightSection={<TbChevronRight size={16} />}
component={Link}
to="/apps"
size="sm"
>
View All
</Button> </Button>
</Group> </Group>
@@ -129,22 +181,32 @@ function DashboardPage() {
</SimpleGrid> </SimpleGrid>
)} )}
<Group justify="space-between" mt="md"> <Group justify="space-between" align="flex-end" mt="md">
<Title order={3}>Recent Error Reports</Title> <Stack gap={2}>
<Button variant="subtle" color="brand-blue" rightSection={<TbChevronRight size={16} />} component={Link} to="/bug-reports"> <Title order={3}>Recent Error Reports</Title>
View All Errors <Text size="sm" c="dimmed">Latest bug submissions across all apps.</Text>
</Stack>
<Button
variant="subtle"
color="brand-blue"
rightSection={<TbChevronRight size={16} />}
component={Link}
to="/bug-reports"
size="sm"
>
View All
</Button> </Button>
</Group> </Group>
<Paper withBorder radius="2xl" className="glass" p="md"> <Paper withBorder radius="2xl" className="glass" p="md">
<Table className="data-table" verticalSpacing="md"> <Table className="data-table" verticalSpacing="sm">
<Table.Thead> <Table.Thead>
<Table.Tr> <Table.Tr>
<Table.Th>Application</Table.Th> <Table.Th>App</Table.Th>
<Table.Th>Error Message</Table.Th> <Table.Th>Error Message</Table.Th>
<Table.Th>Version</Table.Th> <Table.Th>Version</Table.Th>
<Table.Th>Time</Table.Th> <Table.Th>Reported</Table.Th>
<Table.Th>Severity</Table.Th> <Table.Th>Status</Table.Th>
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
@@ -156,30 +218,39 @@ function DashboardPage() {
</Table.Tr> </Table.Tr>
) : recentErrors.length === 0 ? ( ) : recentErrors.length === 0 ? (
<Table.Tr> <Table.Tr>
<Table.Td colSpan={5} align="center" py="xl"> <Table.Td colSpan={5}>
<Text c="dimmed" size="sm">No recent errors found.</Text> <Stack align="center" gap="xs" py="xl">
<TbAlertCircle size={32} style={{ opacity: 0.25 }} />
<Text c="dimmed" size="sm">No error reports yet — all systems are running smoothly.</Text>
</Stack>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
) : recentErrors.map((error: any) => ( ) : recentErrors.map((error: any) => (
<Table.Tr key={error.id}> <Table.Tr key={error.id}>
<Table.Td> <Table.Td>
<Text fw={600} size="sm" style={{ textTransform: 'uppercase' }}>{error.app}</Text> <Text fw={600} size="sm" tt="uppercase">{error.app}</Text>
</Table.Td>
<Table.Td style={{ maxWidth: 280 }}>
<Tooltip label={error.message} multiline maw={320} withArrow position="top-start">
<Text size="sm" c="dimmed" lineClamp={1} style={{ cursor: 'default' }}>
{error.message}
</Text>
</Tooltip>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Text size="sm" c="dimmed" lineClamp={1}>{error.message}</Text> <Badge variant="light" color="gray" size="sm">v{error.version}</Badge>
</Table.Td>
<Table.Td>
<Badge variant="light" color="gray">v{error.version}</Badge>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Text size="xs" c="dimmed">{formatTimeAgo(error.time)}</Text> <Text size="xs" c="dimmed">{formatTimeAgo(error.time)}</Text>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Badge <Badge
color={error.severity === 'OPEN' ? 'red' : error.severity === 'IN_PROGRESS' || error.severity === 'ON_HOLD' ? 'orange' : 'yellow'} color={SEVERITY_COLOR[error.severity] ?? 'gray'}
variant="dot" variant="light"
size="sm"
tt="capitalize"
> >
{error.severity.toUpperCase()} {formatSeverityLabel(error.severity)}
</Badge> </Badge>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>

View File

@@ -8,7 +8,9 @@ import {
Button, Button,
Card, Card,
Center, Center,
CopyButton,
Container, Container,
Divider,
Group, Group,
Loader, Loader,
Menu, Menu,
@@ -22,6 +24,7 @@ import {
Stack, Stack,
Table, Table,
Text, Text,
TextInput,
ThemeIcon, ThemeIcon,
Title, Title,
Tooltip, Tooltip,
@@ -52,11 +55,15 @@ import {
TbApps, TbApps,
TbBug, TbBug,
TbChevronRight, TbChevronRight,
TbCopy,
TbCircleFilled, TbCircleFilled,
TbCode, TbCode,
TbDatabase, TbDatabase,
TbDots, TbDots,
TbEye,
TbEyeOff,
TbFileText, TbFileText,
TbKey,
TbLayoutDashboard, TbLayoutDashboard,
TbLayoutSidebarLeftCollapse, TbLayoutSidebarLeftCollapse,
TbLayoutSidebarLeftExpand, TbLayoutSidebarLeftExpand,
@@ -70,10 +77,11 @@ import {
TbUserSearch, TbUserSearch,
TbUsers, TbUsers,
} from 'react-icons/tb' } from 'react-icons/tb'
import { notifications } from '@mantine/notifications'
import { type Role, useLogout, useSession } from '@/frontend/hooks/useAuth' import { type Role, useLogout, useSession } from '@/frontend/hooks/useAuth'
import { usePresence } from '@/frontend/hooks/usePresence' import { usePresence } from '@/frontend/hooks/usePresence'
const validTabs = ['overview', 'operators', 'bugs', 'app-logs', 'activity-logs', 'database', 'project', 'settings'] as const const validTabs = ['overview', 'operators', 'bugs', 'app-logs', 'activity-logs', 'database', 'project', 'settings', 'api-keys'] as const
export const Route = createFileRoute('/dev')({ export const Route = createFileRoute('/dev')({
validateSearch: (search: Record<string, unknown>) => ({ validateSearch: (search: Record<string, unknown>) => ({
@@ -109,11 +117,13 @@ const navItems = [
{ label: 'Overview', icon: TbLayoutDashboard, key: 'overview' }, { label: 'Overview', icon: TbLayoutDashboard, key: 'overview' },
{ label: 'Operators', icon: TbUsers, key: 'operators' }, { label: 'Operators', icon: TbUsers, key: 'operators' },
{ label: 'Bugs', icon: TbBug, key: 'bugs' }, { label: 'Bugs', icon: TbBug, key: 'bugs' },
{ label: 'App Logs', icon: TbServer, key: 'app-logs' }, { label: 'App Logs', icon: TbServer, key: 'app-logs', disabled: true },
{ label: 'Activity Logs', icon: TbActivity, key: 'activity-logs' }, // { label: 'Activity Logs', icon: TbActivity, key: 'activity-logs' },
{ label: 'Database', icon: TbDatabase, key: 'database' }, { label: 'Database', icon: TbDatabase, key: 'database' },
{ label: 'Project', icon: TbSitemap, key: 'project' }, { label: 'Project', icon: TbSitemap, key: 'project' },
{ label: 'Settings', icon: TbSettings, key: 'settings' }, { label: 'App Config', icon: TbSettings, key: 'settings' },
{ divider: true, key: '__divider-external__' },
{ label: 'Desa Mandiri Keys', icon: TbKey, key: 'api-keys' },
] ]
function DevPage() { function DevPage() {
@@ -196,7 +206,8 @@ function DevPage() {
<AppShell.Section grow> <AppShell.Section grow>
<Stack gap={4}> <Stack gap={4}>
{navItems.map((item) => { {navItems.map((item) => {
const Icon = item.icon if (item.divider) return <Divider key={item.key} my={4} />
const Icon = item.icon!
if (collapsed) { if (collapsed) {
return ( return (
<Tooltip key={item.key} label={item.label} position="right"> <Tooltip key={item.key} label={item.label} position="right">
@@ -204,7 +215,8 @@ function DevPage() {
variant={active === item.key ? 'filled' : 'subtle'} variant={active === item.key ? 'filled' : 'subtle'}
color={active === item.key ? 'blue' : 'gray'} color={active === item.key ? 'blue' : 'gray'}
size="lg" size="lg"
onClick={() => setActive(item.key)} disabled={item.disabled}
onClick={() => !item.disabled && setActive(item.key)}
> >
<Icon size={18} /> <Icon size={18} />
</ActionIcon> </ActionIcon>
@@ -218,7 +230,8 @@ function DevPage() {
leftSection={<Icon size={16} />} leftSection={<Icon size={16} />}
rightSection={active === item.key ? <TbChevronRight size={14} /> : undefined} rightSection={active === item.key ? <TbChevronRight size={14} /> : undefined}
active={active === item.key} active={active === item.key}
onClick={() => setActive(item.key)} disabled={item.disabled}
onClick={() => !item.disabled && setActive(item.key)}
style={{ borderRadius: 6 }} style={{ borderRadius: 6 }}
/> />
) )
@@ -268,6 +281,7 @@ function DevPage() {
{active === 'activity-logs' && <ActivityLogsPanel />} {active === 'activity-logs' && <ActivityLogsPanel />}
{active === 'database' && <DatabasePanel />} {active === 'database' && <DatabasePanel />}
{active === 'project' && <ProjectPanel />} {active === 'project' && <ProjectPanel />}
{active === 'api-keys' && <ApiKeysPanel />}
{active === 'settings' && <SettingsPanel />} {active === 'settings' && <SettingsPanel />}
</Container> </Container>
</AppShell.Main> </AppShell.Main>
@@ -1459,22 +1473,596 @@ function StaticFlowPanel({ graph, flowKey }: { graph: { nodes: Node[]; edges: Ed
// ─── Settings Panel ──────────────────────────────────────────────────────────── // ─── Settings Panel ────────────────────────────────────────────────────────────
interface AppEntry {
id: string
name: string
urlApi: string | null
apiKey: string
clientApiKey: string
status: string
active: boolean
hasClientApiKey: boolean
}
function SettingsPanel() { function SettingsPanel() {
const qc = useQueryClient()
const { data, isLoading } = useQuery({
queryKey: ['apps'],
queryFn: () => fetch('/api/apps?all=true', { credentials: 'include' }).then((r) => r.json()),
})
const apps: AppEntry[] = Array.isArray(data) ? data : []
// ── Add App modal ──
const [addOpened, { open: openAdd, close: closeAdd }] = useDisclosure(false)
const [newApp, setNewApp] = useState({ id: '', name: '', urlApi: '', apiKey: '' })
// ── API Config modal ──
const [apiOpened, { open: openApi, close: closeApi }] = useDisclosure(false)
const [apiTarget, setApiTarget] = useState<AppEntry | null>(null)
const [apiForm, setApiForm] = useState({ urlApi: '', apiKey: '' })
// ── Generated key modal ──
const [keyOpened, { open: openKey, close: closeKey }] = useDisclosure(false)
const [generatedKey, setGeneratedKey] = useState('')
const [keyCopied, setKeyCopied] = useState(false)
const [generatedKeyVisible, setGeneratedKeyVisible] = useState(false)
const [addKeyVisible, setAddKeyVisible] = useState(false)
const [apiConfigKeyVisible, setApiConfigKeyVisible] = useState(false)
const [visibleAppKeys, setVisibleAppKeys] = useState<Set<string>>(new Set())
const toggleAppKeyVisibility = (appId: string) => {
setVisibleAppKeys((prev) => {
const next = new Set(prev)
if (next.has(appId)) next.delete(appId)
else next.add(appId)
return next
})
}
const openApiModal = (app: AppEntry) => {
setApiTarget(app)
setApiForm({ urlApi: app.urlApi ?? '', apiKey: '' })
setApiConfigKeyVisible(false)
openApi()
}
const createMutation = useMutation({
mutationFn: (body: typeof newApp) => fetch('/api/apps', {
method: 'POST', credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}).then((r) => r.json()),
onSuccess: (res) => {
if (res.error) { notifications.show({ color: 'red', title: 'Error', message: res.error }); return }
qc.invalidateQueries({ queryKey: ['apps'] })
closeAdd()
setNewApp({ id: '', name: '', urlApi: '', apiKey: '' })
notifications.show({ color: 'green', title: 'Success', message: 'Application added successfully.' })
},
})
const apiMutation = useMutation({
mutationFn: ({ id, body }: { id: string; body: { urlApi: string; apiKey?: string } }) => fetch(`/api/apps/${id}`, {
method: 'PATCH', credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}).then((r) => r.json()),
onSuccess: (res) => {
if (res.error) { notifications.show({ color: 'red', title: 'Error', message: res.error }); return }
qc.invalidateQueries({ queryKey: ['apps'] })
closeApi()
notifications.show({ color: 'green', title: 'Success', message: 'API configuration updated.' })
},
})
const deleteMutation = useMutation({
mutationFn: (id: string) => fetch(`/api/apps/${id}`, { method: 'DELETE', credentials: 'include' }).then((r) => r.json()),
onSuccess: (res) => {
if (res.error) { notifications.show({ color: 'red', title: 'Error', message: res.error }); return }
qc.invalidateQueries({ queryKey: ['apps'] })
notifications.show({ color: 'green', title: 'Success', message: 'Application deactivated.' })
},
})
const activateMutation = useMutation({
mutationFn: (id: string) => fetch(`/api/apps/${id}/activate`, { method: 'POST', credentials: 'include' }).then((r) => r.json()),
onSuccess: (res) => {
if (res.error) { notifications.show({ color: 'red', title: 'Error', message: res.error }); return }
qc.invalidateQueries({ queryKey: ['apps'] })
notifications.show({ color: 'green', title: 'Success', message: 'Application activated.' })
},
})
const generateKeyMutation = useMutation({
mutationFn: (id: string) => fetch(`/api/apps/${id}/generate-key`, { method: 'POST', credentials: 'include' }).then((r) => r.json()),
onSuccess: (res) => {
if (res.error) { notifications.show({ color: 'red', title: 'Error', message: res.error }); return }
qc.invalidateQueries({ queryKey: ['apps'] })
setGeneratedKey(res.clientApiKey)
setKeyCopied(false)
setGeneratedKeyVisible(false)
openKey()
},
})
const confirmGenerateKey = (app: AppEntry) => {
if (app.hasClientApiKey) {
modals.openConfirmModal({
title: 'Regenerate Client API Key',
children: <Text size="sm">This will invalidate the existing key for <strong>{app.name}</strong>. Any mobile apps using the old key will stop working.</Text>,
labels: { confirm: 'Regenerate', cancel: 'Cancel' },
confirmProps: { color: 'orange' },
onConfirm: () => generateKeyMutation.mutate(app.id),
})
} else {
generateKeyMutation.mutate(app.id)
}
}
const confirmDeactivate = (app: AppEntry) => modals.openConfirmModal({
title: 'Deactivate Application',
children: <Text size="sm">Are you sure you want to deactivate <strong>{app.name}</strong>? It will no longer appear in the monitoring list.</Text>,
labels: { confirm: 'Deactivate', cancel: 'Cancel' },
confirmProps: { color: 'red' },
onConfirm: () => deleteMutation.mutate(app.id),
})
return ( return (
<Stack> <Stack>
<Title order={3}>Settings</Title> <Group justify="space-between">
<Paper withBorder p="xl"> <div>
<Center> <Title order={3}>App Config</Title>
<Text c="dimmed">Konfigurasi sistem akan ditampilkan di sini.</Text> <Text size="sm" c="dimmed">Manage the URL API and API Key for each application.</Text>
</Center> </div>
</Paper> <Button leftSection={<TbApps size={16} />} onClick={openAdd}>Add App</Button>
</Group>
{isLoading ? <Center py="xl"><Loader /></Center> : apps.length === 0 ? (
<Center py="xl"><Text c="dimmed">No applications found. Click "Add App" to get started.</Text></Center>
) : (
<Stack gap="sm">
{apps.map((app) => (
<Paper key={app.id} withBorder p="md" radius="md">
<Group justify="space-between" wrap="nowrap">
<Group gap="sm" style={{ flex: 1, minWidth: 0 }}>
<ThemeIcon size="lg" variant="light" color={app.active ? 'green' : 'red'} radius="md">
<TbApps size={18} />
</ThemeIcon>
<Box style={{ minWidth: 0 }}>
<Group gap="xs" align="center">
<Text fw={600} size="sm">{app.name}</Text>
<Text size="xs" c="dimmed" ff="monospace">{app.id}</Text>
{!app.active && <Badge color="red" variant="light" size="xs">Inactive</Badge>}
</Group>
<Group gap="xs" mt={2}>
{app.urlApi
? <Text size="xs" c="dimmed">{app.urlApi}</Text>
: <Badge color="orange" variant="dot" size="xs">URL API not set</Badge>
}
{app.hasClientApiKey
? <Badge color="teal" variant="dot" size="xs">Client key set</Badge>
: <Badge color="red" variant="dot" size="xs">No client key</Badge>
}
</Group>
{app.clientApiKey && (
<>
<Text size="xs" fw={500} c="gray" mt={4}>Client Key (untuk mobile app mengakses monitoring):</Text>
<Group gap={4} wrap="nowrap">
<Text size="xs" ff="monospace" c="dimmed" style={{ userSelect: visibleAppKeys.has(app.id) ? 'text' : 'none' }}>
{visibleAppKeys.has(app.id) ? app.clientApiKey : '•'.repeat(32)}
</Text>
<Tooltip label={visibleAppKeys.has(app.id) ? 'Sembunyikan' : 'Tampilkan'}>
<ActionIcon variant="subtle" size="xs" color="gray" onClick={() => toggleAppKeyVisibility(app.id)}>
{visibleAppKeys.has(app.id) ? <TbEyeOff size={12} /> : <TbEye size={12} />}
</ActionIcon>
</Tooltip>
<CopyButton value={app.clientApiKey}>
{({ copy }) => (
<Tooltip label="Salin">
<ActionIcon variant="subtle" size="xs" color="gray" onClick={copy}>
<TbCopy size={12} />
</ActionIcon>
</Tooltip>
)}
</CopyButton>
</Group>
</>
)}
{app.apiKey && (
<>
<Text size="xs" fw={500} c="gray" mt={4}>Server Key (untuk monitoring mengakses API external):</Text>
<Group gap={4} wrap="nowrap">
<Text size="xs" ff="monospace" c="dimmed" style={{ userSelect: visibleAppKeys.has(`server-${app.id}`) ? 'text' : 'none' }}>
{visibleAppKeys.has(`server-${app.id}`) ? app.apiKey : '•'.repeat(32)}
</Text>
<Tooltip label={visibleAppKeys.has(`server-${app.id}`) ? 'Sembunyikan' : 'Tampilkan'}>
<ActionIcon variant="subtle" size="xs" color="gray" onClick={() => toggleAppKeyVisibility(`server-${app.id}`)}>
{visibleAppKeys.has(`server-${app.id}`) ? <TbEyeOff size={12} /> : <TbEye size={12} />}
</ActionIcon>
</Tooltip>
<CopyButton value={app.apiKey}>
{({ copy }) => (
<Tooltip label="Salin">
<ActionIcon variant="subtle" size="xs" color="gray" onClick={copy}>
<TbCopy size={12} />
</ActionIcon>
</Tooltip>
)}
</CopyButton>
</Group>
</>
)}
</Box>
</Group>
<Group gap="xs" wrap="nowrap">
{app.active ? (
<>
<Button size="xs" variant="light" color="teal" leftSection={<TbServer size={14} />} onClick={() => openApiModal(app)}>
Edit API Config
</Button>
<Button size="xs" variant="light" color="violet" leftSection={<TbKey size={14} />} onClick={() => confirmGenerateKey(app)} loading={generateKeyMutation.isPending}>
{app.hasClientApiKey ? 'Regenerate Key' : 'Generate Key'}
</Button>
<Button size="xs" variant="light" color="red" onClick={() => confirmDeactivate(app)} loading={deleteMutation.isPending}>
Deactivate
</Button>
</>
) : (
<Button size="xs" variant="light" color="green" onClick={() => activateMutation.mutate(app.id)} loading={activateMutation.isPending}>
Activate
</Button>
)}
</Group>
</Group>
</Paper>
))}
</Stack>
)}
{/* ── Add App Modal ── */}
<Modal opened={addOpened} onClose={closeAdd} title="Add Application" radius="md">
<Stack gap="sm">
<TextInput label="App ID" description="Unique slug used as identifier (e.g. desa-plus)" placeholder="my-app" value={newApp.id} onChange={(e) => setNewApp((p) => ({ ...p, id: e.target.value }))} required />
<TextInput label="Name" placeholder="My Application" value={newApp.name} onChange={(e) => setNewApp((p) => ({ ...p, name: e.target.value }))} required />
<TextInput label="URL API" placeholder="https://api.example.com" value={newApp.urlApi} onChange={(e) => setNewApp((p) => ({ ...p, urlApi: e.target.value }))} />
<TextInput
label="Server Key (API External)"
description="Key untuk monitoring mengakses API external app ini."
placeholder="secret-key"
type={addKeyVisible ? 'text' : 'password'}
value={newApp.apiKey}
onChange={(e) => setNewApp((p) => ({ ...p, apiKey: e.target.value }))}
rightSection={
<ActionIcon variant="subtle" size="sm" color="gray" onClick={() => setAddKeyVisible((v) => !v)}>
{addKeyVisible ? <TbEyeOff size={14} /> : <TbEye size={14} />}
</ActionIcon>
}
/>
<Group justify="flex-end" mt="xs">
<Button variant="subtle" color="gray" onClick={closeAdd}>Cancel</Button>
<Button loading={createMutation.isPending} disabled={!newApp.id || !newApp.name} onClick={() => createMutation.mutate(newApp)}>Add</Button>
</Group>
</Stack>
</Modal>
{/* ── Generated Key Modal ── */}
<Modal opened={keyOpened} onClose={closeKey} title="Client API Key Generated" radius="md">
<Stack gap="sm">
<Text size="sm" c="dimmed">Copy this key now it will not be shown again after you close this dialog.</Text>
<Group gap={4} wrap="nowrap" align="center">
<Box
p="sm"
flex={1}
style={{ background: 'var(--mantine-color-dark-6)', borderRadius: 6, fontFamily: 'monospace', fontSize: 13, wordBreak: 'break-all', userSelect: generatedKeyVisible ? 'text' : 'none' }}
>
{generatedKeyVisible ? generatedKey : '•'.repeat(48)}
</Box>
<Tooltip label={generatedKeyVisible ? 'Sembunyikan' : 'Tampilkan'}>
<ActionIcon variant="subtle" color="gray" onClick={() => setGeneratedKeyVisible((v) => !v)}>
{generatedKeyVisible ? <TbEyeOff size={16} /> : <TbEye size={16} />}
</ActionIcon>
</Tooltip>
</Group>
<Group justify="flex-end">
<CopyButton value={generatedKey}>
{({ copy }) => (
<Button variant="light" color={keyCopied ? 'green' : 'blue'} leftSection={<TbCopy size={14} />} onClick={() => { copy(); setKeyCopied(true) }}>
{keyCopied ? 'Copied!' : 'Copy to Clipboard'}
</Button>
)}
</CopyButton>
<Button variant="subtle" color="gray" onClick={closeKey}>Close</Button>
</Group>
</Stack>
</Modal>
{/* ── API Config Modal ── */}
<Modal opened={apiOpened} onClose={closeApi} title={`API Config — ${apiTarget?.name}`} radius="md">
<Stack gap="sm">
<TextInput label="URL API" description="Base URL for proxying requests to the external API." placeholder="https://api.example.com" value={apiForm.urlApi} onChange={(e) => setApiForm((p) => ({ ...p, urlApi: e.target.value }))} />
<TextInput
label="Server Key (API External)"
description="Key untuk monitoring mengakses API external. Kosongkan untuk tetap menggunakan key yang ada."
placeholder="Kosongkan untuk tetap menggunakan key yang ada"
type={apiConfigKeyVisible ? 'text' : 'password'}
value={apiForm.apiKey}
onChange={(e) => setApiForm((p) => ({ ...p, apiKey: e.target.value }))}
rightSection={
<ActionIcon variant="subtle" size="sm" color="gray" onClick={() => setApiConfigKeyVisible((v) => !v)}>
{apiConfigKeyVisible ? <TbEyeOff size={14} /> : <TbEye size={14} />}
</ActionIcon>
}
/>
<Group justify="flex-end" mt="xs">
<Button variant="subtle" color="gray" onClick={closeApi}>Cancel</Button>
<Button
loading={apiMutation.isPending}
onClick={() => {
if (!apiTarget) return
const body: { urlApi: string; apiKey?: string } = { urlApi: apiForm.urlApi }
if (apiForm.apiKey) body.apiKey = apiForm.apiKey
apiMutation.mutate({ id: apiTarget.id, body })
}}
>
Save
</Button>
</Group>
</Stack>
</Modal>
</Stack>
)
}
// ─── API Keys Panel ────────────────────────────────────────────────────────────
interface ApiKeyItem {
id: string
name: string
key: string
isActive: boolean
createdAt: string
updatedAt: string
}
function ApiKeysPanel() {
const qc = useQueryClient()
const [createOpened, { open: openCreate, close: closeCreate }] = useDisclosure(false)
const [newKeyName, setNewKeyName] = useState('')
const [createdKey, setCreatedKey] = useState<string | null>(null)
const [keyCopied, setKeyCopied] = useState(false)
const [revealedOpened, { open: openRevealed, close: closeRevealed }] = useDisclosure(false)
const [visibleKeys, setVisibleKeys] = useState<Set<string>>(new Set())
const toggleKeyVisibility = (keyId: string) => {
setVisibleKeys((prev) => {
const next = new Set(prev)
if (next.has(keyId)) next.delete(keyId)
else next.add(keyId)
return next
})
}
const { data, isLoading } = useQuery({
queryKey: ['admin', 'api-keys'],
queryFn: () => fetch('/api/admin/api-keys', { credentials: 'include' }).then((r) => r.json()),
})
const keys: ApiKeyItem[] = data?.keys ?? []
const createMutation = useMutation({
mutationFn: async (name: string) => {
const r = await fetch('/api/admin/api-keys', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name }),
})
const json = await r.json()
if (!r.ok) throw new Error(json.error ?? 'Gagal membuat API key')
return json
},
onSuccess: (res) => {
qc.invalidateQueries({ queryKey: ['admin', 'api-keys'] })
closeCreate()
setNewKeyName('')
if (res.key?.key) {
setCreatedKey(res.key.key)
setKeyCopied(false)
openRevealed()
}
},
onError: (err: Error) => notifications.show({ color: 'red', title: 'Gagal', message: err.message }),
})
const toggleMutation = useMutation({
mutationFn: ({ id, isActive }: { id: string; isActive: boolean }) =>
fetch(`/api/admin/api-keys/${id}`, {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ isActive }),
}).then((r) => r.json()),
onSuccess: () => qc.invalidateQueries({ queryKey: ['admin', 'api-keys'] }),
})
const deleteMutation = useMutation({
mutationFn: (id: string) =>
fetch(`/api/admin/api-keys/${id}`, { method: 'DELETE', credentials: 'include' }).then((r) => r.json()),
onSuccess: () => qc.invalidateQueries({ queryKey: ['admin', 'api-keys'] }),
})
const confirmDelete = (key: ApiKeyItem) => {
modals.openConfirmModal({
title: 'Hapus API Key',
children: (
<Text size="sm">
Yakin hapus key <strong>{key.name}</strong>? Semua klien yang menggunakan key ini akan kehilangan akses.
</Text>
),
labels: { confirm: 'Hapus', cancel: 'Batal' },
confirmProps: { color: 'red' },
onConfirm: () => deleteMutation.mutate(key.id),
})
}
return (
<Stack>
<Group justify="space-between">
<div>
<Title order={3}>Desa Mandiri Keys</Title>
<Text size="sm" c="dimmed">Manage access tokens for the Desa Mandiri system</Text>
</div>
<Button leftSection={<TbKey size={14} />} onClick={openCreate}>
Buat Key Baru
</Button>
</Group>
{isLoading ? (
<Center><Loader /></Center>
) : keys.length === 0 ? (
<Paper withBorder p="xl" radius="md">
<Center>
<Stack align="center" gap="xs">
<ThemeIcon size="xl" variant="light" color="gray"><TbKey size={24} /></ThemeIcon>
<Text c="dimmed" size="sm">Belum ada API key. Buat key pertama untuk mengakses API.</Text>
</Stack>
</Center>
</Paper>
) : (
<Table.ScrollContainer minWidth={600}>
<Table striped highlightOnHover>
<Table.Thead>
<Table.Tr>
<Table.Th>Nama</Table.Th>
<Table.Th>Key</Table.Th>
<Table.Th>Status</Table.Th>
<Table.Th>Dibuat</Table.Th>
<Table.Th w={100}>Aksi</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>
{keys.map((k) => (
<Table.Tr key={k.id}>
<Table.Td fw={500}>{k.name}</Table.Td>
<Table.Td>
<Group gap={4} wrap="nowrap">
<Text size="xs" ff="monospace" c="dimmed" style={{ userSelect: visibleKeys.has(k.id) ? 'text' : 'none' }}>
{visibleKeys.has(k.id) ? k.key : '•'.repeat(32)}
</Text>
<Tooltip label={visibleKeys.has(k.id) ? 'Sembunyikan' : 'Tampilkan'}>
<ActionIcon
variant="subtle"
size="xs"
color="gray"
onClick={() => toggleKeyVisibility(k.id)}
>
{visibleKeys.has(k.id) ? <TbEyeOff size={12} /> : <TbEye size={12} />}
</ActionIcon>
</Tooltip>
<CopyButton value={k.key}>
{({ copy }) => (
<Tooltip label="Salin">
<ActionIcon variant="subtle" size="xs" color="gray" onClick={copy}>
<TbCopy size={12} />
</ActionIcon>
</Tooltip>
)}
</CopyButton>
</Group>
</Table.Td>
<Table.Td>
<Badge color={k.isActive ? 'green' : 'gray'} variant="light">
{k.isActive ? 'Aktif' : 'Nonaktif'}
</Badge>
</Table.Td>
<Table.Td>
<Text size="xs" c="dimmed">{new Date(k.createdAt).toLocaleDateString('id-ID')}</Text>
</Table.Td>
<Table.Td>
<Group gap={4}>
<Tooltip label={k.isActive ? 'Nonaktifkan' : 'Aktifkan'}>
<ActionIcon
variant="subtle"
color={k.isActive ? 'orange' : 'green'}
size="sm"
loading={toggleMutation.isPending}
onClick={() => toggleMutation.mutate({ id: k.id, isActive: !k.isActive })}
>
<TbRefresh size={14} />
</ActionIcon>
</Tooltip>
<Tooltip label="Hapus">
<ActionIcon
variant="subtle"
color="red"
size="sm"
loading={deleteMutation.isPending}
onClick={() => confirmDelete(k)}
>
<TbTrash size={14} />
</ActionIcon>
</Tooltip>
</Group>
</Table.Td>
</Table.Tr>
))}
</Table.Tbody>
</Table>
</Table.ScrollContainer>
)}
{/* ── Create Key Modal ── */}
<Modal opened={createOpened} onClose={closeCreate} title="Buat API Key Baru" radius="md">
<Stack gap="sm">
<TextInput
label="Nama Key"
description="Label untuk mengidentifikasi key ini (misal: Jenna Mobile App)"
placeholder="Nama key..."
value={newKeyName}
onChange={(e) => setNewKeyName(e.target.value)}
required
/>
<Group justify="flex-end" mt="xs">
<Button variant="subtle" color="gray" onClick={closeCreate}>Batal</Button>
<Button
loading={createMutation.isPending}
disabled={!newKeyName.trim()}
onClick={() => createMutation.mutate(newKeyName)}
>
Buat Key
</Button>
</Group>
</Stack>
</Modal>
{/* ── Reveal Key Modal ── */}
<Modal opened={revealedOpened} onClose={closeRevealed} title="API Key Berhasil Dibuat" radius="md">
<Stack gap="sm">
<Text size="sm" c="dimmed">Salin key ini sekarang key tidak akan ditampilkan kembali setelah dialog ini ditutup.</Text>
<Box
p="sm"
style={{ background: 'var(--mantine-color-dark-6)', borderRadius: 6, fontFamily: 'monospace', fontSize: 13, wordBreak: 'break-all' }}
>
{createdKey}
</Box>
<Group justify="flex-end">
<Button
variant="light"
color={keyCopied ? 'green' : 'blue'}
leftSection={<TbCopy size={14} />}
onClick={() => { if (createdKey) { navigator.clipboard.writeText(createdKey); setKeyCopied(true) } }}
>
{keyCopied ? 'Tersalin!' : 'Salin Key'}
</Button>
<Button variant="subtle" color="gray" onClick={() => { closeRevealed(); setCreatedKey(null) }}>Tutup</Button>
</Group>
</Stack>
</Modal>
</Stack> </Stack>
) )
} }
// ─── Unused imports fix ────────────────────────────────────────────────────────
// Box, Container, Card, Modal, Paper, Select, SimpleGrid, Stack, Table, Text, ThemeIcon, Title, Tooltip — all used above
// TbDots is used in OperatorsPanel menu
void TbFileText void TbFileText
void TbCode void TbCode
void TbUser void TbUser

View File

@@ -1,7 +1,7 @@
import { Button, Container, Group, Stack, Text, Title } from '@mantine/core' import { Button, Box, Center, Stack, Text, Title } from '@mantine/core'
import { Link, createFileRoute } from '@tanstack/react-router' import { Link, createFileRoute } from '@tanstack/react-router'
import { SiBun } from 'react-icons/si' import { TbLogin } from 'react-icons/tb'
import { TbBrandReact, TbLogin, TbRocket } from 'react-icons/tb' import logoUrl from '../../logo.svg'
export const Route = createFileRoute('/')({ export const Route = createFileRoute('/')({
component: HomePage, component: HomePage,
@@ -9,28 +9,67 @@ export const Route = createFileRoute('/')({
function HomePage() { function HomePage() {
return ( return (
<Container size="sm" py="xl"> <Box style={{ minHeight: '100vh', background: '#1a1a2e', position: 'relative', overflow: 'hidden' }}>
<Stack align="center" gap="lg"> {/* background blobs */}
<Group gap="lg"> <Box style={{
<SiBun size={64} color="#fbf0df" /> position: 'absolute', top: '-15%', left: '-10%',
<TbBrandReact size={64} color="#61dafb" /> width: 500, height: 500, borderRadius: '50%',
</Group> background: 'radial-gradient(circle, rgba(124,58,237,0.25) 0%, transparent 70%)',
pointerEvents: 'none',
}} />
<Box style={{
position: 'absolute', bottom: '-20%', right: '-10%',
width: 600, height: 600, borderRadius: '50%',
background: 'radial-gradient(circle, rgba(79,70,229,0.2) 0%, transparent 70%)',
pointerEvents: 'none',
}} />
<Box style={{
position: 'absolute', top: '50%', left: '60%',
width: 300, height: 300, borderRadius: '50%',
background: 'radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%)',
pointerEvents: 'none',
}} />
<Title order={1}>Bun + Elysia + Vite + React</Title> <Center mih="100vh" style={{ position: 'relative', zIndex: 1 }}>
<Stack align="center" gap="xl">
<img
src={logoUrl}
width={72}
height={72}
alt="logo"
style={{ borderRadius: 20, boxShadow: '0 4px 32px rgba(124,58,237,0.5)', display: 'block' }}
/>
<Text c="dimmed" ta="center" maw={480}> <Stack align="center" gap={8}>
Full-stack starter template with Mantine UI, TanStack Router, and session-based auth. <Title
</Text> order={1}
c="white"
fw={800}
ta="center"
style={{ fontSize: '2.6rem', letterSpacing: '-0.5px', lineHeight: 1.15 }}
>
Monitoring System
</Title>
<Text c="dimmed" ta="center" size="md" maw={320} lh={1.6}>
Pantau semua aplikasi dalam satu tempat, real-time.
</Text>
</Stack>
<Group> <Button
<Button component={Link} to="/login" leftSection={<TbLogin size={18} />} variant="filled"> component={Link}
Login to="/login"
leftSection={<TbLogin size={18} />}
size="md"
style={{
background: 'linear-gradient(135deg, #4f46e5, #7c3aed)',
border: 'none',
paddingInline: 32,
}}
>
Masuk
</Button> </Button>
<Button component={Link} to="/dashboard" leftSection={<TbRocket size={18} />} variant="light"> </Stack>
Dashboard </Center>
</Button> </Box>
</Group>
</Stack>
</Container>
) )
} }

View File

@@ -1,10 +1,11 @@
import { useLogin } from '@/frontend/hooks/useAuth' import { useLogin } from '@/frontend/hooks/useAuth'
import logoUrl from '../../logo.svg'
import { import {
Alert, Alert,
Box,
Button, Button,
Center, Center,
Divider, Divider,
Paper,
PasswordInput, PasswordInput,
Stack, Stack,
Text, Text,
@@ -38,6 +39,14 @@ export const Route = createFileRoute('/login')({
component: LoginPage, component: LoginPage,
}) })
const OAUTH_ERRORS: Record<string, string> = {
google_denied: 'Login dengan Google dibatalkan.',
invalid_state: 'Sesi OAuth tidak valid, silakan coba lagi.',
token_failed: 'Gagal menukar token Google, silakan coba lagi.',
userinfo_failed: 'Gagal mengambil info akun Google, silakan coba lagi.',
account_disabled: 'Akun Anda telah dinonaktifkan. Hubungi admin untuk informasi lebih lanjut.',
}
function LoginPage() { function LoginPage() {
const login = useLogin() const login = useLogin()
const { error: searchError } = Route.useSearch() const { error: searchError } = Route.useSearch()
@@ -49,68 +58,117 @@ function LoginPage() {
login.mutate({ email, password }) login.mutate({ email, password })
} }
const errorMessage = login.isError
? login.error.message
: searchError
? (OAUTH_ERRORS[searchError] ?? 'Login dengan Google gagal, silakan coba lagi.')
: null
return ( return (
<Center mih="100vh"> <Box style={{ minHeight: '100vh', background: '#1a1a2e', position: 'relative', overflow: 'hidden' }}>
<Paper shadow="md" p="xl" radius="md" w={400} withBorder> {/* background blobs */}
<form onSubmit={handleSubmit}> <Box style={{
<Stack gap="md"> position: 'absolute', top: '-15%', left: '-10%',
<Title order={2} ta="center"> width: 500, height: 500, borderRadius: '50%',
Login background: 'radial-gradient(circle, rgba(124,58,237,0.25) 0%, transparent 70%)',
</Title> pointerEvents: 'none',
}} />
<Box style={{
position: 'absolute', bottom: '-20%', right: '-10%',
width: 600, height: 600, borderRadius: '50%',
background: 'radial-gradient(circle, rgba(79,70,229,0.2) 0%, transparent 70%)',
pointerEvents: 'none',
}} />
<Box style={{
position: 'absolute', top: '50%', left: '60%',
width: 300, height: 300, borderRadius: '50%',
background: 'radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%)',
pointerEvents: 'none',
}} />
{(login.isError || searchError) && ( <Center mih="100vh" style={{ position: 'relative', zIndex: 1 }}>
<Alert icon={<TbAlertCircle size={16} />} color="red" variant="light"> <Box
{login.isError ? login.error.message : ( p="xl"
{ w={400}
google_denied: 'Login dengan Google dibatalkan.', style={{
invalid_state: 'Sesi OAuth tidak valid, silakan coba lagi.', background: 'rgba(36,36,36,0.75)',
token_failed: 'Gagal menukar token Google, silakan coba lagi.', backdropFilter: 'blur(20px)',
userinfo_failed: 'Gagal mengambil info akun Google, silakan coba lagi.', borderRadius: 20,
}[searchError ?? ''] ?? 'Login dengan Google gagal, silakan coba lagi.' border: '1px solid rgba(124,58,237,0.35)',
)} boxShadow: '0 0 0 1px rgba(124,58,237,0.1), 0 8px 32px rgba(0,0,0,0.4), 0 0 60px rgba(124,58,237,0.12)',
</Alert> }}
)} >
<form onSubmit={handleSubmit}>
<Stack gap="md">
{/* header */}
<Stack gap={8} align="center" mb={4}>
<img
src={logoUrl}
width={56}
height={56}
alt="logo"
style={{ borderRadius: 14, boxShadow: '0 4px 20px rgba(124,58,237,0.45)', display: 'block' }}
/>
<Title order={2} fw={700} ta="center" c="white">
Monitoring System
</Title>
<Text c="dimmed" size="sm" ta="center">
Masuk untuk melanjutkan
</Text>
</Stack>
<TextInput {errorMessage && (
label="Email" <Alert icon={<TbAlertCircle size={16} />} color="red" variant="light">
placeholder="email@example.com" {errorMessage}
leftSection={<TbMail size={16} />} </Alert>
value={email} )}
onChange={(e) => setEmail(e.currentTarget.value)}
required
/>
<PasswordInput <TextInput
label="Password" label="Email"
placeholder="Password" placeholder="email@example.com"
leftSection={<TbLock size={16} />} leftSection={<TbMail size={16} />}
value={password} value={email}
onChange={(e) => setPassword(e.currentTarget.value)} onChange={(e) => setEmail(e.currentTarget.value)}
required required
/> />
<Button <PasswordInput
type="submit" label="Password"
fullWidth placeholder="Password"
leftSection={<TbLogin size={18} />} leftSection={<TbLock size={16} />}
loading={login.isPending} value={password}
> onChange={(e) => setPassword(e.currentTarget.value)}
Sign in required
</Button> />
<Divider label="or" labelPosition="center" /> <Button
type="submit"
fullWidth
leftSection={<TbLogin size={18} />}
loading={login.isPending}
mt={4}
style={{
background: 'linear-gradient(135deg, #4f46e5, #7c3aed)',
border: 'none',
}}
>
Sign in
</Button>
<Button <Divider label="atau" labelPosition="center" />
variant="default"
fullWidth <Button
leftSection={<FcGoogle size={18} />} variant="default"
onClick={() => { window.location.href = '/api/auth/google' }} fullWidth
> leftSection={<FcGoogle size={18} />}
Continue with Google onClick={() => { window.location.href = '/api/auth/google' }}
</Button> >
</Stack> Continue with Google
</form> </Button>
</Paper> </Stack>
</Center> </form>
</Box>
</Center>
</Box>
) )
} }

View File

@@ -1,22 +1,25 @@
import { import {
ActionIcon,
Badge, Badge,
Container, Container,
Group, Group,
Stack, Loader,
Text,
Paper,
TextInput,
Select,
Avatar,
Box,
Divider,
Pagination, Pagination,
Center, Paper,
SegmentedControl,
Select,
Stack,
Table,
Text,
Title,
Tooltip, Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useState, useMemo, useEffect } from 'react' import { DatePickerInput, type DatesRangeValue } from '@mantine/dates'
import dayjs from 'dayjs'
import 'dayjs/locale/id'
import { useMemo, useState } from 'react'
import { createFileRoute } from '@tanstack/react-router' import { createFileRoute } from '@tanstack/react-router'
import { TbSearch, TbClock, TbCheck, TbX } from 'react-icons/tb' import { TbHistory, TbRefresh } from 'react-icons/tb'
import { DashboardLayout } from '@/frontend/components/DashboardLayout' import { DashboardLayout } from '@/frontend/components/DashboardLayout'
import useSWR from 'swr' import useSWR from 'swr'
import { API_URLS } from '../config/api' import { API_URLS } from '../config/api'
@@ -25,263 +28,213 @@ export const Route = createFileRoute('/logs')({
component: GlobalLogsPage, component: GlobalLogsPage,
}) })
const fetcher = (url: string) => fetch(url).then((res) => res.json()) const fetcher = (url: string) => fetch(url, { credentials: 'include' }).then((r) => r.json())
const typeConfig: Record<string, { color: string; icon?: any }> = { const LOG_TYPES = ['all', 'LOGIN', 'LOGOUT', 'CREATE', 'UPDATE', 'DELETE'] as const
CREATE: { color: 'blue', icon: TbCheck }, const LOG_TYPE_LABEL: Record<string, string> = {
UPDATE: { color: 'teal', icon: TbCheck }, all: 'All',
DELETE: { color: 'red', icon: TbX }, LOGIN: 'Login',
LOGIN: { color: 'green', icon: TbClock }, LOGOUT: 'Logout',
LOGOUT: { color: 'orange', icon: TbClock }, CREATE: 'Create',
UPDATE: 'Update',
DELETE: 'Delete',
} }
const LOG_TYPE_COLOR: Record<string, string> = {
const getRoleColor = (role: string) => { LOGIN: 'teal',
const r = (role || '').toLowerCase() LOGOUT: 'gray',
if (r.includes('super')) return 'red' CREATE: 'blue',
if (r.includes('admin')) return 'brand-blue' UPDATE: 'yellow',
if (r.includes('developer')) return 'violet' DELETE: 'red',
return 'gray'
}
function groupLogsByDate(logs: any[]) {
const groups: Record<string, any[]> = {}
const today = new Date().toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }).toUpperCase()
const yesterday = new Date(Date.now() - 86400000).toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }).toUpperCase()
logs.forEach(log => {
const dateObj = new Date(log.createdAt)
let dateStr = dateObj.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }).toUpperCase()
if (dateStr === today) dateStr = 'TODAY'
else if (dateStr === yesterday) dateStr = 'YESTERDAY'
if (!groups[dateStr]) groups[dateStr] = []
const timeStr = dateObj.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })
groups[dateStr].push({
id: log.id,
time: timeStr,
user: log.user,
type: log.type,
content: log.message,
color: log.user ? getRoleColor(log.user.role) : 'gray',
icon: typeConfig[log.type as string]?.icon
})
})
// We want to keep the order as they came from the API (sorted by createdAt desc)
// but grouped by date. Object.entries might mess up the order if dates are not sequential.
// However, since the source logs are sorted, the first encounter of a date defines the group order.
const result: { date: string; logs: any[] }[] = []
const seenDates = new Set<string>()
logs.forEach(log => {
const dateObj = new Date(log.createdAt)
let dateStr = dateObj.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }).toUpperCase()
if (dateStr === today) dateStr = 'TODAY'
else if (dateStr === yesterday) dateStr = 'YESTERDAY'
if (!seenDates.has(dateStr)) {
result.push({ date: dateStr, logs: groups[dateStr] })
seenDates.add(dateStr)
}
})
return result
} }
function GlobalLogsPage() { function GlobalLogsPage() {
const [search, setSearch] = useState('') const [type, setType] = useState('all')
const [debouncedSearch, setDebouncedSearch] = useState('') const [operatorId, setOperatorId] = useState('all')
const [logType, setLogType] = useState<string | null>('all') const [dateRange, setDateRange] = useState<DatesRangeValue>([null, null])
const [operatorId, setOperatorId] = useState<string | null>('all')
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
useEffect(() => {
const timer = setTimeout(() => setDebouncedSearch(search), 300)
return () => clearTimeout(timer)
}, [search])
const { data: operatorsData } = useSWR(API_URLS.getLogOperators(), fetcher) const { data: operatorsData } = useSWR(API_URLS.getLogOperators(), fetcher)
const operatorOptions = useMemo(() => { const operatorOptions = useMemo(() => {
if (!operatorsData || !Array.isArray(operatorsData)) return [{ value: 'all', label: 'All Operators' }] if (!operatorsData || !Array.isArray(operatorsData)) return [{ value: 'all', label: 'All users' }]
return [ return [
{ value: 'all', label: 'All Operators' }, { value: 'all', label: 'All users' },
...operatorsData.map((op: any) => ({ value: op.id, label: op.name })) ...operatorsData.map((op: any) => ({ value: op.id, label: op.name })),
] ]
}, [operatorsData]) }, [operatorsData])
const { data: response, isLoading } = useSWR( const dateFrom = dateRange[0] ? dayjs(dateRange[0]).format('YYYY-MM-DD') : undefined
API_URLS.getGlobalLogs(page, debouncedSearch, logType || 'all', operatorId || 'all'), const dateTo = dateRange[1] ? dayjs(dateRange[1]).format('YYYY-MM-DD') : undefined
fetcher
const { data, isLoading, mutate } = useSWR(
API_URLS.getGlobalLogs(page, '', type, operatorId, dateFrom, dateTo),
fetcher,
{ refreshInterval: 10_000 },
) )
const filteredTimeline = useMemo(() => { const logs: any[] = data?.data ?? []
if (!response?.data) return [] const totalPages: number = data?.totalPages ?? 1
return groupLogsByDate(response.data)
}, [response?.data])
return ( return (
<DashboardLayout> <DashboardLayout>
<Container size="xl" py="lg"> <Container size="xl" py="lg">
<Stack gap="xl">
{/* Header Controls */} <Group justify="space-between" align="flex-start">
<Group mb="xl" gap="md"> <Stack gap={4}>
<TextInput <Title order={2} className="gradient-text">Activity Logs</Title>
placeholder="Search operator or message..." <Text size="sm" c="dimmed">
leftSection={<TbSearch size={16} />} Track all user actions and system events across the platform.
radius="md" </Text>
w={250} </Stack>
value={search} <Tooltip label="Refresh logs" withArrow>
onChange={(e) => { <ActionIcon
setSearch(e.currentTarget.value) variant="light"
setPage(1) color="brand-blue"
}} size="lg"
/> onClick={() => mutate()}
<Select loading={isLoading}
placeholder="Log Type" >
data={[ <TbRefresh size={16} />
{ value: 'all', label: 'All Types' }, </ActionIcon>
{ value: 'CREATE', label: 'Create' }, </Tooltip>
{ value: 'UPDATE', label: 'Update' }, </Group>
{ value: 'DELETE', label: 'Delete' },
{ value: 'LOGIN', label: 'Login' },
{ value: 'LOGOUT', label: 'Logout' },
]}
radius="md"
w={160}
value={logType}
onChange={(val) => {
setLogType(val)
setPage(1)
}}
/>
<Select
placeholder="Operator"
data={operatorOptions}
searchable
radius="md"
w={200}
value={operatorId}
onChange={(val) => {
setOperatorId(val)
setPage(1)
}}
/>
</Group>
{/* Timeline Content */} <Paper withBorder radius="xl" p="md" className="glass">
<Paper withBorder p="md" radius="2xl" className="glass" style={{ background: 'var(--mantine-color-body)', minHeight: 400 }}> <Group gap="sm" wrap="wrap" align="flex-end">
{isLoading ? ( <Select
<Center py="xl"> label="User"
<Text c="dimmed">Loading logs...</Text> placeholder="All users"
</Center> value={operatorId}
) : filteredTimeline.length === 0 ? ( onChange={(v) => { setOperatorId(v ?? 'all'); setPage(1) }}
<Text c="dimmed" ta="center" py="xl">No logs found matching your filters.</Text> data={operatorOptions}
w={200}
clearable
size="sm"
/>
<DatePickerInput
type="range"
label="Date range"
placeholder="Pick a date range"
value={dateRange}
onChange={(v) => { setDateRange(v); setPage(1) }}
locale="id"
valueFormat="DD MMM YYYY"
clearable
w={280}
size="sm"
/>
<Stack gap={4}>
<Text size="xs" fw={500} c="dimmed">Action type</Text>
<SegmentedControl
value={type}
onChange={(v) => { setType(v); setPage(1) }}
size="sm"
data={LOG_TYPES.map((t) => ({ label: LOG_TYPE_LABEL[t] ?? t, value: t }))}
/>
</Stack>
</Group>
</Paper>
{isLoading && !data ? (
<Group justify="center" py="xl">
<Loader type="dots" />
</Group>
) : ( ) : (
<> <Paper withBorder radius="2xl" className="glass" p="md">
{filteredTimeline.map((group, groupIndex) => ( <Table.ScrollContainer minWidth={600}>
<Box key={group.date}> <Table
<Text className="data-table"
size="xs" highlightOnHover
fw={700} verticalSpacing="sm"
c="dimmed" fz="sm"
mt={groupIndex > 0 ? "xl" : 0} style={{ tableLayout: 'fixed', width: '100%' }}
mb="md" >
style={{ textTransform: 'uppercase' }} <colgroup>
> <col style={{ width: 155 }} />
{group.date} <col style={{ width: 210 }} />
</Text> <col style={{ width: 105 }} />
<col />
<Stack gap={0} pl={4}> </colgroup>
{group.logs.map((log, logIndex) => { <Table.Thead>
const isLastLog = logIndex === group.logs.length - 1; <Table.Tr>
<Table.Th>Timestamp</Table.Th>
return ( <Table.Th>User</Table.Th>
<Group <Table.Th>Action</Table.Th>
key={log.id} <Table.Th>Description</Table.Th>
wrap="nowrap" </Table.Tr>
align="flex-start" </Table.Thead>
gap="lg" <Table.Tbody>
style={{ position: 'relative', paddingBottom: isLastLog ? 0 : 32 }} {logs.map((log: any) => (
> <Table.Tr key={log.id}>
{/* Left: Time */} <Table.Td style={{ whiteSpace: 'nowrap' }}>
<Text <Stack gap={0}>
size="xs" <Text size="xs" fw={500}>
c="dimmed" {dayjs(log.createdAt).locale('id').format('D MMM YYYY')}
w={70}
style={{ flexShrink: 0, marginTop: 4, textAlign: 'left' }}
>
{log.time}
</Text>
{/* Middle: Line & Avatar */}
<Box style={{ position: 'relative', width: 20, flexShrink: 0, alignSelf: 'stretch' }}>
{/* Vertical Line */}
{!isLastLog && (
<Box
style={{
position: 'absolute',
top: 24,
bottom: -8,
left: '50%',
transform: 'translateX(-50%)',
width: 1,
backgroundColor: 'rgba(128,128,128,0.2)'
}}
/>
)}
{/* Avatar */}
<Box style={{ position: 'relative', zIndex: 2 }}>
<Tooltip label={`${log.user?.name || 'Unknown'} (${log.user?.role || 'User'})`} withArrow radius="md">
<Avatar
size={24}
radius="xl"
color={log.color}
variant="light"
src={log.user?.image}
style={{ cursor: 'help' }}
>
{log.icon ? <log.icon size={14} /> : (log.user?.name?.charAt(0) || '?')}
</Avatar>
</Tooltip>
</Box>
</Box>
{/* Right: Content */}
<Box style={{ flexGrow: 1, marginTop: 2 }}>
<Text size="sm">
<Text component="span" fw={600} mr={4}>{log.user?.name || 'Unknown'}</Text>
{log.content}
</Text> </Text>
</Box> <Text size="xs" c="dimmed">
</Group> {dayjs(log.createdAt).format('HH:mm:ss')}
) </Text>
})} </Stack>
</Stack> </Table.Td>
<Table.Td>
{groupIndex < filteredTimeline.length - 1 && ( {log.user ? (
<Divider my="xl" color="rgba(128,128,128,0.1)" /> <Stack gap={0}>
)} <Text size="sm" fw={600} truncate>{log.user.name}</Text>
</Box> <Text size="xs" c="dimmed" truncate>{log.user.email}</Text>
))} </Stack>
) : (
{response?.totalPages > 1 && ( <Text c="dimmed" size="sm"></Text>
<Center mt="xl"> )}
<Pagination </Table.Td>
total={response.totalPages} <Table.Td>
value={page} <Badge
onChange={setPage} color={LOG_TYPE_COLOR[log.type] ?? 'gray'}
radius="md" variant="light"
/> size="sm"
</Center> tt="capitalize"
>
{LOG_TYPE_LABEL[log.type] ?? log.type}
</Badge>
</Table.Td>
<Table.Td>
<Tooltip
label={log.message}
multiline
maw={340}
withArrow
position="top-start"
disabled={(log.message?.length ?? 0) < 60}
>
<Text size="sm" lineClamp={2} style={{ cursor: 'default' }}>
{log.message}
</Text>
</Tooltip>
</Table.Td>
</Table.Tr>
))}
{logs.length === 0 && (
<Table.Tr>
<Table.Td colSpan={4}>
<Stack align="center" gap="xs" py="xl">
<TbHistory size={32} style={{ opacity: 0.25 }} />
<Text c="dimmed" size="sm">
No activity logs found for the selected filters.
</Text>
</Stack>
</Table.Td>
</Table.Tr>
)}
</Table.Tbody>
</Table>
</Table.ScrollContainer>
{totalPages > 1 && (
<Group justify="center" mt="md">
<Pagination total={totalPages} value={page} onChange={setPage} size="sm" />
</Group>
)} )}
</> </Paper>
)} )}
</Paper> </Stack>
</Container> </Container>
</DashboardLayout> </DashboardLayout>
) )

View File

@@ -4,12 +4,14 @@ import {
ActionIcon, ActionIcon,
Avatar, Avatar,
Badge, Badge,
Box,
Button, Button,
Card, Card,
Container, Container,
Divider, Divider,
Group, Group,
List, List,
Loader,
Modal, Modal,
Pagination, Pagination,
Paper, Paper,
@@ -23,6 +25,7 @@ import {
TextInput, TextInput,
ThemeIcon, ThemeIcon,
Title, Title,
Tooltip,
} from '@mantine/core' } from '@mantine/core'
import { useDisclosure } from '@mantine/hooks' import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications' import { notifications } from '@mantine/notifications'
@@ -37,7 +40,9 @@ import {
TbSearch, TbSearch,
TbShieldCheck, TbShieldCheck,
TbTrash, TbTrash,
TbUserCheck TbUserCheck,
TbUserPlus,
TbUsers,
} from 'react-icons/tb' } from 'react-icons/tb'
import useSWR from 'swr' import useSWR from 'swr'
import { API_URLS } from '../config/api' import { API_URLS } from '../config/api'
@@ -49,22 +54,51 @@ export const Route = createFileRoute('/users')({
const fetcher = (url: string) => fetch(url).then((res) => res.json()) const fetcher = (url: string) => fetch(url).then((res) => res.json())
const getRoleColor = (role: string) => { const ROLE_COLOR: Record<string, string> = {
if (role === 'DEVELOPER') return 'violet' DEVELOPER: 'violet',
if (role === 'ADMIN') return 'brand-blue' ADMIN: 'brand-blue',
return 'gray' USER: 'gray',
}
const ROLE_LABEL: Record<string, string> = {
DEVELOPER: 'Developer',
ADMIN: 'Admin',
USER: 'User',
} }
const roles = [ const roles = [
{ {
name: 'DEVELOPER', name: 'DEVELOPER',
color: 'red', color: 'violet',
permissions: ['Full Access', 'Error Feedback', 'Error Management', 'App Version Management', 'User Management'] description: 'Super admin with full system access, including the Dev Console.',
permissions: [
'Access Dev Console (/dev)',
'User & role management',
'Manage bug reports & feedback',
'View all apps & activity logs',
'Manage app versions & status',
'Delete system logs',
],
}, },
{ {
name: 'ADMIN', name: 'ADMIN',
color: 'orange', color: 'blue',
permissions: ['View All Apps', 'View Logs', 'Report Errors'] description: 'Operator who can manage applications, bugs, and view activity logs.',
permissions: [
'View & manage all applications',
'Manage bug reports',
'View activity logs',
'View user, village, and order data',
'Update village & product status',
],
},
{
name: 'USER',
color: 'gray',
description: 'New account pending approval. Awaiting review by an Admin or Developer.',
permissions: [
'Access profile page',
'View account approval status',
],
}, },
] ]
@@ -83,7 +117,7 @@ function UsersPage() {
const { data: stats, mutate: mutateStats } = useSWR(API_URLS.getOperatorStats(), fetcher) const { data: stats, mutate: mutateStats } = useSWR(API_URLS.getOperatorStats(), fetcher)
const { data: response, isLoading, mutate: mutateOperators } = useSWR( const { data: response, isLoading, mutate: mutateOperators } = useSWR(
API_URLS.getOperators(page, debouncedSearch), API_URLS.getOperators(page, debouncedSearch),
fetcher fetcher,
) )
const operators = response?.data || [] const operators = response?.data || []
@@ -91,19 +125,13 @@ function UsersPage() {
// ── Create User Modal ── // ── Create User Modal ──
const [createOpened, { open: openCreate, close: closeCreate }] = useDisclosure(false) const [createOpened, { open: openCreate, close: closeCreate }] = useDisclosure(false)
const [isCreating, setIsCreating] = useState(false) const [isCreating, setIsCreating] = useState(false)
const [createForm, setCreateForm] = useState({ const [createForm, setCreateForm] = useState({ name: '', email: '', password: '', role: 'ADMIN' })
name: '',
email: '',
password: '',
role: 'ADMIN',
})
const handleCreateUser = async () => { const handleCreateUser = async () => {
if (!createForm.name || !createForm.email || !createForm.password) { if (!createForm.name || !createForm.email || !createForm.password) {
notifications.show({ title: 'Validation Error', message: 'Please fill in all required fields.', color: 'red' }) notifications.show({ title: 'Validation Error', message: 'Please fill in all required fields.', color: 'red' })
return return
} }
setIsCreating(true) setIsCreating(true)
try { try {
const res = await fetch(API_URLS.createOperator(), { const res = await fetch(API_URLS.createOperator(), {
@@ -111,7 +139,6 @@ function UsersPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(createForm), body: JSON.stringify(createForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ title: 'Success', message: 'User has been created.', color: 'teal', icon: <TbCircleCheck size={18} /> }) notifications.show({ title: 'Success', message: 'User has been created.', color: 'teal', icon: <TbCircleCheck size={18} /> })
mutateOperators() mutateOperators()
@@ -133,11 +160,7 @@ function UsersPage() {
const [editOpened, { open: openEdit, close: closeEdit }] = useDisclosure(false) const [editOpened, { open: openEdit, close: closeEdit }] = useDisclosure(false)
const [isEditing, setIsEditing] = useState(false) const [isEditing, setIsEditing] = useState(false)
const [editingUserId, setEditingUserId] = useState<string | null>(null) const [editingUserId, setEditingUserId] = useState<string | null>(null)
const [editForm, setEditForm] = useState({ const [editForm, setEditForm] = useState({ name: '', email: '', role: '' })
name: '',
email: '',
role: '',
})
const handleOpenEdit = (user: any) => { const handleOpenEdit = (user: any) => {
setEditingUserId(user.id) setEditingUserId(user.id)
@@ -147,7 +170,6 @@ function UsersPage() {
const handleEditUser = async () => { const handleEditUser = async () => {
if (!editingUserId || !editForm.name || !editForm.email) return if (!editingUserId || !editForm.name || !editForm.email) return
setIsEditing(true) setIsEditing(true)
try { try {
const res = await fetch(API_URLS.editOperator(editingUserId), { const res = await fetch(API_URLS.editOperator(editingUserId), {
@@ -155,7 +177,6 @@ function UsersPage() {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(editForm), body: JSON.stringify(editForm),
}) })
if (res.ok) { if (res.ok) {
notifications.show({ title: 'Success', message: 'User has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> }) notifications.show({ title: 'Success', message: 'User has been updated.', color: 'teal', icon: <TbCircleCheck size={18} /> })
mutateOperators() mutateOperators()
@@ -163,14 +184,14 @@ function UsersPage() {
} else { } else {
throw new Error('Failed to update user') throw new Error('Failed to update user')
} }
} catch (e) { } catch {
notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> }) notifications.show({ title: 'Error', message: 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
} finally { } finally {
setIsEditing(false) setIsEditing(false)
} }
} }
// ── Delete User ── // ── Delete User Modal ──
const [deleteOpened, { open: openDelete, close: closeDelete }] = useDisclosure(false) const [deleteOpened, { open: openDelete, close: closeDelete }] = useDisclosure(false)
const [isDeleting, setIsDeleting] = useState(false) const [isDeleting, setIsDeleting] = useState(false)
const [deletingUser, setDeletingUser] = useState<any>(null) const [deletingUser, setDeletingUser] = useState<any>(null)
@@ -182,13 +203,9 @@ function UsersPage() {
const handleDeleteUser = async () => { const handleDeleteUser = async () => {
if (!deletingUser) return if (!deletingUser) return
setIsDeleting(true) setIsDeleting(true)
try { try {
const res = await fetch(API_URLS.deleteOperator(deletingUser.id), { const res = await fetch(API_URLS.deleteOperator(deletingUser.id), { method: 'DELETE' })
method: 'DELETE',
})
if (res.ok) { if (res.ok) {
notifications.show({ title: 'Success', message: 'User has been deleted.', color: 'teal', icon: <TbCircleCheck size={18} /> }) notifications.show({ title: 'Success', message: 'User has been deleted.', color: 'teal', icon: <TbCircleCheck size={18} /> })
mutateOperators() mutateOperators()
@@ -205,43 +222,78 @@ function UsersPage() {
} }
} }
// ── Activate User ──
const handleActivateUser = async (user: any) => {
try {
const res = await fetch(`/api/operators/${user.id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ active: true }),
})
if (res.ok) {
notifications.show({ title: 'Success', message: `${user.name} has been reactivated.`, color: 'teal', icon: <TbCircleCheck size={18} /> })
mutateOperators()
mutateStats()
} else {
const err = await res.json()
throw new Error(err.error || 'Failed to activate user')
}
} catch (e: any) {
notifications.show({ title: 'Error', message: e.message || 'Something went wrong.', color: 'red', icon: <TbCircleX size={18} /> })
}
}
return ( return (
<DashboardLayout> <DashboardLayout>
<Container size="xl" py="lg"> <Container size="xl" py="lg">
<Stack gap="xl"> <Stack gap="xl">
<Group justify="space-between" align="center"> <Stack gap={4}>
<Stack gap={0}> <Title order={2} className="gradient-text">User Management</Title>
<Title order={2} className="gradient-text">Users</Title> <Text size="sm" c="dimmed">Manage platform users, security roles, and access control.</Text>
<Text size="sm" c="dimmed">Manage system users, security roles, and application access control.</Text> </Stack>
</Stack>
</Group>
<SimpleGrid cols={{ base: 1, sm: 3 }} spacing="lg"> <SimpleGrid cols={{ base: 1, sm: 3 }} spacing="lg">
<StatsCard title="Total Staff" value={stats?.totalStaff ?? 0} icon={TbUserCheck} color="brand-blue" /> <StatsCard
<StatsCard title="Active Now" value={stats?.activeNow ?? 0} icon={TbAccessPoint} color="teal" /> title="Total Staff"
<StatsCard title="Security Roles" value={stats?.rolesCount ?? 0} icon={TbShieldCheck} color="purple-primary" /> value={stats?.totalStaff ?? 0}
description="Registered platform users"
icon={TbUserCheck}
color="brand-blue"
/>
<StatsCard
title="Active Now"
value={stats?.activeNow ?? 0}
description="Users with active sessions"
icon={TbAccessPoint}
color="teal"
/>
<StatsCard
title="Security Roles"
value={stats?.rolesCount ?? 0}
description="Defined permission levels"
icon={TbShieldCheck}
color="purple-primary"
/>
</SimpleGrid> </SimpleGrid>
<Tabs defaultValue="users" color="brand-blue" variant="pills" radius="md"> <Tabs defaultValue="users" color="brand-blue" variant="pills" radius="md">
<Tabs.List> <Tabs.List>
<Tabs.Tab value="users" leftSection={<TbUserCheck size={16} />}>User Management</Tabs.Tab> <Tabs.Tab value="users" leftSection={<TbUserCheck size={16} />}>User Management</Tabs.Tab>
<Tabs.Tab value="roles" leftSection={<TbShieldCheck size={16} />}>Role Management</Tabs.Tab> <Tabs.Tab value="roles" leftSection={<TbShieldCheck size={16} />}>Role Reference</Tabs.Tab>
</Tabs.List> </Tabs.List>
<Tabs.Panel value="users" pt="xl"> <Tabs.Panel value="users" pt="xl">
<Stack gap="md"> <Stack gap="md">
<Group justify="space-between"> <Group justify="space-between">
<TextInput <TextInput
placeholder="Search users..." placeholder="Search by name or email..."
leftSection={<TbSearch size={16} />} leftSection={<TbSearch size={16} />}
radius="md" radius="md"
w={350} w={320}
variant="filled" variant="filled"
value={search} value={search}
onChange={(e) => { onChange={(e) => { setSearch(e.currentTarget.value); setPage(1) }}
setSearch(e.currentTarget.value)
setPage(1)
}}
/> />
{isDeveloper && ( {isDeveloper && (
<Button <Button
@@ -249,6 +301,7 @@ function UsersPage() {
gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }} gradient={{ from: '#2563EB', to: '#7C3AED', deg: 135 }}
leftSection={<TbPlus size={18} />} leftSection={<TbPlus size={18} />}
radius="md" radius="md"
size="sm"
onClick={openCreate} onClick={openCreate}
> >
Add New User Add New User
@@ -262,53 +315,124 @@ function UsersPage() {
<Table.Tr> <Table.Tr>
<Table.Th>Name & Contact</Table.Th> <Table.Th>Name & Contact</Table.Th>
<Table.Th>Role</Table.Th> <Table.Th>Role</Table.Th>
<Table.Th>Joined Date</Table.Th> <Table.Th>Joined</Table.Th>
<Table.Th>Actions</Table.Th> <Table.Th>Actions</Table.Th>
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
{isLoading ? ( {isLoading ? (
<Table.Tr> <Table.Tr>
<Table.Td colSpan={4} align="center"> <Table.Td colSpan={4}>
<Text size="sm" c="dimmed" py="xl">Loading user data...</Text> <Group justify="center" py="xl">
<Loader size="sm" type="dots" />
</Group>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
) : operators.length === 0 ? ( ) : operators.length === 0 ? (
<Table.Tr> <Table.Tr>
<Table.Td colSpan={4} align="center"> <Table.Td colSpan={4}>
<Text size="sm" c="dimmed" py="xl">No users found.</Text> <Stack align="center" gap="xs" py="xl">
<TbUsers size={32} style={{ opacity: 0.25 }} />
<Text size="sm" c="dimmed">No users found.</Text>
</Stack>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
) : ( ) : (
operators.map((user: any) => ( operators.map((user: any) => (
<Table.Tr key={user.id}> <Table.Tr key={user.id}>
<Table.Td> <Table.Td style={{ opacity: user.active === false ? 0.45 : 1 }}>
<Group gap="sm"> <Group gap="sm">
<Avatar size="sm" radius="xl" color={getRoleColor(user.role)} src={user.image}> <Box style={{ position: 'relative' }}>
{user.name.charAt(0)} <Avatar
</Avatar> size="sm"
radius="xl"
color={user.active === false ? 'gray' : ROLE_COLOR[user.role] ?? 'gray'}
src={user.image}
>
{user.name.charAt(0)}
</Avatar>
{user.active === false && (
<Box
style={{
position: 'absolute', bottom: -2, right: -2,
width: 10, height: 10, borderRadius: '50%',
background: 'var(--mantine-color-red-6)',
border: '1.5px solid var(--mantine-color-body)',
}}
/>
)}
</Box>
<Stack gap={0}> <Stack gap={0}>
<Text fw={600} size="sm">{user.name}</Text> <Group gap={6}>
<Text fw={600} size="sm" c={user.active === false ? 'dimmed' : undefined}>
{user.name}
</Text>
{user.active === false && (
<Badge size="xs" color="red" variant="light">Inactive</Badge>
)}
</Group>
<Text size="xs" c="dimmed">{user.email}</Text> <Text size="xs" c="dimmed">{user.email}</Text>
</Stack> </Stack>
</Group> </Group>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td style={{ opacity: user.active === false ? 0.45 : 1 }}>
<Badge variant="light" color={getRoleColor(user.role)}> <Badge
{user.role} variant="light"
size="sm"
color={user.active === false ? 'gray' : ROLE_COLOR[user.role] ?? 'gray'}
>
{ROLE_LABEL[user.role] ?? user.role}
</Badge> </Badge>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td style={{ opacity: user.active === false ? 0.45 : 1 }}>
<Text size="xs" fw={500}>{new Date(user.createdAt).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' })}</Text> <Text size="xs" fw={500} c={user.active === false ? 'dimmed' : undefined}>
{new Date(user.createdAt).toLocaleDateString('en-GB', {
day: 'numeric',
month: 'short',
year: 'numeric',
})}
</Text>
</Table.Td> </Table.Td>
<Table.Td> <Table.Td>
<Group gap="xs"> <Group gap="xs">
<ActionIcon disabled={!isDeveloper} variant="light" size="sm" color="blue" onClick={() => handleOpenEdit(user)}> {user.active === false ? (
<TbPencil size={14} /> <Tooltip label="Reactivate user" withArrow>
</ActionIcon> <ActionIcon
<ActionIcon disabled={!isDeveloper} variant="light" size="sm" color="red" onClick={() => handleOpenDelete(user)}> disabled={!isDeveloper}
<TbTrash size={14} /> variant="light"
</ActionIcon> size="sm"
color="teal"
onClick={() => handleActivateUser(user)}
>
<TbUserPlus size={14} />
</ActionIcon>
</Tooltip>
) : (
<>
<Tooltip label="Edit user" withArrow>
<ActionIcon
disabled={!isDeveloper}
variant="light"
size="sm"
color="blue"
onClick={() => handleOpenEdit(user)}
>
<TbPencil size={14} />
</ActionIcon>
</Tooltip>
<Tooltip label="Delete user" withArrow>
<ActionIcon
disabled={!isDeveloper}
variant="light"
size="sm"
color="red"
onClick={() => handleOpenDelete(user)}
>
<TbTrash size={14} />
</ActionIcon>
</Tooltip>
</>
)}
</Group> </Group>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>
@@ -320,12 +444,7 @@ function UsersPage() {
{response?.totalPages > 1 && ( {response?.totalPages > 1 && (
<Group justify="center" mt="md"> <Group justify="center" mt="md">
<Pagination <Pagination total={response.totalPages} value={page} onChange={setPage} size="sm" radius="md" />
total={response.totalPages}
value={page}
onChange={setPage}
radius="md"
/>
</Group> </Group>
)} )}
</Stack> </Stack>
@@ -336,20 +455,18 @@ function UsersPage() {
{roles.map((role) => ( {roles.map((role) => (
<Card key={role.name} withBorder radius="2xl" padding="xl" className="glass"> <Card key={role.name} withBorder radius="2xl" padding="xl" className="glass">
<Stack gap="md"> <Stack gap="md">
<Group justify="space-between"> <ThemeIcon size="xl" radius="md" color={role.color} variant="light">
<ThemeIcon size="xl" radius="md" color={role.color} variant="light"> <TbShieldCheck size={28} />
<TbShieldCheck size={28} /> </ThemeIcon>
</ThemeIcon>
</Group>
<Stack gap={4}> <Stack gap={4}>
<Title order={4}>{role.name.replace('_', ' ')}</Title> <Title order={4}>{ROLE_LABEL[role.name] ?? role.name}</Title>
<Text size="sm" c="dimmed">Core role for secure app management.</Text> <Text size="sm" c="dimmed">{role.description}</Text>
</Stack> </Stack>
<Divider /> <Divider />
<Text size="xs" fw={700} c="dimmed" style={{ textTransform: 'uppercase' }}>Key Permissions</Text> <Text size="xs" fw={700} c="dimmed" tt="uppercase">Key Permissions</Text>
<List <List
spacing="xs" spacing="xs"
size="sm" size="sm"
@@ -364,10 +481,6 @@ function UsersPage() {
<List.Item key={p}>{p}</List.Item> <List.Item key={p}>{p}</List.Item>
))} ))}
</List> </List>
{/* <Button fullWidth variant="light" color={role.color} mt="md" radius="md">
Edit Permissions
</Button> */}
</Stack> </Stack>
</Card> </Card>
))} ))}
@@ -382,7 +495,7 @@ function UsersPage() {
opened={createOpened} opened={createOpened}
onClose={closeCreate} onClose={closeCreate}
title={<Text fw={700} size="lg">Add New User</Text>} title={<Text fw={700} size="lg">Add New User</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
@@ -414,7 +527,7 @@ function UsersPage() {
{ value: 'DEVELOPER', label: 'Developer' }, { value: 'DEVELOPER', label: 'Developer' },
]} ]}
value={createForm.role} value={createForm.role}
onChange={(val) => setCreateForm({ ...createForm, role: val || 'USER' })} onChange={(val) => setCreateForm({ ...createForm, role: val || 'ADMIN' })}
/> />
<Button <Button
fullWidth fullWidth
@@ -434,7 +547,7 @@ function UsersPage() {
opened={editOpened} opened={editOpened}
onClose={closeEdit} onClose={closeEdit}
title={<Text fw={700} size="lg">Edit User</Text>} title={<Text fw={700} size="lg">Edit User</Text>}
radius="xl" radius="md"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
@@ -480,21 +593,19 @@ function UsersPage() {
opened={deleteOpened} opened={deleteOpened}
onClose={closeDelete} onClose={closeDelete}
title={<Text fw={700} size="lg">Delete User</Text>} title={<Text fw={700} size="lg">Delete User</Text>}
radius="xl" radius="md"
size="sm" size="sm"
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
> >
<Stack gap="md"> <Stack gap="md">
<Text size="sm"> <Text size="sm">
Are you sure you want to delete <Text component="span" fw={700}>{deletingUser?.name}</Text>? This action cannot be undone. Are you sure you want to delete{' '}
<Text component="span" fw={700}>{deletingUser?.name}</Text>?
This action cannot be undone.
</Text> </Text>
<Group justify="flex-end" mt="md"> <Group justify="flex-end" mt="md">
<Button variant="subtle" color="gray" onClick={closeDelete}> <Button variant="subtle" color="gray" onClick={closeDelete}>Cancel</Button>
Cancel <Button color="red" loading={isDeleting} onClick={handleDeleteUser}>Delete User</Button>
</Button>
<Button color="red" loading={isDeleting} onClick={handleDeleteUser}>
Delete User
</Button>
</Group> </Group>
</Stack> </Stack>
</Modal> </Modal>

View File

@@ -17,7 +17,6 @@ export const env = {
GOOGLE_CLIENT_ID: required('GOOGLE_CLIENT_ID'), GOOGLE_CLIENT_ID: required('GOOGLE_CLIENT_ID'),
GOOGLE_CLIENT_SECRET: required('GOOGLE_CLIENT_SECRET'), GOOGLE_CLIENT_SECRET: required('GOOGLE_CLIENT_SECRET'),
SUPER_ADMIN_EMAILS: optional('SUPER_ADMIN_EMAIL', '').split(',').map(e => e.trim()).filter(Boolean), SUPER_ADMIN_EMAILS: optional('SUPER_ADMIN_EMAIL', '').split(',').map(e => e.trim()).filter(Boolean),
API_KEY: required('API_KEY'),
MINIO_ENDPOINT: required('MINIO_ENDPOINT'), MINIO_ENDPOINT: required('MINIO_ENDPOINT'),
MINIO_PORT: parseInt(optional('MINIO_PORT', '443'), 10), MINIO_PORT: parseInt(optional('MINIO_PORT', '443'), 10),
MINIO_USE_SSL: optional('MINIO_USE_SSL', 'true') === 'true', MINIO_USE_SSL: optional('MINIO_USE_SSL', 'true') === 'true',

View File

@@ -1 +1,17 @@
<svg id="Bun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 70"><title>Bun Logo</title><path id="Shadow" d="M71.09,20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46,26.46,0,0,1,75.5,35.7c0,16.57-16.82,30.05-37.5,30.05-11.58,0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55,65.3,30.14,69.75,42,69.75c20.68,0,37.5-13.48,37.5-30C79.5,32.69,76.46,26,71.09,20.74Z"/><g id="Body"><path id="Background" d="M73,35.7c0,15.21-15.67,27.54-35,27.54S3,50.91,3,35.7C3,26.27,9,17.94,18.22,13S33.18,3,38,3s8.94,4.13,19.78,10C67,17.94,73,26.27,73,35.7Z" style="fill:#fbf0df"/><path id="Bottom_Shadow" data-name="Bottom Shadow" d="M73,35.7a21.67,21.67,0,0,0-.8-5.78c-2.73,33.3-43.35,34.9-59.32,24.94A40,40,0,0,0,38,63.24C57.3,63.24,73,50.89,73,35.7Z" style="fill:#f6dece"/><path id="Light_Shine" data-name="Light Shine" d="M24.53,11.17C29,8.49,34.94,3.46,40.78,3.45A9.29,9.29,0,0,0,38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7c0,.4,0,.8,0,1.19C9.06,15.48,20.07,13.85,24.53,11.17Z" style="fill:#fffefc"/><path id="Top" d="M35.12,5.53A16.41,16.41,0,0,1,29.49,18c-.28.25-.06.73.3.59,3.37-1.31,7.92-5.23,6-13.14C35.71,5,35.12,5.12,35.12,5.53Zm2.27,0A16.24,16.24,0,0,1,39,19c-.12.35.31.65.55.36C41.74,16.56,43.65,11,37.93,5,37.64,4.74,37.19,5.14,37.39,5.49Zm2.76-.17A16.42,16.42,0,0,1,47,17.12a.33.33,0,0,0,.65.11c.92-3.49.4-9.44-7.17-12.53C40.08,4.54,39.82,5.08,40.15,5.32ZM21.69,15.76a16.94,16.94,0,0,0,10.47-9c.18-.36.75-.22.66.18-1.73,8-7.52,9.67-11.12,9.45C21.32,16.4,21.33,15.87,21.69,15.76Z" style="fill:#ccbea7;fill-rule:evenodd"/><path id="Outline" d="M38,65.75C17.32,65.75.5,52.27.5,35.7c0-10,6.18-19.33,16.53-24.92,3-1.6,5.57-3.21,7.86-4.62,1.26-.78,2.45-1.51,3.6-2.19C32,1.89,35,.5,38,.5s5.62,1.2,8.9,3.14c1,.57,2,1.19,3.07,1.87,2.49,1.54,5.3,3.28,9,5.27C69.32,16.37,75.5,25.69,75.5,35.7,75.5,52.27,58.68,65.75,38,65.75ZM38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7,3,50.89,18.7,63.25,38,63.25S73,50.89,73,35.7C73,26.62,67.31,18.13,57.78,13,54,11,51.05,9.12,48.66,7.64c-1.09-.67-2.09-1.29-3-1.84C42.63,4,40.42,3,38,3Z"/></g><g id="Mouth"><g id="Background-2" data-name="Background"><path d="M45.05,43a8.93,8.93,0,0,1-2.92,4.71,6.81,6.81,0,0,1-4,1.88A6.84,6.84,0,0,1,34,47.71,8.93,8.93,0,0,1,31.12,43a.72.72,0,0,1,.8-.81H44.26A.72.72,0,0,1,45.05,43Z" style="fill:#b71422"/></g><g id="Tongue"><path id="Background-3" data-name="Background" d="M34,47.79a6.91,6.91,0,0,0,4.12,1.9,6.91,6.91,0,0,0,4.11-1.9,10.63,10.63,0,0,0,1-1.07,6.83,6.83,0,0,0-4.9-2.31,6.15,6.15,0,0,0-5,2.78C33.56,47.4,33.76,47.6,34,47.79Z" style="fill:#ff6164"/><path id="Outline-2" data-name="Outline" d="M34.16,47a5.36,5.36,0,0,1,4.19-2.08,6,6,0,0,1,4,1.69c.23-.25.45-.51.66-.77a7,7,0,0,0-4.71-1.93,6.36,6.36,0,0,0-4.89,2.36A9.53,9.53,0,0,0,34.16,47Z"/></g><path id="Outline-3" data-name="Outline" d="M38.09,50.19a7.42,7.42,0,0,1-4.45-2,9.52,9.52,0,0,1-3.11-5.05,1.2,1.2,0,0,1,.26-1,1.41,1.41,0,0,1,1.13-.51H44.26a1.44,1.44,0,0,1,1.13.51,1.19,1.19,0,0,1,.25,1h0a9.52,9.52,0,0,1-3.11,5.05A7.42,7.42,0,0,1,38.09,50.19Zm-6.17-7.4c-.16,0-.2.07-.21.09a8.29,8.29,0,0,0,2.73,4.37A6.23,6.23,0,0,0,38.09,49a6.28,6.28,0,0,0,3.65-1.73,8.3,8.3,0,0,0,2.72-4.37.21.21,0,0,0-.2-.09Z"/></g><g id="Face"><ellipse id="Right_Blush" data-name="Right Blush" cx="53.22" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><ellipse id="Left_Bluch" data-name="Left Bluch" cx="22.95" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><path id="Eyes" d="M25.7,38.8a5.51,5.51,0,1,0-5.5-5.51A5.51,5.51,0,0,0,25.7,38.8Zm24.77,0A5.51,5.51,0,1,0,45,33.29,5.5,5.5,0,0,0,50.47,38.8Z" style="fill-rule:evenodd"/><path id="Iris" d="M24,33.64a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,24,33.64Zm24.77,0a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,48.75,33.64Z" style="fill:#fff;fill-rule:evenodd"/></g></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
<stop stop-color="#2563EB"/>
<stop offset="1" stop-color="#7C3AED"/>
</linearGradient>
</defs>
<rect width="32" height="32" rx="7" fill="url(#g)"/>
<polyline
points="3,16 9,16 12,8 16,24 19,16 29,16"
stroke="white"
stroke-width="2.2"
stroke-linecap="round"
stroke-linejoin="round"
fill="none"
/>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 522 B