@vasto-queue/dashboard
v0.1.0
Published
Shadcn-style dashboard UI package for Vasto.
Readme
@vasto-queue/dashboard
Shadcn-style dashboard UI package for Vasto.
Purpose
This package hosts the dashboard frontend as a workspace package instead of an example-only app. It targets the Supervisor-owned dashboard APIs exposed from @vasto-queue/core.
Expected backend endpoints
The UI expects a configurable API base (default: /api/dashboard) and uses these endpoints under that base:
GET /auth/configGET /auth/sessionPOST /auth/loginPOST /auth/logoutGET /overviewGET /queuesGET /jobsGET /schedulesPOST /schedules/:scheduleId/removePOST /schedules/clearGET /workersGET /completedGET /failedGET /archiveGET /sloGET /stream(HTTP polling fallback)GET /ws(WebSocket transport)GET /scalingPOST /scalingPOST /dlq/retry
Local development
Start a worker with dashboard enabled, for example from the Redis isolation example:
cd examples/redis-isolation
DASHBOARD_ENABLED=true npm run workerThen start this UI package:
cd packages/dashboard
npm run devOpen http://localhost:4173.
If your dashboard endpoint is customized, set VITE_DASHBOARD_ENDPOINT before starting the UI. Example:
VITE_DASHBOARD_ENDPOINT=/queue-manager npm run devIf your backend runs on a non-default origin/port in local development, set VITE_API_TARGET as well. Example (Redis isolation API on port 3100):
VITE_API_TARGET=http://localhost:3100 npm run devInteractive auth
The published dashboard now renders its own login UI. Serve the static assets publicly, then protect only the API and WebSocket routes.
basicauth => username/password form posts to/auth/loginbearer+loginMode: 'token'=> token input posts to/auth/loginbearer+loginMode: 'custom'=> username/password form posts to/auth/login
On success, the backend returns the token that the dashboard should use on subsequent API and WebSocket requests.
Transport mode
By default, the dashboard uses WebSocket with automatic HTTP polling fallback.
For local development (npm run dev), you can still force polling at build/dev time:
VITE_DASHBOARD_TRANSPORT=polling npm run devFor published/built dashboard assets, prefer runtime override (no rebuild needed):
<script>
window.__VASTO_DASHBOARD_CONFIG__ = {
transport: 'polling',
};
</script>You can also use a URL override for troubleshooting: ?transport=polling.
