omniroute 1.4.5 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -8
- package/README.pt-BR.md +1 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +26 -26
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -676
- package/app/.next/required-server-files.json +4 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +4 -4
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +1 -1
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +1 -1
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +1 -1
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +1 -1
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +1 -1
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +1 -1
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +26 -26
- package/app/.next/server/chunks/1259.js +2 -0
- package/app/.next/server/chunks/1960.js +1 -0
- package/app/.next/server/chunks/1990.js +1 -0
- package/app/.next/server/chunks/2767.js +2 -2
- package/app/.next/server/chunks/2901.js +2 -2
- package/app/.next/server/chunks/3447.js +1 -1
- package/app/.next/server/chunks/3498.js +39 -0
- package/app/.next/server/chunks/3596.js +1 -1
- package/app/.next/server/chunks/3699.js +1 -1
- package/app/.next/server/chunks/{1079.js → 3875.js} +3 -1
- package/app/.next/server/chunks/4509.js +1 -0
- package/app/.next/server/chunks/5248.js +1 -1
- package/app/.next/server/chunks/5573.js +1 -1
- package/app/.next/server/chunks/7544.js +1 -1
- package/app/.next/server/chunks/7669.js +1 -3
- package/app/.next/server/chunks/8020.js +1 -1
- package/app/.next/server/chunks/9340.js +1 -0
- package/app/.next/server/chunks/9342.js +1 -1
- package/app/.next/server/chunks/9824.js +3 -3
- package/app/.next/server/instrumentation.js +1 -1
- package/app/.next/server/middleware.js +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/pages-manifest.json +0 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/3418-66271bd83bd2e66a.js +3 -0
- package/app/.next/static/chunks/5846-756d72eb0e01a60c.js +2 -0
- package/app/.next/static/chunks/{1149-fefe7f95f0e9842f.js → 6458-085536744d592424.js} +1 -1
- package/app/.next/static/chunks/993-961f6e199b93539a.js +21 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-3fcbbdb2221f0b0c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-d806e4f28c15636a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-27bc511cf3930e1e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-918d5f38d5cdbbc2.js → page-012be9f38cda4c4a.js} +4 -4
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-ede2315b6918315e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-f256689b8410bd74.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-6e4f3ca7ac9778be.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-8725f1a181e558a3.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-a5a48afa8c125ada.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-6ee69634597daee0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-931fa0c45dca76c9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-04bc41f9e9de17ef.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-62c6fceede3a5549.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-2dc2a865e90681dd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-ac85ce5066cd9044.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-88cac9e6f2fbe335.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-77158451270c1852.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-75c8b38a55e13042.js +4 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-51a813eac9d71eed.js → page-f0809c7842e4f5b4.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/layout-b23c2c5427e04dcf.js +1 -0
- package/app/.next/static/chunks/app/callback/page-e439cd5a287000d8.js +1 -0
- package/app/.next/static/chunks/app/forbidden/page-4a39fedc08aaaf55.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-057ea91c6f140e0b.js +1 -0
- package/app/.next/static/chunks/app/layout-108592eafb959363.js +1 -0
- package/app/.next/static/chunks/app/login/page-c1d7bfab91a7877c.js +1 -0
- package/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/app/package.json +2 -1
- package/app/server.js +1 -1
- package/package.json +2 -1
- package/app/.next/server/app/_not-found.html +0 -1
- package/app/.next/server/app/_not-found.meta +0 -16
- package/app/.next/server/app/_not-found.rsc +0 -23
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -4
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/callback.html +0 -1
- package/app/.next/server/app/callback.meta +0 -15
- package/app/.next/server/app/callback.rsc +0 -24
- package/app/.next/server/app/callback.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/callback.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/callback.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/callback.segments/callback.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/analytics.html +0 -2
- package/app/.next/server/app/dashboard/analytics.meta +0 -17
- package/app/.next/server/app/dashboard/analytics.rsc +0 -26
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +0 -26
- package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/api-manager.html +0 -1
- package/app/.next/server/app/dashboard/api-manager.meta +0 -17
- package/app/.next/server/app/dashboard/api-manager.rsc +0 -22
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard/api-manager/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard/api-manager.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/api-manager.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/api-manager.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/api-manager.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/api-manager.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/audit-log.html +0 -1
- package/app/.next/server/app/dashboard/audit-log.meta +0 -17
- package/app/.next/server/app/dashboard/audit-log.rsc +0 -25
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard/audit-log/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard/audit-log.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/audit-log.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/audit-log.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/audit-log.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/audit-log.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.html +0 -1
- package/app/.next/server/app/dashboard/cli-tools.meta +0 -17
- package/app/.next/server/app/dashboard/cli-tools.rsc +0 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.html +0 -1
- package/app/.next/server/app/dashboard/combos.meta +0 -17
- package/app/.next/server/app/dashboard/combos.rsc +0 -25
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/costs.html +0 -1
- package/app/.next/server/app/dashboard/costs.meta +0 -17
- package/app/.next/server/app/dashboard/costs.rsc +0 -25
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/costs.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/costs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/costs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.html +0 -1
- package/app/.next/server/app/dashboard/endpoint.meta +0 -17
- package/app/.next/server/app/dashboard/endpoint.rsc +0 -23
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/health.html +0 -1
- package/app/.next/server/app/dashboard/health.meta +0 -17
- package/app/.next/server/app/dashboard/health.rsc +0 -25
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/limits.html +0 -2
- package/app/.next/server/app/dashboard/limits.meta +0 -17
- package/app/.next/server/app/dashboard/limits.rsc +0 -25
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/limits.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/limits.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/limits.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/limits.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/logs.html +0 -1
- package/app/.next/server/app/dashboard/logs.meta +0 -17
- package/app/.next/server/app/dashboard/logs.rsc +0 -25
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/logs.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/logs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/logs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/logs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/onboarding.html +0 -1
- package/app/.next/server/app/dashboard/onboarding.meta +0 -17
- package/app/.next/server/app/dashboard/onboarding.rsc +0 -25
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.html +0 -1
- package/app/.next/server/app/dashboard/profile.meta +0 -19
- package/app/.next/server/app/dashboard/profile.rsc +0 -22
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.html +0 -2
- package/app/.next/server/app/dashboard/providers/new.meta +0 -18
- package/app/.next/server/app/dashboard/providers/new.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.html +0 -2
- package/app/.next/server/app/dashboard/providers.meta +0 -17
- package/app/.next/server/app/dashboard/providers.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings/pricing.html +0 -2
- package/app/.next/server/app/dashboard/settings/pricing.meta +0 -18
- package/app/.next/server/app/dashboard/settings/pricing.rsc +0 -27
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings.html +0 -1
- package/app/.next/server/app/dashboard/settings.meta +0 -17
- package/app/.next/server/app/dashboard/settings.rsc +0 -27
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.html +0 -19
- package/app/.next/server/app/dashboard/translator.meta +0 -17
- package/app/.next/server/app/dashboard/translator.rsc +0 -22
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.html +0 -1
- package/app/.next/server/app/dashboard/usage.meta +0 -17
- package/app/.next/server/app/dashboard/usage.rsc +0 -25
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/docs.html +0 -1
- package/app/.next/server/app/docs.meta +0 -15
- package/app/.next/server/app/docs.rsc +0 -88
- package/app/.next/server/app/docs.segments/_full.segment.rsc +0 -88
- package/app/.next/server/app/docs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/docs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/docs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +0 -67
- package/app/.next/server/app/docs.segments/docs.segment.rsc +0 -4
- package/app/.next/server/app/forbidden.html +0 -1
- package/app/.next/server/app/forbidden.meta +0 -15
- package/app/.next/server/app/forbidden.rsc +0 -24
- package/app/.next/server/app/forbidden.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/forbidden.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/forbidden.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +0 -4
- package/app/.next/server/app/forgot-password.html +0 -1
- package/app/.next/server/app/forgot-password.meta +0 -15
- package/app/.next/server/app/forgot-password.rsc +0 -24
- package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +0 -4
- package/app/.next/server/app/index.html +0 -1
- package/app/.next/server/app/index.meta +0 -16
- package/app/.next/server/app/index.rsc +0 -21
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/index.segments/_full.segment.rsc +0 -21
- package/app/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/index.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/index.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/landing.html +0 -1
- package/app/.next/server/app/landing.meta +0 -15
- package/app/.next/server/app/landing.rsc +0 -24
- package/app/.next/server/app/landing.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/landing.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/landing.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/landing.segments/landing.segment.rsc +0 -4
- package/app/.next/server/app/login.html +0 -1
- package/app/.next/server/app/login.meta +0 -15
- package/app/.next/server/app/login.rsc +0 -24
- package/app/.next/server/app/login.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/login.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/login.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/login.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/login.segments/login.segment.rsc +0 -4
- package/app/.next/server/app/privacy.html +0 -1
- package/app/.next/server/app/privacy.meta +0 -15
- package/app/.next/server/app/privacy.rsc +0 -28
- package/app/.next/server/app/privacy.segments/_full.segment.rsc +0 -28
- package/app/.next/server/app/privacy.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/privacy.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/privacy.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +0 -11
- package/app/.next/server/app/privacy.segments/privacy.segment.rsc +0 -4
- package/app/.next/server/app/terms.html +0 -1
- package/app/.next/server/app/terms.meta +0 -15
- package/app/.next/server/app/terms.rsc +0 -29
- package/app/.next/server/app/terms.segments/_full.segment.rsc +0 -29
- package/app/.next/server/app/terms.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/terms.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/terms.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +0 -7
- package/app/.next/server/app/terms.segments/terms.segment.rsc +0 -4
- package/app/.next/server/chunks/2760.js +0 -1
- package/app/.next/server/chunks/438.js +0 -1
- package/app/.next/server/chunks/9723.js +0 -37
- package/app/.next/server/chunks/9979.js +0 -2
- package/app/.next/server/pages/404.html +0 -1
- package/app/.next/static/chunks/5846-8a4d88e4bc5e07f6.js +0 -2
- package/app/.next/static/chunks/993-4cb24412f8681dc9.js +0 -21
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-f8b57e41a1b6fce6.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-10e24238da560d00.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c37f849e39b1bf02.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-f017a1a13b450ed3.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-9495b294cfe54d73.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-90f0a2f2cfc02a76.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-58ea3e55f475ea7b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-2a3cd7fd5ca34713.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-88e667cb7ae99420.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-19072ecdea202e4e.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-d2651dc387e7fdfd.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-56e8174ce9caec1b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-200bed170f9ee2b0.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-7fec684a49291104.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-06d076294b449efb.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-1b3f14c99d3edf09.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-775e1506821cac94.js +0 -4
- package/app/.next/static/chunks/app/(dashboard)/layout-cf710bbfb7c3ba11.js +0 -1
- package/app/.next/static/chunks/app/callback/page-5c58a06902dd94ed.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-86b6392f80a3ff69.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-373672767bb0aae4.js +0 -1
- package/app/.next/static/chunks/app/layout-3375493e8f9133db.js +0 -1
- package/app/.next/static/chunks/app/login/page-ca4dde4376ccd169.js +0 -1
- /package/app/.next/static/{5wRmzcux4mm_n3yTB8RLl → oaQaCPrOo77oe3OAEMAe-}/_buildManifest.js +0 -0
- /package/app/.next/static/{5wRmzcux4mm_n3yTB8RLl → oaQaCPrOo77oe3OAEMAe-}/_ssgManifest.js +0 -0
package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-f8b57e41a1b6fce6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{53701:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(95155),l=s(12115),n=s(40993),r=s(67671);let i=[{name:"contains",label:"Contains",icon:"search",color:"text-sky-400",bg:"bg-sky-500/10",description:"Checks if the response contains a specific text (case-insensitive)"},{name:"exact",label:"Exact Match",icon:"check_circle",color:"text-emerald-400",bg:"bg-emerald-500/10",description:"Response must be an exact character-for-character match"},{name:"regex",label:"Regex Pattern",icon:"code",color:"text-amber-400",bg:"bg-amber-500/10",description:"Matches response against a regular expression pattern"},{name:"custom",label:"Custom Function",icon:"tune",color:"text-violet-400",bg:"bg-violet-500/10",description:"Uses a custom function for advanced evaluation logic"}];function d(){let[e,t]=(0,l.useState)([]),[s,d]=(0,l.useState)(null),[x,o]=(0,l.useState)(!0),[m,u]=(0,l.useState)(null),[p,h]=(0,l.useState)({current:0,total:0}),[g,f]=(0,l.useState)({}),[b,j]=(0,l.useState)(""),[v,y]=(0,l.useState)(null),[N,k]=(0,l.useState)(!1),w=(0,r.i)(),C=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/evals");if(e.ok){let s=await e.json();t(Array.isArray(s)?s:s.suites||[])}}catch{}finally{o(!1)}},[]),S=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/keys");if(!e.ok)return;let t=await e.json(),s=t?.keys?.[0]?.key||null;d(s)}catch{}},[]);(0,l.useEffect)(()=>{C(),S()},[C,S]);let R=async e=>{try{let t={"Content-Type":"application/json"};s&&(t.Authorization=`Bearer ${s}`);let a=await fetch("/v1/chat/completions",{method:"POST",headers:t,body:JSON.stringify({model:e.model||"gpt-4o",messages:e.input?.messages||[],max_tokens:512,stream:!1})});if(!a.ok)return`[ERROR: HTTP ${a.status}]`;let l=await a.json();return l.choices?.[0]?.message?.content||"[No content returned]"}catch(e){return`[ERROR: ${e.message}]`}},E=async e=>{let t=e.cases||[];if(0===t.length)return void w.warning("No test cases defined for this suite");u(e.id),h({current:0,total:t.length});try{let s={};for(let e=0;e<t.length;e++){h({current:e+1,total:t.length});let a=await R(t[e]);s[t[e].id]=a}let a=await fetch("/api/evals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suiteId:e.id,outputs:s})}),l=await a.json();if(f(t=>({...t,[e.id]:l})),l.summary){let{passed:t,failed:s,total:a}=l.summary;0===s?w.success(`All ${a} cases passed ✅`,`Eval: ${e.name}`):w.warning(`${t}/${a} passed, ${s} failed`,`Eval: ${e.name}`)}y(e.id)}catch{w.error("Eval run failed")}finally{u(null),h({current:0,total:0})}},$=e.filter(e=>!b||e.name?.toLowerCase().includes(b.toLowerCase())||e.id?.toLowerCase().includes(b.toLowerCase())),M=e.reduce((e,t)=>e+(t.cases?.length||t.caseCount||0),0),L=[...new Set(e.flatMap(e=>(e.cases||[]).map(e=>e.model)).filter(Boolean))];if(x)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted p-8 animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"}),"Loading eval suites..."]});if(0===e.length)return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(c,{}),(0,a.jsx)(n.pp,{icon:"science",title:"No Eval Suites Found",description:"Eval suites can be defined via the API or in code. They test model outputs against expected results using strategies like contains, regex, exact match, and custom functions."})]});let T=[{key:"caseName",label:"Case"},{key:"status",label:"Status"},{key:"durationMs",label:"Latency"},{key:"details",label:"Details"}];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(c,{}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:"Suites"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-violet-400",children:e.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:"Test Cases"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-sky-400",children:M})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:"Models"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-emerald-400",children:L.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:"Coverage"}),(0,a.jsxs)("div",{className:"text-2xl font-bold mt-1 text-amber-400",children:[i.length," strategies"]})]})]}),(0,a.jsxs)(n.Zp,{className:"p-0 overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>k(!N),className:"w-full flex items-center justify-between px-6 py-4 hover:bg-surface/30 transition-colors text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"help"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"How It Works"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Learn how evaluations validate your LLM responses"})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted transition-transform duration-200 ${N?"rotate-180":""}`,children:"expand_more"})]}),N&&(0,a.jsxs)("div",{className:"px-6 pb-6 border-t border-border/10",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-violet-500/5 border border-violet-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-violet-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-violet-400",children:"1"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:"Define"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Create test cases with input prompts and expected output criteria using strategies like contains, regex, or exact match."})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-sky-500/5 border border-sky-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-sky-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-sky-400",children:"2"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:"Run"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Execute test cases against your LLM endpoints through OmniRoute. Each case is sent as a real API request."})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-emerald-500/5 border border-emerald-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-emerald-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-emerald-400",children:"3"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:"Evaluate"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Responses are compared against expected criteria. See pass/fail for each case with latency metrics and detailed feedback."})]})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:"Evaluation Strategies"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:i.map(e=>(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg ${e.bg} border border-transparent`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${e.color}`,children:e.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${e.color}`,children:e.name}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description})]})]},e.name))})]}),L.length>0&&(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:"Models Under Test"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:L.map(e=>(0,a.jsx)("span",{className:"px-3 py-1.5 rounded-full text-xs font-mono font-medium bg-primary/10 text-primary border border-primary/20",children:e},e))})]})]})]}),(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Evaluation Suites"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Click a suite to view test cases, then run to evaluate your LLM endpoints"})]})]}),(0,a.jsx)(n.Qn,{searchValue:b,onSearchChange:j,placeholder:"Search suites...",filters:[],activeFilters:{},onFilterChange:()=>{},children:null}),(0,a.jsx)("div",{className:"flex flex-col gap-3 mt-4",children:$.map(e=>{let t=g[e.id],s=m===e.id,l=v===e.id,r=e.cases?.length||e.caseCount||0,d=[...new Set((e.cases||[]).map(e=>e.model).filter(Boolean))];return(0,a.jsxs)("div",{className:"border border-border/30 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-surface/30 transition-colors",onClick:()=>y(l?null:e.id),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:l?"expand_more":"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name||e.id}),t?.summary&&(0,a.jsxs)("span",{className:`px-2 py-0.5 rounded-full text-xs font-semibold ${100===t.summary.passRate?"bg-emerald-500/10 text-emerald-400":t.summary.passRate>=80?"bg-amber-500/10 text-amber-400":"bg-red-500/10 text-red-400"}`,children:[t.summary.passRate,"% pass"]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[r," case",1!==r?"s":"",e.description&&(0,a.jsxs)("span",{className:"ml-1",children:["— ",e.description]})]}),d.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:d.map(e=>(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono text-text-muted bg-black/5 dark:bg-white/5",children:e},e))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s&&p.total>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-24 h-1.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-500 rounded-full transition-all duration-300",style:{width:`${p.current/p.total*100}%`}})}),(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono tabular-nums",children:[p.current,"/",p.total]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:t=>{t.stopPropagation(),E(e)},loading:s,disabled:s,children:s?`Running ${p.current}/${p.total}...`:"Run Eval"})]})]}),l&&(0,a.jsx)("div",{className:"border-t border-border/20 p-4",children:t?.results?(0,a.jsxs)(a.Fragment,{children:[t.summary&&(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4 p-3 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:`text-lg font-bold ${100===t.summary.passRate?"text-emerald-400":t.summary.passRate>=80?"text-amber-400":"text-red-400"}`,children:[t.summary.passRate,"%"]}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"pass rate"})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted",children:[t.summary.passed," passed \xb7 ",t.summary.failed," ","failed \xb7 ",t.summary.total," total"]}),(0,a.jsx)("div",{className:"flex-1 h-2 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${t.summary.passRate}%`,background:100===t.summary.passRate?"linear-gradient(90deg, #22c55e, #16a34a)":t.summary.passRate>=80?"linear-gradient(90deg, #f59e0b, #d97706)":"linear-gradient(90deg, #ef4444, #dc2626)"}})})]}),(0,a.jsx)(n.bQ,{columns:T,data:t.results.map((e,t)=>({...e,id:e.caseId||t})),renderCell:(e,t)=>{if("status"===t.key)return e.passed?(0,a.jsx)("span",{className:"text-emerald-400",children:"✅ Passed"}):(0,a.jsx)("span",{className:"text-red-400",children:"❌ Failed"});if("durationMs"===t.key)return(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono",children:null!=e.durationMs?`${e.durationMs}ms`:"—"});if("details"===t.key){let t=e.details||{};return(0,a.jsx)("span",{className:"text-text-muted text-xs truncate max-w-[300px] block",children:String(t.searchTerm?`Contains: "${t.searchTerm}"`:t.pattern?`Regex: ${t.pattern}`:t.expected?`Expected: "${String(t.expected).slice(0,50)}"`:e.error||"—")})}return(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"})},maxHeight:"400px",emptyMessage:"No results yet"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"checklist"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted font-medium",children:["Test Cases (",(e.cases||[]).length,")"]})]}),(0,a.jsx)(n.bQ,{columns:[{key:"name",label:"Case"},{key:"model",label:"Model"},{key:"strategy",label:"Strategy"},{key:"expected",label:"Expected"}],data:(e.cases||[]).map((e,t)=>({id:e.id||t,name:e.name,model:e.model||"—",strategy:e.expected?.strategy||"—",expected:e.expected?.value?String(e.expected.value).slice(0,80):"—"})),renderCell:(e,t)=>{if("strategy"===t.key){let t=i.find(t=>t.name===e.strategy);return(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${t?.color||"text-text-muted"}`,children:e.strategy})}return"model"===t.key?(0,a.jsx)("span",{className:"text-xs font-mono text-primary/80",children:e.model}):"expected"===t.key?(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono truncate max-w-[300px] block",children:e.expected}):(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"})},maxHeight:"400px",emptyMessage:"No test cases defined"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),'Click "Run Eval" to execute all cases against your LLM endpoint. Each test sends a real request through OmniRoute.']})]})})]},e.id)})})]})]})}function c(){return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsx)("div",{className:"p-6",style:{background:"linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(16, 185, 129, 0.05) 100%)"},children:(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"p-3 rounded-xl bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px]",children:"science"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-xl font-bold text-text-main mb-1",children:"Model Evaluations"}),(0,a.jsx)("p",{className:"text-sm text-text-muted leading-relaxed max-w-2xl",children:"Test and validate your LLM endpoints by running predefined evaluation suites. Each suite contains test cases that send real prompts through OmniRoute and compare responses against expected criteria — helping you detect regressions, compare models, and ensure response quality across providers."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-emerald-400",children:"verified"}),"Quality Validation"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"compare"}),"Model Comparison"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-400",children:"bug_report"}),"Regression Detection"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-violet-400",children:"speed"}),"Latency Benchmarks"]})]})]})]})})})}function x(){let[e,t]=(0,l.useState)("overview");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"analytics"}),"Analytics"]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:{overview:"Monitor your API usage patterns, token consumption, costs, and activity trends across all providers and models.",evals:"Run evaluation suites to test and validate your LLM endpoints. Compare model quality, detect regressions, and benchmark latency."}[e]})]}),(0,a.jsx)(n.Iz,{options:[{value:"overview",label:"Overview"},{value:"evals",label:"Evals"}],value:e,onChange:t}),"overview"===e&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(n.Qv,{}),children:(0,a.jsx)(n.cn,{})}),"evals"===e&&(0,a.jsx)(d,{})]})}},69589:(e,t,s)=>{Promise.resolve().then(s.bind(s,53701))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=69589)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-10e24238da560d00.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{42712:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var l=s(95155),a=s(12115),r=s(40993),i=s(30949);function n(){let[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)([]),[c,o]=(0,a.useState)(!0),[x,m]=(0,a.useState)(!1),[h,p]=(0,a.useState)(""),[u,y]=(0,a.useState)(null),[g,b]=(0,a.useState)(null),[j,f]=(0,a.useState)(!1),[N,v]=(0,a.useState)(""),[k,C]=(0,a.useState)(null),[w,S]=(0,a.useState)(!1),[A,_]=(0,a.useState)({}),{copied:$,copy:K}=(0,i.C)();(0,a.useEffect)(()=>{E(),P()},[]);let P=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let t=await e.json();n(t.data||[])}}catch(e){console.log("Error fetching models:",e)}},E=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();t(s.keys||[]),I(s.keys||[])}}catch(e){console.log("Error fetching keys:",e)}finally{o(!1)}},I=async e=>{if(0!==e.length)try{let t=await fetch("/api/usage/call-logs?limit=1000");if(!t.ok)return;let s=await t.json(),l={};for(let t of e){let e=(s||[]).filter(e=>e.apiKeyId===t.id||e.apiKeyName===t.name);l[t.id]={totalRequests:e.length,lastUsed:e.length>0?e.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime())[0]?.timestamp:null}}_(l)}catch(e){console.log("Error fetching usage stats:",e)}},M=(0,a.useCallback)(()=>C(null),[]),T=async()=>{let e=h.replace(/[<>]/g,"").replace(/"/g,"").replace(/'/g,"").trim().slice(0,100),t=e&&e.trim()?e.length>100?{valid:!1,error:"Key name must be 100 characters or less"}:/^[a-zA-Z0-9_\-\s]+$/.test(e)?{valid:!0}:{valid:!1,error:"Key name can only contain letters, numbers, spaces, hyphens, and underscores"}:{valid:!1,error:"Key name is required"};if(!t.valid)return void C(t.error||"Invalid key name");S(!0),M();try{let t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})}),s=await t.json();t.ok?(y(s.key),await E(),p(""),m(!1)):C(s.error||"Failed to create key")}catch(e){console.error("Error creating key:",e),C("Failed to create key. Please try again.")}finally{S(!1)}},O=async e=>{if(!e||"string"!=typeof e||!/^[a-zA-Z0-9_-]+$/.test(e))return void C("Invalid key ID");if(confirm("Delete this API key?")){S(!0),M();try{let s=await fetch(`/api/keys/${encodeURIComponent(e)}`,{method:"DELETE"});if(s.ok)t(t=>t.filter(t=>t.id!==e));else{let e=await s.json();C(e.error||"Failed to delete key")}}catch(e){console.error("Error deleting key:",e),C("Failed to delete key. Please try again.")}finally{S(!1)}}},D=e=>{e&&e.id&&(b(e),f(!0))},F=async e=>{if(!g||!g.id)return;if(!Array.isArray(e))return void C("Invalid models selection");if(e.length>500)return void C("Cannot select more than 500 models");let t=e.filter(e=>"string"==typeof e&&e.length>0&&e.length<200);S(!0),M();try{let e=await fetch(`/api/keys/${encodeURIComponent(g.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedModels:t})});if(e.ok)await E(),f(!1),b(null);else{let t=await e.json();C(t.error||"Failed to update permissions")}}catch(e){console.error("Error updating permissions:",e),C("Failed to update permissions. Please try again.")}finally{S(!1)}},R=function(e,t){let[s,l]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=setTimeout(()=>l(e),150);return()=>clearTimeout(t)},[e,150]),s}(N,0),z=(0,a.useMemo)(()=>{let e={};for(let t of s){let s=t.owned_by||"unknown";e[s]||(e[s]=[]),e[s].push(t)}return Object.entries(e).sort((e,t)=>e[0].localeCompare(t[0]))},[s]),U=(0,a.useMemo)(()=>{if(!R.trim())return z;let e=R.toLowerCase();return z.map(([t,s])=>[t,s.filter(s=>s.id.toLowerCase().includes(e)||t.toLowerCase().includes(e))]).filter(([,e])=>e.length>0)},[z,R]);return c?(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(r.Qv,{}),(0,l.jsx)(r.Qv,{})]}):(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[k&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"error"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300 flex-1",children:k}),(0,l.jsx)("button",{onClick:M,className:"text-red-500 hover:text-red-700 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),e.length>0&&(0,l.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-primary/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-lg",children:"vpn_key"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:e.length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Total Keys"})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-amber-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-amber-500 text-lg",children:"lock"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:e.filter(e=>Array.isArray(e.allowedModels)&&e.allowedModels.length>0).length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Restricted"})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-blue-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"bar_chart"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:Object.values(A).reduce((e,t)=>e+t.totalRequests,0)}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Total Requests"})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-emerald-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-lg",children:"model_training"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:s.length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Models Available"})]})]})})]}),(0,l.jsx)(r.Zp,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Key Management"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Create and manage API keys for authenticating requests to your endpoint"})]}),(0,l.jsx)(r.$n,{icon:"add",onClick:()=>m(!0),children:"Create Key"})]})}),(0,l.jsxs)(r.Zp,{children:[(0,l.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-amber-500/10 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-amber-500",children:"vpn_key"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold",children:"Registered Keys"}),(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:[e.length," ",1===e.length?"key":"keys"," registered"]})]})]})}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Each key isolates usage tracking and can be revoked independently. Keys are masked after creation for security."}),0===e.length?(0,l.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-lg",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-2",children:"No API keys yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to authenticate requests to your endpoint"}),(0,l.jsx)(r.$n,{icon:"add",onClick:()=>m(!0),children:"Create Your First Key"})]}):(0,l.jsxs)("div",{className:"flex flex-col border border-border rounded-lg overflow-hidden",children:[(0,l.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 bg-surface/50 border-b border-border text-xs font-semibold text-text-muted uppercase tracking-wider",children:[(0,l.jsx)("div",{className:"col-span-2",children:"Name"}),(0,l.jsx)("div",{className:"col-span-3",children:"Key"}),(0,l.jsx)("div",{className:"col-span-2",children:"Permissions"}),(0,l.jsx)("div",{className:"col-span-2",children:"Usage"}),(0,l.jsx)("div",{className:"col-span-1",children:"Created"}),(0,l.jsx)("div",{className:"col-span-2 text-right",children:"Actions"})]}),e.map(e=>{let t=A[e.id],s=Array.isArray(e.allowedModels)&&e.allowedModels.length>0;return(0,l.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 hover:bg-surface/30 transition-colors group",children:[(0,l.jsxs)("div",{className:"col-span-2 flex items-center gap-2",children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-sm ${s?"text-amber-500":"text-emerald-500"}`,children:s?"lock":"lock_open"}),(0,l.jsx)("span",{className:"text-sm font-medium truncate",title:e.name,children:e.name})]}),(0,l.jsxs)("div",{className:"col-span-3 flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"text-sm text-text-muted font-mono truncate",children:e.key}),(0,l.jsx)("button",{onClick:()=>K(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all shrink-0",title:"Copy masked key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:$===e.id?"check":"content_copy"})})]}),(0,l.jsx)("div",{className:"col-span-2 flex items-center",children:s?(0,l.jsxs)("button",{onClick:()=>D(e),className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400 text-xs font-medium hover:bg-amber-500/20 transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"lock"}),e.allowedModels.length," ",1===e.allowedModels.length?"model":"models"]}):(0,l.jsxs)("button",{onClick:()=>D(e),className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-green-500/10 text-green-600 dark:text-green-400 text-xs font-medium hover:bg-green-500/20 transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"lock_open"}),"All models"]})}),(0,l.jsxs)("div",{className:"col-span-2 flex flex-col justify-center",children:[(0,l.jsxs)("span",{className:"text-sm font-medium tabular-nums",children:[t?.totalRequests??0," ",(0,l.jsx)("span",{className:"text-text-muted font-normal text-xs",children:"reqs"})]}),t?.lastUsed?(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["Last: ",new Date(t.lastUsed).toLocaleDateString()]}):(0,l.jsx)("span",{className:"text-[10px] text-text-muted italic",children:"Never used"})]}),(0,l.jsx)("div",{className:"col-span-1 flex items-center text-sm text-text-muted",children:new Date(e.createdAt).toLocaleDateString()}),(0,l.jsxs)("div",{className:"col-span-2 flex items-center justify-end gap-1",children:[(0,l.jsx)("button",{onClick:()=>D(e),className:"p-2 hover:bg-primary/10 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:"Edit permissions",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,l.jsx)("button",{onClick:()=>O(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",title:"Delete key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})]})]}),(0,l.jsx)(r.Zp,{children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-blue-500/10 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-blue-500",children:"lightbulb"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold mb-2",children:"Usage Tips"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted space-y-1.5",children:[(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsxs)("span",{children:["Use API keys in the"," ",(0,l.jsx)("code",{className:"text-xs bg-surface px-1.5 py-0.5 rounded",children:"Authorization"})," ","header as"," ",(0,l.jsx)("code",{className:"text-xs bg-surface px-1.5 py-0.5 rounded",children:"Bearer YOUR_KEY"})]})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:"Keys are only shown once during creation — store them securely"})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:"Create separate keys for different clients or environments"})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:"Restrict keys to specific models for better security and cost control"})]})]})]})]})}),(0,l.jsx)(r.aF,{isOpen:x,title:"Create API Key",onClose:()=>{m(!1),p("")},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium text-text-main mb-1.5 block",children:"Key Name"}),(0,l.jsx)(r.pd,{value:h,onChange:e=>p(e.target.value),placeholder:"e.g., Production Key, Development Key",autoFocus:!0}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-1.5",children:"Choose a descriptive name to identify this key's purpose"})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.$n,{onClick:()=>{m(!1),p("")},variant:"ghost",fullWidth:!0,children:"Cancel"}),(0,l.jsx)(r.$n,{onClick:T,fullWidth:!0,disabled:!h.trim(),children:"Create Key"})]})]})}),(0,l.jsx)(r.aF,{isOpen:!!u,title:"API Key Created",onClose:()=>y(null),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium mb-1",children:"Key created successfully!"}),(0,l.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"Copy and store this key now — it won't be shown again."})]})]})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.pd,{value:u||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,l.jsx)(r.$n,{variant:"secondary",icon:"created_key"===$?"check":"content_copy",onClick:()=>K(u,"created_key"),children:"created_key"===$?"Copied!":"Copy"})]}),(0,l.jsx)(r.$n,{onClick:()=>y(null),fullWidth:!0,children:"Done"})]})}),g&&(0,l.jsx)(d,{isOpen:j,onClose:()=>{f(!1),b(null)},apiKey:g,modelsByProvider:U,allModels:s,searchModel:N,onSearchChange:v,onSave:F},g.id)]})}let d=(0,a.memo)(function({isOpen:e,onClose:t,apiKey:s,modelsByProvider:i,allModels:n,searchModel:d,onSearchChange:c,onSave:o}){let x=Array.isArray(s?.allowedModels)?s.allowedModels:[],[m,h]=(0,a.useState)(x),[p,u]=(0,a.useState)(0===x.length),[y,g]=(0,a.useState)(()=>x.length>0?new Set(i.map(([e])=>e)):new Set),b=(0,a.useCallback)(e=>{p||h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[p]),j=(0,a.useCallback)((e,t)=>{if(p)return;let s=t.map(e=>e.id);h(e=>s.every(t=>e.includes(t))?e.filter(e=>!s.includes(e)):[...new Set([...e,...s])])},[p]),f=(0,a.useCallback)(()=>{u(!0),h([])},[]),N=(0,a.useCallback)(()=>{u(!1),g(new Set(i.map(([e])=>e)))},[i]),v=(0,a.useCallback)(e=>{g(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),k=(0,a.useCallback)(()=>{h(n.map(e=>e.id))},[n]),C=(0,a.useCallback)(()=>{h([])},[]),w=(0,a.useCallback)(()=>{o(p?[]:m)},[o,p,m]);(0,a.useCallback)(()=>{c("")},[c]);let S=m.length,A=n.length;return(0,l.jsx)(r.aF,{isOpen:!!t&&e,title:`Permissions: ${s?.name||""}`,onClose:t,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex gap-2 p-1 bg-surface rounded-lg",children:[(0,l.jsxs)("button",{onClick:f,className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all ${p?"bg-primary text-white":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_open"}),"Allow All"]}),(0,l.jsxs)("button",{onClick:N,className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all ${!p?"bg-primary text-white":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock"}),"Restrict"]})]}),(0,l.jsxs)("div",{className:`flex items-start gap-2 p-3 rounded-lg ${p?"bg-green-500/10 border border-green-500/30":"bg-amber-500/10 border border-amber-500/30"}`,children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-[18px] ${p?"text-green-500":"text-amber-500"}`,children:p?"info":"warning"}),(0,l.jsx)("p",{className:`text-xs ${p?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:p?"This key can access all available models.":`This key can access ${S} of ${A} models.`})]}),!p&&S>0&&(0,l.jsxs)("div",{className:"flex flex-col gap-1.5 p-2 bg-primary/5 rounded-lg border border-primary/20",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("span",{className:"text-xs font-medium text-primary",children:[S," selected"]}),(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)("button",{onClick:k,className:"text-[10px] text-primary hover:bg-primary/10 px-1.5 py-0.5 rounded transition-colors",children:"All"}),(0,l.jsx)("button",{onClick:C,className:"text-[10px] text-red-500 hover:bg-red-500/10 px-1.5 py-0.5 rounded transition-colors",children:"Clear"})]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto content-start",children:m.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-white dark:bg-surface text-text-main text-[10px] rounded border border-border",children:[(0,l.jsx)("span",{className:"font-mono truncate max-w-[120px]",title:e,children:e}),(0,l.jsx)("button",{onClick:()=>b(e),className:"text-text-muted hover:text-red-500 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))})]}),!p&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(r.pd,{value:d,onChange:e=>c(e.target.value),placeholder:"Search models by name or provider...",icon:"search"}),d&&(0,l.jsx)("button",{onClick:()=>c(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,l.jsx)("div",{className:"max-h-[280px] overflow-y-auto border border-border rounded-lg divide-y divide-border",children:0===i.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-6 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1",children:"search_off"}),(0,l.jsx)("p",{className:"text-xs",children:"No models found"})]}):i.map(([e,t])=>{let s=m.filter(e=>t.some(t=>t.id===e)).length,a=t.every(e=>m.includes(e.id)),r=s>0&&!a;return(0,l.jsxs)("div",{className:"group",children:[(0,l.jsxs)("button",{onClick:()=>v(e),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-surface/50 transition-colors text-left",children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-base transition-transform duration-200 ${y.has(e)?"rotate-90":""}`,children:"chevron_right"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"relative flex items-center cursor-pointer shrink-0",onClick:s=>{s.stopPropagation(),j(e,t)},children:(0,l.jsxs)("div",{className:`w-4 h-4 rounded border-2 transition-colors flex items-center justify-center ${a?"bg-primary border-primary":r?"bg-primary/20 border-primary":"border-border hover:border-primary/50"}`,children:[a&&(0,l.jsx)("span",{className:"material-symbols-outlined text-white text-[12px]",children:"check"}),r&&!a&&(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[12px]",children:"remove"})]})}),(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main truncate",children:e}),(0,l.jsx)("span",{className:"text-[10px] text-text-muted bg-surface px-1 py-0.5 rounded shrink-0",children:t.length})]}),s>0&&(0,l.jsx)("span",{className:"text-[10px] font-medium text-primary bg-primary/10 px-1.5 py-0.5 rounded-full shrink-0",children:s})]}),y.has(e)&&(0,l.jsx)("div",{className:"px-3 pb-2 pl-9",children:(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map(e=>{let t=m.includes(e.id);return(0,l.jsx)("button",{onClick:()=>b(e.id),className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-[10px] font-mono transition-all ${t?"bg-primary text-white":"bg-surface border border-border text-text-muted hover:border-primary/50 hover:text-text-main"}`,title:e.id,children:e.id},e.id)})})})]},e)})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.$n,{onClick:w,fullWidth:!0,children:"Save Permissions"}),(0,l.jsx)(r.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})})},57018:(e,t,s)=>{Promise.resolve().then(s.bind(s,42712))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=57018)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c37f849e39b1bf02.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6782],{29698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var o=r(95155),a=r(12115);function l(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[s,c]=(0,a.useState)(null),[d,n]=(0,a.useState)(""),[i,x]=(0,a.useState)(""),[u,m]=(0,a.useState)(0),[b,p]=(0,a.useState)(!1),h=(0,a.useCallback)(async()=>{l(!0),c(null);try{let e=new URLSearchParams;d&&e.set("action",d),i&&e.set("actor",i),e.set("limit",String(26)),e.set("offset",String(u));let r=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let o=await r.json();p(o.length>25),t(o.slice(0,25))}catch(e){c(e.message||"Failed to fetch audit log")}finally{l(!1)}},[d,i,u]);(0,a.useEffect)(()=>{h()},[h]);let v=()=>{m(0),h()};return(0,o.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"text-2xl font-bold text-[var(--color-text-main)]",children:"Audit Log"}),(0,o.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:"Administrative actions and security events"})]}),(0,o.jsx)("button",{onClick:h,disabled:r,"aria-label":"Refresh audit log",className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:r?"Loading...":"Refresh"})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":"Filter audit log entries",children:[(0,o.jsx)("input",{type:"text",placeholder:"Filter by action...",value:d,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&v(),"aria-label":"Filter by action type",className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,o.jsx)("input",{type:"text",placeholder:"Filter by actor...",value:i,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&v(),"aria-label":"Filter by actor",className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,o.jsx)("button",{onClick:v,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:"Search"})]}),s&&(0,o.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:s}),(0,o.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,o.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":"Audit log entries",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Timestamp"}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Action"}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Actor"}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Target"}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Details"}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"IP"})]})}),(0,o.jsx)("tbody",{children:0!==e.length||r?e.map(e=>{var t;return(0,o.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,o.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(e.timestamp)}),(0,o.jsx)("td",{className:"px-4 py-3",children:(0,o.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(t=e.action).includes("delete")||t.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":t.includes("create")||t.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":t.includes("update")||t.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":t.includes("login")||t.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:e.action})}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:e.actor}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:e.target||"—"}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:e.details?JSON.stringify(e.details):"—"}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:e.ip_address||"—"})]},e.id)}):(0,o.jsx)("tr",{children:(0,o.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:"No audit log entries found"})})})]})}),(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",e.length," entries (offset ",u,")"]}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)("button",{onClick:()=>m(Math.max(0,u-25)),disabled:0===u,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:"← Previous"}),(0,o.jsx)("button",{onClick:()=>m(u+25),disabled:!b,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:"Next →"})]})]})]})}},61265:(e,t,r)=>{Promise.resolve().then(r.bind(r,29698))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=61265)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{2729:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(95155),r=s(12115),l=s(40993),o=s(30949),i=s(67671);let n=/^[a-zA-Z0-9_/.-]+$/;function d(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function c(){let[e,t]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0),[d,c]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),[b,g]=(0,r.useState)([]),[f,y]=(0,r.useState)({}),[v,j]=(0,r.useState)(null),[N,k]=(0,r.useState)(null),{copied:w,copy:C}=(0,o.C)(),S=(0,i.i)(),[$,M]=(0,r.useState)(null),[T,_]=(0,r.useState)(null);(0,r.useEffect)(()=>{P(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>_(e)).catch(()=>{})},[]);let P=async()=>{try{let[e,s,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics")]),r=await e.json(),l=await s.json(),o=await a.json();if(e.ok&&t(r.combos||[]),s.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);g(e)}a.ok&&y(o.metrics||{})}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},E=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await P(),c(!1),S.success("Combo created successfully");else{let e=await t.json();S.error(e.error?.message||e.error||"Failed to create combo")}}catch(e){S.error("Error creating combo")}},O=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await P(),h(null),S.success("Combo updated successfully");else{let e=await s.json();S.error(e.error?.message||e.error||"Failed to update combo")}}catch(e){S.error("Error updating combo")}},D=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&(t(e.filter(e=>e.id!==s)),S.success("Combo deleted"))}catch(e){S.error("Error deleting combo")}},R=async t=>{let s=t.name.replace(/-copy(-\d+)?$/,""),a=e.map(e=>e.name),r=`${s}-copy`,l=1;for(;a.includes(r);)l++,r=`${s}-copy-${l}`;let o={name:r,models:t.models,strategy:t.strategy||"priority",config:t.config||{}};await E(o)},q=async e=>{k(e.name),j(null);try{let t=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:e.name})}),s=await t.json();j(s)}catch(e){j({error:"Test request failed"}),S.error("Test request failed")}},A=async e=>{let s=!1===e.isActive;t(t=>t.map(t=>t.id===e.id?{...t,isActive:s}:t));try{await fetch(`/api/combos/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})}catch(a){t(t=>t.map(t=>t.id===e.id?{...t,isActive:!s}:t)),S.error("Failed to toggle combo")}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.Qv,{}),(0,a.jsx)(l.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with weighted routing and fallback support"})]}),(0,a.jsx)(l.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:"No combos yet",description:"Create model combos with weighted routing and fallback support",actionLabel:"Create Combo",onAction:()=>c(!0)}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(m,{combo:e,metrics:f[e.name],copied:w,onCopy:C,onEdit:()=>h(e),onDelete:()=>D(e.id),onDuplicate:()=>R(e),onTest:()=>q(e),testing:N===e.name,onProxy:()=>M(e),hasProxy:!!T?.combos?.[e.id],onToggle:()=>A(e)},e.id))}),v&&(0,a.jsx)(l.aF,{isOpen:!!v,onClose:()=>{j(null),k(null)},title:`Test Results — ${N}`,children:(0,a.jsx)(x,{results:v})}),(0,a.jsx)(u,{isOpen:d,onClose:()=>c(!1),onSave:E,activeProviders:b,combo:null},"create"),(0,a.jsx)(u,{isOpen:!!p,combo:p,onClose:()=>h(null),onSave:e=>O(p.id,e),activeProviders:b},p?.id||"new"),$&&(0,a.jsx)(l.KN,{isOpen:!!$,onClose:()=>M(null),level:"combo",levelId:$.id,levelLabel:$.name})]})}function m({combo:e,metrics:t,copied:s,onCopy:r,onEdit:o,onDelete:i,onDuplicate:n,onTest:c,testing:m,onProxy:x,hasProxy:u,onToggle:p}){let h=e.strategy||"priority",b=e.models||[],g=!1===e.isActive;return(0,a.jsx)(l.Zp,{padding:"sm",className:`group ${g?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===h?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===h?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===h?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===h?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===h?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:h}),u&&(0,a.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:"Proxy configured",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===b.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):b.slice(0,3).map((e,t)=>{let{model:s,weight:r}=d(e);return(0,a.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[s,"weighted"===h&&r>0?` (${r}%)`:""]},t)}),b.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",b.length-3," more"]})]}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," reqs"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% success"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,a.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,a.jsx)(l.lM,{size:"sm",checked:!g,onChange:p,title:g?"Enable combo":"Disable combo"}),(0,a.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:"Test combo",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${m?"animate-spin":""}`,children:m?"progress_activity":"play_arrow"})}),(0,a.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Duplicate",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Proxy configuration",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,a.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:i,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})]})})}function x({results:e}){return e.error?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,a.jsxs)("span",{children:["Resolved by:"," ",(0,a.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,a.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function u({isOpen:e,combo:t,onClose:s,onSave:o,activeProviders:i}){let[c,m]=(0,r.useState)(t?.name||""),[x,u]=(0,r.useState)(()=>(t?.models||[]).map(e=>d(e))),[h,b]=(0,r.useState)(t?.strategy||"priority"),[g,f]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(""),[k,w]=(0,r.useState)({}),[C,S]=(0,r.useState)([]),[$,M]=(0,r.useState)(!1),[T,_]=(0,r.useState)(t?.config||{}),[P,E]=(0,r.useState)(null),[O,D]=(0,r.useState)(null),R=async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let[s,a]=await Promise.all([e.json(),t.json()]);w(s.aliases||{}),S(a.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&R()},[e]);let q=e=>e.trim()?n.test(e)?(N(""),!0):(N("Only letters, numbers, -, _, / and . allowed"),!1):(N("Name is required"),!1),A=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[s,a]=t,r=C.find(e=>e.id===s||e.prefix===s);return r?`${r.name}/${a}`:e},[C]),z=e=>{e.target&&(e.currentTarget.style.opacity="1"),E(null),D(null)},F=async()=>{if(!q(c))return;v(!0);let e={name:c.trim(),models:"weighted"===h?x:x.map(e=>e.model),strategy:h},t={...T};"round-robin"===h&&(void 0!==T.concurrencyPerModel&&(t.concurrencyPerModel=T.concurrencyPerModel),void 0!==T.queueTimeoutMs&&(t.queueTimeoutMs=T.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await o(e),v(!1)},L=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.aF,{isOpen:e,onClose:s,title:L?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.pd,{label:"Combo Name",value:c,onChange:e=>{let t=e.target.value;m(t),t?q(t):N("")},placeholder:"my-combo",error:j}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Letters, numbers, -, _, / and . allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Routing Strategy"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:[{value:"priority",label:"Priority",icon:"sort"},{value:"weighted",label:"Weighted",icon:"percent"},{value:"round-robin",label:"Round-Robin",icon:"autorenew"},{value:"random",label:"Random",icon:"shuffle"},{value:"least-used",label:"Least-Used",icon:"low_priority"},{value:"cost-optimized",label:"Cost-Opt",icon:"savings"}].map(e=>(0,a.jsxs)("button",{onClick:()=>b(e.value),className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${h===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),e.label]},e.value))}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:{priority:"Sequential fallback: tries model 1 first, then 2, etc.",weighted:"Distributes traffic by weight percentage with fallback","round-robin":"Circular distribution: each request goes to the next model in rotation",random:"Uniform random selection, then fallback to remaining models","least-used":"Picks the model with fewest requests, balancing load over time","cost-optimized":"Routes to the cheapest model first based on pricing"}[h]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Models"}),"weighted"===h&&x.length>1&&(0,a.jsx)("button",{onClick:()=>{let e=x.length;if(0===e)return;let t=Math.floor(100/e),s=100-t*e;u(x.map((e,a)=>({...e,weight:t+(0===a?s:0)})))},className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:"Auto-balance"})]}),0===x.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:x.map((e,t)=>(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{E(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.currentTarget.style.opacity="0.5",0)},onDragEnd:z,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",D(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===P||P===t)return;let s=[...x],[a]=s.splice(P,1);s.splice(t,0,a),u(s),E(null),D(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${O===t&&P!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${P===t?"opacity-50":""}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:A(e.model)}),"weighted"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,a.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var s;let a;return s=e.target.value,void((a=[...x])[t]={...a[t],weight:Math.max(0,Math.min(100,Number(s)||0))},u(a))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...x];[t[e-1],t[e]]=[t[e],t[e-1]],u(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:()=>(e=>{if(e===x.length-1)return;let t=[...x];[t[e],t[e+1]]=[t[e+1],t[e]],u(t)})(t),disabled:t===x.length-1,className:`p-0.5 rounded ${t===x.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:()=>{u(x.filter((e,s)=>s!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===h&&x.length>0&&(0,a.jsx)(p,{models:x}),(0,a.jsxs)("button",{onClick:()=>f(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("button",{onClick:()=>M(!$),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:$?"expand_less":"expand_more"}),"Advanced Settings"]}),$&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Max Retries"}),(0,a.jsx)("input",{type:"number",min:"0",max:"10",value:T.maxRetries??"",placeholder:"1",onChange:e=>_({...T,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Retry Delay (ms)"}),(0,a.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:T.retryDelayMs??"",placeholder:"2000",onChange:e=>_({...T,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:T.timeoutMs??"",placeholder:"120000",onChange:e=>_({...T,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted",children:"Healthcheck"}),(0,a.jsx)("input",{type:"checkbox",checked:!1!==T.healthCheckEnabled,onChange:e=>_({...T,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===h&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Concurrency / Model"}),(0,a.jsx)("input",{type:"number",min:"1",max:"20",value:T.concurrencyPerModel??"",placeholder:"3",onChange:e=>_({...T,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Queue Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:T.queueTimeoutMs??"",placeholder:"30000",onChange:e=>_({...T,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted",children:"Leave empty to use global defaults. These override per-provider settings."})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(l.$n,{onClick:F,fullWidth:!0,size:"sm",disabled:!c.trim()||!!j||y,children:y?"Saving...":L?"Save":"Create"})]})]})}),(0,a.jsx)(l.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{x.find(t=>t.model===e.value)||u([...x,{model:e.value,weight:0}])},activeProviders:i,modelAliases:k,title:"Add Model to Combo",selectedModel:null})]})}function p({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),s=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,a.jsxs)("div",{className:"mt-1.5",children:[(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,a.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,a.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,a.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,a.jsxs)("span",{className:`text-[10px] font-medium ${s?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!s&&t>0&&" ≠ 100%"]})]})]})}},7762:(e,t,s)=>{Promise.resolve().then(s.bind(s,2729))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=7762)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3700],{14031:(e,t,s)=>{Promise.resolve().then(s.bind(s,70595))},70595:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(95155),l=s(12115),i=s(40993),r=s(67671);function n({value:e,max:t,warningAt:s=.8}){let l=t>0?Math.min(e/t*100,100):0,i=t>0?e/t:0;return(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs mb-1",children:[(0,a.jsxs)("span",{className:"text-text-muted",children:["$",e.toFixed(2)]}),(0,a.jsxs)("span",{className:"text-text-muted",children:["$",t.toFixed(2)]})]}),(0,a.jsx)("div",{className:"w-full h-2 rounded-full bg-surface/50 overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${l}%`,backgroundColor:i>=1?"#ef4444":i>=s?"#f59e0b":"#22c55e"}})})]})}function d(){let[e,t]=(0,l.useState)([]),[s,d]=(0,l.useState)(null),[o,c]=(0,l.useState)(null),[m,x]=(0,l.useState)(!0),[u,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)({dailyLimitUsd:"",monthlyLimitUsd:"",warningThreshold:"80"}),b=(0,r.i)();(0,l.useEffect)(()=>{fetch("/api/keys").then(e=>e.json()).then(e=>{let s=Array.isArray(e)?e:e.keys||[];t(s),s.length>0&&d(s[0].id),x(!1)}).catch(()=>x(!1))},[]);let f=(0,l.useCallback)(async()=>{if(s)try{let e=await fetch(`/api/usage/budget?apiKeyId=${s}`);if(e.ok){let t=await e.json();c(t),t.dailyLimitUsd&&g(e=>({...e,dailyLimitUsd:String(t.dailyLimitUsd)})),t.monthlyLimitUsd&&g(e=>({...e,monthlyLimitUsd:String(t.monthlyLimitUsd)})),t.warningThreshold&&g(e=>({...e,warningThreshold:String(t.warningThreshold)}))}}catch{}},[s]);(0,l.useEffect)(()=>{f()},[f]);let j=async()=>{p(!0);try{(await fetch("/api/usage/budget",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyId:s,dailyLimitUsd:h.dailyLimitUsd?parseFloat(h.dailyLimitUsd):null,monthlyLimitUsd:h.monthlyLimitUsd?parseFloat(h.monthlyLimitUsd):null,warningThreshold:parseInt(h.warningThreshold)||80})})).ok?(b.success("Budget limits saved"),await f()):b.error("Failed to save budget")}catch{b.error("Failed to save budget")}finally{p(!1)}};if(m)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted p-8 animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"account_balance_wallet"}),"Loading budget data..."]});if(0===e.length)return(0,a.jsx)(i.pp,{icon:"vpn_key",title:"No API Keys",description:"Add API keys first to set up budget limits."});let y=o?.dailyLimitUsd||parseFloat(h.dailyLimitUsd)||0,v=o?.monthlyLimitUsd||parseFloat(h.monthlyLimitUsd)||0,N=o?.totalCostToday||0,w=o?.totalCostMonth||0,C=(parseInt(h.warningThreshold)||80)/100;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"account_balance_wallet"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Budget Management"})]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("select",{value:s||"",onChange:e=>d(e.target.value),className:"w-full md:w-auto px-3 py-2 rounded-lg border border-border/50 bg-surface/30 text-text-main text-sm focus:outline-none focus:ring-1 focus:ring-primary",children:e.map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.name||e.id," ",e.provider?`(${e.provider})`:""]},e.id))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"p-4 rounded-lg border border-border/30 bg-surface/20",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-2",children:"Today's Spend"}),(0,a.jsxs)("p",{className:"text-2xl font-bold text-text-main",children:["$",N.toFixed(2)]}),y>0&&(0,a.jsx)(n,{value:N,max:y,warningAt:C})]}),(0,a.jsxs)("div",{className:"p-4 rounded-lg border border-border/30 bg-surface/20",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-2",children:"This Month"}),(0,a.jsxs)("p",{className:"text-2xl font-bold text-text-main",children:["$",w.toFixed(2)]}),v>0&&(0,a.jsx)(n,{value:w,max:v,warningAt:C})]})]}),(0,a.jsxs)("div",{className:"border-t border-border/30 pt-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:"Set Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[(0,a.jsx)(i.pd,{label:"Daily Limit (USD)",type:"number",step:"0.01",min:"0",placeholder:"e.g. 5.00",value:h.dailyLimitUsd,onChange:e=>g({...h,dailyLimitUsd:e.target.value})}),(0,a.jsx)(i.pd,{label:"Monthly Limit (USD)",type:"number",step:"0.01",min:"0",placeholder:"e.g. 50.00",value:h.monthlyLimitUsd,onChange:e=>g({...h,monthlyLimitUsd:e.target.value})}),(0,a.jsx)(i.pd,{label:"Warning Threshold (%)",type:"number",min:"1",max:"100",placeholder:"80",value:h.warningThreshold,onChange:e=>g({...h,warningThreshold:e.target.value})})]}),(0,a.jsx)(i.$n,{variant:"primary",onClick:j,loading:u,children:"Save Limits"})]})]}),o?.budgetCheck&&(0,a.jsx)(i.Zp,{className:"p-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",style:{color:o.budgetCheck.allowed?"#22c55e":"#ef4444"},children:o.budgetCheck.allowed?"check_circle":"block"}),(0,a.jsx)("span",{className:"text-sm",children:o.budgetCheck.allowed?`Budget OK — $${(o.budgetCheck.remaining||0).toFixed(2)} remaining`:"Budget exceeded — requests may be blocked"})]})})]})}let o=["input","output","cached","reasoning","cache_creation"],c={input:"Input",output:"Output",cached:"Cached",reasoning:"Reasoning",cache_creation:"Cache Write"};function m(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[n,d]=(0,l.useState)(!0),[o,c]=(0,l.useState)(!1),[m,u]=(0,l.useState)(""),[p,h]=(0,l.useState)(null),[g,b]=(0,l.useState)(new Set),[f,j]=(0,l.useState)(""),[y,v]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{N()},[]);let N=async()=>{d(!0);try{let[e,s]=await Promise.all([fetch("/api/pricing/models"),fetch("/api/pricing")]);e.ok&&t(await e.json()),s.ok&&r(await s.json())}catch(e){console.error("Failed to load pricing data:",e)}finally{d(!1)}},w=(0,l.useMemo)(()=>Object.entries(e).map(([e,t])=>({alias:e,...t,pricedModels:s[e]?Object.keys(s[e]).length:0})).sort((e,t)=>t.modelCount-e.modelCount),[e,s]),C=(0,l.useMemo)(()=>{if(!f.trim())return w;let e=f.toLowerCase();return w.filter(t=>t.alias.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.models.some(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)))},[w,f]),k=(0,l.useMemo)(()=>{let e=w.reduce((e,t)=>e+t.modelCount,0),t=Object.values(s).reduce((e,t)=>e+Object.keys(t).length,0);return{providers:w.length,totalModels:e,pricedCount:t}},[w,s]),S=(0,l.useCallback)(e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),L=(0,l.useCallback)((e,t,s,a)=>{let l=parseFloat(a);isNaN(l)||l<0||(r(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={input:0,output:0,cached:0,reasoning:0,cache_creation:0}),i[e][t]={...i[e][t],[s]:l},i}),v(t=>new Set(t).add(e)))},[]),U=(0,l.useCallback)(async e=>{c(!0),u("");try{let t=s[e]||{},a=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})});if(a.ok)u(`✅ ${e.toUpperCase()} saved`),v(t=>{let s=new Set(t);return s.delete(e),s}),setTimeout(()=>u(""),3e3);else{let e=await a.json();u(`❌ Error: ${e.error}`)}}catch(e){u(`❌ Save failed: ${e.message}`)}finally{c(!1)}},[s]),T=(0,l.useCallback)(async e=>{if(confirm(`Reset all pricing for ${e.toUpperCase()} to defaults?`))try{let t=await fetch(`/api/pricing?provider=${e}`,{method:"DELETE"});if(t.ok){let s=await t.json();r(s),u(`🔄 ${e.toUpperCase()} reset to defaults`),v(t=>{let s=new Set(t);return s.delete(e),s}),setTimeout(()=>u(""),3e3)}}catch(e){u(`❌ Reset failed: ${e.message}`)}},[]),$=(0,l.useCallback)(e=>{h(t=>t===e?null:e)},[]),_=(0,l.useMemo)(()=>p?C.filter(e=>e.alias===p):C,[C,p]);return n?(0,a.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,a.jsx)("div",{className:"text-text-muted animate-pulse",children:"Loading pricing data..."})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between flex-wrap gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-bold",children:"Model Pricing"}),(0,a.jsxs)("p",{className:"text-text-muted text-sm mt-1",children:["Configure cost rates per model • All rates in"," ",(0,a.jsx)("strong",{children:"$/1M tokens"})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 text-sm",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Providers"}),(0,a.jsx)("div",{className:"text-lg font-bold",children:k.providers})]}),(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Registry"}),(0,a.jsx)("div",{className:"text-lg font-bold",children:k.totalModels})]}),(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Priced"}),(0,a.jsx)("div",{className:"text-lg font-bold text-success",children:k.pricedCount})]})]})]}),m&&(0,a.jsx)("div",{className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm",children:m}),(0,a.jsxs)("div",{className:"flex gap-3 items-center flex-wrap",children:[(0,a.jsxs)("div",{className:"relative flex-1 min-w-[200px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-lg",children:"search"}),(0,a.jsx)("input",{type:"text",placeholder:"Search providers or models...",value:f,onChange:e=>j(e.target.value),className:"w-full pl-10 pr-3 py-2 bg-bg-base border border-border rounded-lg focus:outline-none focus:border-primary text-sm"})]}),p&&(0,a.jsxs)("button",{onClick:()=>h(null),className:"px-3 py-2 text-xs bg-primary/10 text-primary border border-primary/20 rounded-lg hover:bg-primary/20 transition-colors flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"}),p.toUpperCase()," — Show All"]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:w.map(e=>(0,a.jsxs)("button",{onClick:()=>$(e.alias),className:`px-2.5 py-1 rounded-md text-xs font-medium transition-all ${p===e.alias?"bg-primary text-white shadow-sm":y.has(e.alias)?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-bg-subtle text-text-muted hover:bg-bg-hover border border-transparent"}`,children:[e.alias.toUpperCase()," ",(0,a.jsxs)("span",{className:"opacity-60",children:["(",e.modelCount,")"]})]},e.alias))}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[_.map(e=>(0,a.jsx)(x,{provider:e,pricingData:s[e.alias]||{},isExpanded:g.has(e.alias),isEdited:y.has(e.alias),onToggle:()=>S(e.alias),onPricingChange:(t,s,a)=>L(e.alias,t,s,a),onSave:()=>U(e.alias),onReset:()=>T(e.alias),saving:o},e.alias)),0===_.length&&(0,a.jsx)("div",{className:"text-center py-12 text-text-muted",children:"No providers match your search."})]}),(0,a.jsxs)(i.Zp,{className:"p-4 mt-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm align-middle mr-1",children:"info"}),"How Pricing Works"]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted space-y-1",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Input"}),": tokens sent to the model •"," ",(0,a.jsx)("strong",{children:"Output"}),": tokens generated •"," ",(0,a.jsx)("strong",{children:"Cached"}),": reused input (~50% of input rate) •"," ",(0,a.jsx)("strong",{children:"Reasoning"}),": thinking tokens (falls back to Output) •"," ",(0,a.jsx)("strong",{children:"Cache Write"}),": creating cache entries (falls back to Input)"]}),(0,a.jsx)("p",{children:"Cost = (input \xd7 input_rate) + (output \xd7 output_rate) + (cached \xd7 cached_rate) per million tokens."})]})]})]})}function x({provider:e,pricingData:t,isExpanded:s,isEdited:l,onToggle:i,onPricingChange:r,onSave:n,onReset:d,saving:m}){let x=Object.keys(t).length,p="oauth"===e.authType?"OAuth":"apikey"===e.authType?"API Key":e.authType;return(0,a.jsxs)("div",{className:`border rounded-lg overflow-hidden transition-colors ${l?"border-yellow-500/40 bg-yellow-500/5":"border-border"}`,children:[(0,a.jsxs)("button",{onClick:i,className:"w-full flex items-center justify-between px-4 py-3 hover:bg-bg-hover/50 transition-colors text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg transition-transform ${s?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold text-sm",children:e.id.charAt(0).toUpperCase()+e.id.slice(1)}),(0,a.jsxs)("span",{className:"text-text-muted text-xs ml-2",children:["(",e.alias.toUpperCase(),")"]})]}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-bg-subtle text-text-muted text-[10px] rounded uppercase font-semibold",children:p}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-bg-subtle text-text-muted text-[10px] rounded uppercase font-semibold",children:e.format})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,a.jsx)("span",{className:"text-yellow-500 text-xs font-medium",children:"unsaved"}),(0,a.jsxs)("span",{className:"text-text-muted text-xs",children:[x,"/",e.modelCount," priced"]}),(0,a.jsx)("div",{className:"w-16 h-1.5 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${e.modelCount>0?Math.round(x/e.modelCount*100):0}%`}})})]})]}),s&&(0,a.jsxs)("div",{className:"border-t border-border",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-bg-subtle/50",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.modelCount," models •"," ",x," with pricing configured"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),d()},className:"px-2.5 py-1 text-[11px] text-red-400 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",children:"Reset Defaults"}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},disabled:m||!l,className:"px-2.5 py-1 text-[11px] bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-40",children:m?"Saving...":"Save Provider"})]})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"text-[11px] text-text-muted uppercase bg-bg-subtle/30",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left font-semibold",children:"Model"}),o.map(e=>(0,a.jsx)("th",{className:"px-2 py-2 text-right font-semibold w-24",children:c[e]},e))]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border/50",children:e.models.map(e=>(0,a.jsx)(u,{model:e,pricing:t[e.id],onPricingChange:(t,s)=>r(e.id,t,s)},e.id))})]})})]})]})}function u({model:e,pricing:t,onPricingChange:s}){let l=t&&Object.values(t).some(e=>e>0);return(0,a.jsxs)("tr",{className:"hover:bg-bg-hover/30 group",children:[(0,a.jsx)("td",{className:"px-4 py-1.5",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l?"bg-success":"bg-text-muted/30"}`}),(0,a.jsx)("span",{className:"font-medium text-xs",children:e.name}),e.custom&&(0,a.jsx)("span",{className:"px-1 py-0.5 text-[8px] font-bold bg-blue-500/15 text-blue-400 border border-blue-500/20 rounded uppercase",children:"custom"}),(0,a.jsx)("span",{className:"text-text-muted text-[10px] opacity-0 group-hover:opacity-100 transition-opacity",children:e.id})]})}),o.map(e=>(0,a.jsx)("td",{className:"px-2 py-1.5",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:t?.[e]||0,onChange:t=>s(e,t.target.value),className:"w-full px-2 py-1 text-right text-xs bg-transparent border border-transparent hover:border-border focus:border-primary focus:bg-bg-base rounded transition-colors outline-none tabular-nums"})},e))]})}function p(){let[e,t]=(0,l.useState)("budget");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(i.Iz,{options:[{value:"budget",label:"Budget"},{value:"pricing",label:"Pricing"}],value:e,onChange:t}),"budget"===e&&(0,a.jsx)(d,{}),"pricing"===e&&(0,a.jsx)(m,{})]})}}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=14031)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{10373:(e,t,s)=>{Promise.resolve().then(s.bind(s,40877))},40877:(e,t,s)=>{"use strict";s.d(t,{default:()=>x});var r=s(95155),i=s(12115),a=s(14051),l=s.n(a),n=s(40993),o=s(30949),d=s(20909);let c=s(41463).env.NEXT_PUBLIC_CLOUD_URL,m=15e3;function x({machineId:e}){let[t,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!0),[x,g]=(0,i.useState)([]),[h,b]=(0,i.useState)(null),[y,f]=(0,i.useState)(!1),[j,v]=(0,i.useState)(!1),[N,w]=(0,i.useState)(!1),[C,k]=(0,i.useState)(!1),[S,_]=(0,i.useState)(null),[T,E]=(0,i.useState)(""),[$,R]=(0,i.useState)(!1),[q,A]=(0,i.useState)(null),{copied:O,copy:U}=(0,o.C)();(0,i.useEffect)(()=>{F(),D(),P()},[]);let P=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let t=await e.json();g(t.data||[])}}catch(e){console.log("Error fetching models:",e)}},B=(0,i.useMemo)(()=>{let e=x.filter(e=>!e.type&&!e.parent),t=x.filter(e=>"embedding"===e.type&&!e.parent),s=x.filter(e=>"image"===e.type&&!e.parent),r=x.filter(e=>"rerank"===e.type&&!e.parent),i=x.filter(e=>"audio"===e.type&&"transcription"===e.subtype&&!e.parent);return{chat:e,embeddings:t,images:s,rerank:r,audioTranscription:i,audioSpeech:x.filter(e=>"audio"===e.type&&"speech"===e.subtype&&!e.parent),moderation:x.filter(e=>"moderation"===e.type&&!e.parent)}},[x]);(0,i.useMemo)(()=>Object.entries(d.Q2).map(([e,s])=>{let r=t.filter(t=>t.provider===e),i=r.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,a=r.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length;return{id:e,provider:s,total:r.length,connected:i,errors:a}}),[t]);let I=async(e,t=m)=>{let s=new AbortController,r=setTimeout(()=>s.abort(),t);try{let t=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e}),signal:s.signal}),r=await t.json().catch(()=>({}));return{ok:t.ok,status:t.status,data:r}}catch(e){if(e?.name==="AbortError")return{ok:!1,status:408,data:{error:"Cloud request timeout"}};return{ok:!1,status:500,data:{error:e.message||"Cloud request failed"}}}finally{clearTimeout(r)}},D=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();f(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},F=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&s(t.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{l(!1)}},M=e=>{e?v(!0):w(!0)};(0,i.useEffect)(()=>{if(S){let e=setTimeout(()=>_(null),5e3);return()=>clearTimeout(e)}},[S]);let W=()=>{globalThis.dispatchEvent(new Event("cloud-status-changed"))},z=async()=>{k(!0),R(!1),E("syncing");try{let{ok:e,status:t,data:s}=await I("enable");if(e)E("verifying"),await new Promise(e=>setTimeout(e,600)),f(!0),E("done"),R(!0),k(!1),W(),await new Promise(e=>setTimeout(e,1200)),v(!1),R(!1),s.verified?_({type:"success",message:"Cloud Proxy connected and verified!"}):_({type:"warning",message:s.verifyError?`Connected — verification pending: ${s.verifyError}`:"Connected — verification pending"}),s.createdKey&&await F(),await D();else{let e=s.error||"Failed to enable cloud";(502===t||408===t)&&(e="Could not reach cloud worker. Make sure the cloud service is running (npm run dev in /cloud)."),_({type:"error",message:e}),v(!1)}}catch(e){_({type:"error",message:e.message||"Connection failed"}),v(!1)}finally{k(!1),E("")}},L=async()=>{k(!0),E("syncing");try{await I("sync"),E("disabling");let{ok:e,data:t}=await I("disable");e?(f(!1),_({type:"success",message:"Cloud disabled successfully"}),w(!1),W(),await D()):_({type:"error",message:t.error||"Failed to disable cloud"})}catch(e){console.log("Error disabling cloud:",e),_({type:"error",message:"Failed to disable cloud"})}finally{k(!1),E("")}},[Q,G]=(0,i.useState)("/v1"),V=`${c}/v1`;if((0,i.useEffect)(()=>{G(`${window.location.origin}/v1`)},[]),a)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let Z=y?V:Q;return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsxs)(n.Zp,{className:"",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:y?"Using Cloud Proxy":"Using Local Server"}),e&&(0,r.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Machine ID: ",e.slice(0,8),"..."]})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:y?(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>M(!1),disabled:C,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Cloud"}):(0,r.jsx)(n.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>M(!0),disabled:C,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:"Enable Cloud"})})]}),S&&(0,r.jsxs)("div",{className:`flex items-center gap-2 px-4 py-2.5 rounded-lg mb-4 text-sm font-medium animate-in fade-in slide-in-from-top-2 duration-300 ${"success"===S.type?"bg-green-500/10 border border-green-500/30 text-green-400":"warning"===S.type?"bg-amber-500/10 border border-amber-500/30 text-amber-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"success"===S.type?"check_circle":"warning"===S.type?"warning":"error"}),(0,r.jsx)("span",{className:"flex-1",children:S.message}),(0,r.jsx)("button",{onClick:()=>_(null),className:"p-0.5 hover:bg-white/10 rounded transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,r.jsx)(n.pd,{value:Z,readOnly:!0,className:`flex-1 font-mono text-sm ${y?"animate-border-glow":""}`}),(0,r.jsx)(n.$n,{variant:"secondary",icon:"endpoint_url"===O?"check":"content_copy",onClick:()=>U(Z,"endpoint_url"),children:"endpoint_url"===O?"Copied!":"Copy"})]})]}),(0,r.jsxs)(n.Zp,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Available Endpoints"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:[Object.values(B).reduce((e,t)=>e+t.length,0)," models across"," ",[B.chat,B.embeddings,B.images,B.rerank,B.audioTranscription,B.audioSpeech,B.moderation].filter(e=>e.length>0).length," ","endpoints"]})]})}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(u,{icon:"chat",iconColor:"text-blue-500",iconBg:"bg-blue-500/10",title:"Chat Completions",path:"/v1/chat/completions",description:"Streaming & non-streaming chat with all providers",models:B.chat,expanded:"chat"===h,onToggle:()=>b("chat"===h?null:"chat"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"data_array",iconColor:"text-emerald-500",iconBg:"bg-emerald-500/10",title:"Embeddings",path:"/v1/embeddings",description:"Text embeddings for search & RAG pipelines",models:B.embeddings,expanded:"embeddings"===h,onToggle:()=>b("embeddings"===h?null:"embeddings"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"image",iconColor:"text-purple-500",iconBg:"bg-purple-500/10",title:"Image Generation",path:"/v1/images/generations",description:"Generate images from text prompts",models:B.images,expanded:"images"===h,onToggle:()=>b("images"===h?null:"images"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"sort",iconColor:"text-amber-500",iconBg:"bg-amber-500/10",title:"Rerank",path:"/v1/rerank",description:"Rerank documents by relevance to a query",models:B.rerank,expanded:"rerank"===h,onToggle:()=>b("rerank"===h?null:"rerank"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"mic",iconColor:"text-rose-500",iconBg:"bg-rose-500/10",title:"Audio Transcription",path:"/v1/audio/transcriptions",description:"Transcribe audio files to text (Whisper)",models:B.audioTranscription,expanded:"audioTranscription"===h,onToggle:()=>b("audioTranscription"===h?null:"audioTranscription"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"record_voice_over",iconColor:"text-cyan-500",iconBg:"bg-cyan-500/10",title:"Text to Speech",path:"/v1/audio/speech",description:"Convert text to natural-sounding speech",models:B.audioSpeech,expanded:"audioSpeech"===h,onToggle:()=>b("audioSpeech"===h?null:"audioSpeech"),copy:U,copied:O,baseUrl:Z}),(0,r.jsx)(u,{icon:"shield",iconColor:"text-orange-500",iconBg:"bg-orange-500/10",title:"Moderations",path:"/v1/moderations",description:"Content moderation and safety classification",models:B.moderation,expanded:"moderation"===h,onToggle:()=>b("moderation"===h?null:"moderation"),copy:U,copied:O,baseUrl:Z})]})]}),!1,(0,r.jsx)(n.aF,{isOpen:j,title:"Enable Cloud Proxy",onClose:()=>v(!1),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:"What you will get"}),(0,r.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,r.jsx)("li",{children:"• Access your API from anywhere in the world"}),(0,r.jsx)("li",{children:"• Share endpoint with your team easily"}),(0,r.jsx)("li",{children:"• No need to open ports or configure firewall"}),(0,r.jsx)("li",{children:"• Fast global edge network"})]})]}),(0,r.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,r.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Note"}),(0,r.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,r.jsx)("li",{children:"• Cloud will keep your auth session for 1 day. If not used, it will be automatically deleted."}),(0,r.jsx)("li",{children:"• Cloud is currently unstable with Claude Code OAuth in some cases."})]})]}),(C||$)&&(0,r.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border transition-all duration-300 ${$?"bg-green-500/10 border-green-500/30":"bg-primary/10 border-primary/30"}`,children:[$?(0,r.jsx)("span",{className:"material-symbols-outlined text-green-500 text-xl",children:"check_circle"}):(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)("p",{className:`text-sm font-medium ${$?"text-green-500":"text-primary"}`,children:[$&&"Cloud Proxy connected!",!$&&"syncing"===T&&"Connecting to cloud...",!$&&"verifying"===T&&"Verifying connection..."]})})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:z,fullWidth:!0,disabled:C||$,children:C?(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===T?"Connecting...":"Verifying..."]}):$?(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"}),"Connected!"]}):"Enable Cloud"}),(0,r.jsx)(n.$n,{onClick:()=>v(!1),variant:"ghost",fullWidth:!0,disabled:C||$,children:"Cancel"})]})]})}),(0,r.jsx)(n.aF,{isOpen:N,title:"Disable Cloud Proxy",onClose:()=>!C&&w(!1),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,r.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"All auth sessions will be deleted from cloud."})]})]})}),C&&(0,r.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===T&&"Syncing latest data...","disabling"===T&&"Disabling cloud..."]})})]}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable cloud proxy?"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:L,fullWidth:!0,disabled:C,className:"bg-red-500! hover:bg-red-600! text-white!",children:C?(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===T?"Syncing...":"Disabling..."]}):"Disable Cloud"}),(0,r.jsx)(n.$n,{onClick:()=>w(!1),variant:"ghost",fullWidth:!0,disabled:C,children:"Cancel"})]})]})}),q&&(0,r.jsx)(p,{provider:q,models:x,copy:U,copied:O,onClose:()=>A(null)})]})}function p({provider:e,models:t,copy:s,copied:a,onClose:l}){let o=e.provider.alias||e.id,d=(0,i.useMemo)(()=>t.filter(t=>!t.parent&&(t.owned_by===o||t.owned_by===e.id)),[t,o,e.id]),c=d.filter(e=>!e.type),m=d.filter(e=>"embedding"===e.type),x=d.filter(e=>"image"===e.type),p=(e,t,i)=>0===i.length?null:(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:t}),e," (",i.length,")"]}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:i.map(e=>{let t=`modal-${e.id}`;return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface/60 group",children:[(0,r.jsx)("code",{className:"text-sm font-mono flex-1 truncate",children:e.id}),e.custom&&(0,r.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:"custom"}),(0,r.jsx)("button",{onClick:()=>s(e.id,t),className:"p-1 hover:bg-sidebar rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy model ID",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===t?"check":"content_copy"})})]},e.id)})})]});return(0,r.jsx)(n.aF,{isOpen:!0,onClose:l,title:`${e.provider.name} — Models`,children:(0,r.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:0===d.length?(0,r.jsx)("p",{className:"text-sm text-text-muted py-4 text-center",children:"No models available for this provider."}):(0,r.jsxs)(r.Fragment,{children:[p("Chat","chat",c),p("Embedding","data_array",m),p("Image","image",x)]})})})}function u({icon:e,iconColor:t,iconBg:s,title:a,path:l,description:n,models:o,expanded:c,onToggle:m,copy:x,copied:p,baseUrl:u}){let g=(0,i.useMemo)(()=>{let e={};for(let t of o){let s=t.owned_by||"unknown";e[s]||(e[s]=[]),e[s].push(t)}return Object.entries(e).sort((e,t)=>t[1].length-e[1].length)},[o]),h=e=>d.Q2[e]||(0,d.zt)(e),b=`endpoint_${l}`;return(0,r.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,r.jsxs)("button",{onClick:m,className:"w-full flex items-center gap-3 p-4 hover:bg-surface/50 transition-colors text-left",children:[(0,r.jsx)("div",{className:`flex items-center justify-center size-10 rounded-lg ${s} shrink-0`,children:(0,r.jsx)("span",{className:`material-symbols-outlined text-xl ${t}`,children:e})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-semibold text-sm",children:a}),(0,r.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-surface text-text-muted font-medium",children:[o.length," ",1===o.length?"model":"models"]})]}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:n})]}),(0,r.jsx)("span",{className:`material-symbols-outlined text-text-muted text-lg transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,r.jsxs)("div",{className:"border-t border-border px-4 pb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-3 mb-3",children:[(0,r.jsxs)("code",{className:"flex-1 text-xs font-mono text-text-muted bg-surface/80 px-3 py-1.5 rounded-lg truncate",children:[u.replace(/\/v1$/,""),l]}),(0,r.jsx)("button",{onClick:()=>x(`${u.replace(/\/v1$/,"")}${l}`,b),className:"p-1.5 hover:bg-surface rounded-lg text-text-muted hover:text-primary transition-colors shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:p===b?"check":"content_copy"})})]}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:g.map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,r.jsx)("div",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:h(e)?.color||"#888"}}),(0,r.jsx)("span",{className:"text-xs font-semibold text-text-main",children:h(e)?.name||e}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["(",t.length,")"]})]}),(0,r.jsx)("div",{className:"ml-5 flex flex-wrap gap-1.5",children:t.map(e=>(0,r.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-md bg-surface/80 text-text-muted font-mono",title:e.id,children:e.root||e.id.split("/").pop()},e.id))})]},e))})]})]})}x.propTypes={machineId:l().string.isRequired},p.propTypes={provider:l().object.isRequired,models:l().array.isRequired,copy:l().func.isRequired,copied:l().string,onClose:l().func.isRequired},u.propTypes={icon:l().string.isRequired,iconColor:l().string.isRequired,iconBg:l().string.isRequired,title:l().string.isRequired,path:l().string.isRequired,description:l().string.isRequired,models:l().array.isRequired,expanded:l().bool.isRequired,onToggle:l().func.isRequired,copy:l().func.isRequired,copied:l().string,baseUrl:l().string.isRequired}}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=10373)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{32424:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(95155),l=s(12115),r=s(40993),i=s(20909);function n(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}let c={CLOSED:{bg:"bg-green-500/10",text:"text-green-500",label:"Healthy"},OPEN:{bg:"bg-red-500/10",text:"text-red-500",label:"Open"},HALF_OPEN:{bg:"bg-amber-500/10",text:"text-amber-500",label:"Half-Open"}};function x(){var e;let t,s,x,d,m,o,[h,p]=(0,l.useState)(null),[u,j]=(0,l.useState)(null),[b,N]=(0,l.useState)(null),[g,f]=(0,l.useState)(null),[y,v]=(0,l.useState)(null),[w,$]=(0,l.useState)(null),[k,S]=(0,l.useState)(!1),C=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/monitoring/health");if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();p(t),j(null),N(new Date)}catch(e){j(e.message)}},[]),O=(0,l.useCallback)(async()=>{let e=await Promise.allSettled([fetch("/api/telemetry/summary").then(e=>e.json()),fetch("/api/cache/stats").then(e=>e.json()),fetch("/api/rate-limits").then(e=>e.json())]);"fulfilled"===e[0].status&&f(e[0].value),"fulfilled"===e[1].status&&v(e[1].value),"fulfilled"===e[2].status&&e[2].value.cacheStats&&$(e[2].value.cacheStats)},[]);(0,l.useEffect)(()=>{C(),O();let e=setInterval(()=>{C(),O()},15e3);return()=>clearInterval(e)},[C,O]);let E=async()=>{if(confirm("Reset all circuit breakers to healthy state? This will clear all failure counts and restore all providers to operational status.")){S(!0);try{let e=await fetch("/api/monitoring/health",{method:"DELETE"});if(!e.ok)throw Error(`HTTP ${e.status}`);await C(),await O()}catch(e){console.error("Failed to reset health:",e)}finally{S(!1)}}},L=e=>null!=e?`${Math.round(e)}ms`:"—";if(!h&&!u)return(0,a.jsx)("div",{className:"p-6 flex items-center justify-center min-h-[400px]",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading health data..."})]})});if(u&&!h)return(0,a.jsx)("div",{className:"p-6",children:(0,a.jsxs)("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-6 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2",children:"error"}),(0,a.jsxs)("p",{className:"text-red-400",children:["Failed to load health data: ",u]}),(0,a.jsx)("button",{onClick:C,className:"mt-4 px-4 py-2 rounded-lg bg-primary/10 text-primary text-sm hover:bg-primary/20 transition-colors",children:"Retry"})]})});let{system:R,providerHealth:D,rateLimitStatus:_,lockouts:z}=h,F=Object.entries(D||{}),T=Object.entries(z||{});return(0,a.jsxs)("div",{className:"p-6 space-y-6 max-w-6xl mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"System Health"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Real-time monitoring of your OmniRoute instance"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[b&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Updated ",b.toLocaleTimeString()]}),(0,a.jsx)("button",{onClick:()=>{C(),O()},className:"p-2 rounded-lg bg-surface hover:bg-surface/80 text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"})})]})]}),(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:`rounded-xl p-4 flex items-center gap-3 ${"healthy"===h.status?"bg-green-500/10 border border-green-500/20":"bg-red-500/10 border border-red-500/20"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${"healthy"===h.status?"text-green-500":"text-red-500"}`,children:"healthy"===h.status?"check_circle":"error"}),(0,a.jsx)("span",{className:"healthy"===h.status?"text-green-400":"text-red-400",children:"healthy"===h.status?"All systems operational":"System issues detected"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"timer"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Uptime"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:(t=Math.floor((e=R.uptime)/86400),s=Math.floor(e%86400/3600),x=Math.floor(e%3600/60),t>0?`${t}d ${s}h ${x}m`:s>0?`${s}h ${x}m`:`${x}m`)})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"info"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Version"})]}),(0,a.jsxs)("p",{className:"text-xl font-semibold text-text-main",children:["v",R.version]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Node ",R.nodeVersion]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"memory"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Memory (RSS)"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:n(R.memoryUsage?.rss||0)}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Heap: ",n(R.memoryUsage?.heapUsed||0)," /"," ",n(R.memoryUsage?.heapTotal||0)]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Providers"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:F.length}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[F.filter(([,e])=>"CLOSED"===e.state).length," healthy"]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"speed"}),"Latency"]}),g?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p50"}),(0,a.jsx)("span",{className:"font-mono",children:L(g.p50)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p95"}),(0,a.jsx)("span",{className:"font-mono",children:L(g.p95)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p99"}),(0,a.jsx)("span",{className:"font-mono",children:L(g.p99)})]}),(0,a.jsxs)("div",{className:"flex justify-between border-t border-border pt-2 mt-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Total requests"}),(0,a.jsx)("span",{className:"font-mono",children:g.totalRequests??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"cached"}),"Prompt Cache"]}),y?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Entries"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.size,"/",y.maxSize]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hits / Misses"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.hits??0," / ",y.misses??0]})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"database"}),"Signature Cache"]}),w?(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Defaults",value:w.defaultCount,color:"text-text-muted"},{label:"Tool",value:`${w.tool.entries}/${w.tool.patterns}`,color:"text-blue-400"},{label:"Family",value:`${w.family.entries}/${w.family.patterns}`,color:"text-purple-400"},{label:"Session",value:`${w.session.entries}/${w.session.patterns}`,color:"text-cyan-400"}].map(({label:e,value:t,color:s})=>(0,a.jsxs)("div",{className:"text-center p-2 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:`text-lg font-bold tabular-nums ${s}`,children:t}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e})]},e))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]})]}),(0,a.jsxs)(r.Zp,{className:"p-5",role:"region","aria-label":"Provider health status",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-primary",children:"health_and_safety"}),"Provider Health"]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[F.some(([,e])=>"CLOSED"!==e.state)&&(0,a.jsx)("button",{onClick:E,disabled:k,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all ${k?"bg-surface/50 text-text-muted cursor-wait":"bg-red-500/10 text-red-400 hover:bg-red-500/20 hover:text-red-300 border border-red-500/20"}`,title:"Reset all circuit breakers to healthy state",children:k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] animate-spin",children:"progress_activity"}),"Resetting..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"}),"Reset All"]})}),F.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," Healthy"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," Recovering"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," Down"]})]})]})]}),0===F.length?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-4",children:"No circuit breaker data available. Make some requests first."}):(d=F.filter(([,e])=>"CLOSED"!==e.state),m=F.filter(([,e])=>"CLOSED"===e.state),(0,a.jsxs)("div",{className:"space-y-4",children:[d.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-red-400 uppercase tracking-wide",children:"Issues Detected"}),d.map(([e,t])=>{let s=c[t.state]||c.OPEN,l=i.Q2[e],r=l?.name||e;return(0,a.jsxs)("div",{className:`rounded-lg p-3 ${s.bg} border border-white/5 flex items-center gap-3`,children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0 text-xs font-bold",style:{backgroundColor:`${l?.color||"#888"}15`,color:l?.color||"#888"},children:l?.textIcon||e.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:r}),(0,a.jsx)("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded ${s.bg} ${s.text}`,children:s.label})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted mt-0.5",children:[t.failures," failure",1!==t.failures?"s":"",t.lastFailure&&(0,a.jsxs)("span",{className:"ml-2",children:["\xb7 Last: ",new Date(t.lastFailure).toLocaleTimeString()]})]})]})]},e)})]}),m.length>0&&(0,a.jsxs)("div",{children:[d.length>0&&(0,a.jsx)("p",{className:"text-xs font-medium text-green-400 uppercase tracking-wide mb-2",children:"Operational"}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-2",children:m.map(([e])=>{let t=i.Q2[e],s=t?.name||e;return(0,a.jsxs)("div",{className:"rounded-lg p-2.5 bg-green-500/5 border border-white/5 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500 shrink-0"}),(0,a.jsx)("span",{className:"text-xs font-medium text-text-main truncate",title:s,children:s})]},e)})})]})]}))]}),_&&Object.keys(_).length>0&&((o=Object.entries(_).map(([e,t])=>({key:e,...(e=>{let t,s=e.split(":"),a=s[0],l=s[1]||"",r=s.slice(2).join(":")||null,n=i.Q2[a];if(a.startsWith("openai-compatible-")){let e=a.replace("openai-compatible-","");t="OpenAI Compatible",n={color:"#10A37F",textIcon:"OC"},e.length>12?t+=` (${e.slice(0,8)}…)`:e&&(t+=` (${e})`)}else if(a.startsWith("anthropic-compatible-")){let e=a.replace("anthropic-compatible-","");t="Anthropic Compatible",n={color:"#D97757",textIcon:"AC"},e.length>12?t+=` (${e.slice(0,8)}…)`:e&&(t+=` (${e})`)}else t=n?.name||a;return{providerId:a,displayName:t,providerInfo:n,connectionId:l,model:r}})(e),status:t}))).sort((e,t)=>{let s=(e.status.queued||0)+(e.status.running||0),a=(t.status.queued||0)+(t.status.running||0);return s!==a?a-s:e.displayName.localeCompare(t.displayName)}),(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500",children:"speed"}),"Rate Limit Status"]}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[o.length," active limiter",1!==o.length?"s":""]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:o.map(({key:e,displayName:t,providerInfo:s,connectionId:l,model:r,status:i})=>{let n=(i.queued||0)+(i.running||0)>0,c=(i.queued||0)>0;return(0,a.jsxs)("div",{className:`rounded-lg p-3 border transition-colors ${c?"bg-amber-500/5 border-amber-500/20":n?"bg-blue-500/5 border-blue-500/15":"bg-surface/30 border-white/5"}`,title:e,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 mb-2",children:[(0,a.jsx)("div",{className:"size-7 rounded-md flex items-center justify-center shrink-0 text-[10px] font-bold",style:{backgroundColor:`${s?.color||"#888"}15`,color:s?.color||"#888"},children:s?.textIcon||t.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main truncate",children:t}),l&&(0,a.jsxs)("p",{className:"text-[10px] text-text-muted font-mono truncate",children:[l.length>12?l.slice(0,8)+"…":l,r&&(0,a.jsxs)("span",{className:"ml-1 text-text-muted/60",children:["\xb7 ",r]})]})]}),(0,a.jsx)("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold ${c?"bg-amber-500/15 text-amber-400":n?"bg-blue-500/15 text-blue-400":"bg-green-500/10 text-green-400"}`,children:c?"Queued":n?"Active":"OK"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),i.queued||0," queued"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"play_arrow"}),i.running||0," running"]})]})]},e)})})]})),T.length>0&&(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-red-500",children:"lock"}),"Active Lockouts"]}),(0,a.jsx)("div",{className:"space-y-2",children:T.map(([e,t])=>(0,a.jsxs)("div",{className:"rounded-lg p-3 bg-red-500/5 border border-red-500/10 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e}),t.reason&&(0,a.jsxs)("span",{className:"text-xs text-text-muted ml-2",children:["(",t.reason,")"]})]}),t.until&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["Until ",new Date(t.until).toLocaleTimeString()]})]},e))})]})]})}},39449:(e,t,s)=>{Promise.resolve().then(s.bind(s,32424))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=39449)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1066],{39387:(e,t,s)=>{Promise.resolve().then(s.bind(s,73732))},73732:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var a=s(95155),r=s(12115),l=s(40993),n=s(5772),i=s(35144);function c(e){let t="string"==typeof e?e.trim():"";if(!t)return{key:"unknown",label:"Unknown",variant:"default",rank:0,raw:null};let s=t.toUpperCase();return s.includes("ENTERPRISE")||s.includes("CORP")||s.includes("ORG")?{key:"enterprise",label:"Enterprise",variant:"info",rank:7,raw:t}:s.includes("TEAM")||s.includes("CHATGPTTEAM")?{key:"team",label:"Team",variant:"info",rank:6,raw:t}:s.includes("BUSINESS")||s.includes("STANDARD")||s.includes("BIZ")?{key:"business",label:"Business",variant:"warning",rank:5,raw:t}:s.includes("ULTRA")?{key:"ultra",label:"Ultra",variant:"success",rank:4,raw:t}:s.includes("PRO")||s.includes("PLUS")||s.includes("PREMIUM")||s.includes("PAID")?{key:"pro",label:"Pro",variant:"primary",rank:3,raw:t}:s.includes("FREE")||s.includes("INDIVIDUAL")||s.includes("BASIC")||s.includes("TRIAL")||s.includes("LEGACY")?{key:"free",label:"Free",variant:"default",rank:1,raw:t}:{key:"unknown",label:t.toLowerCase().split(/[\s_-]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||"Unknown",variant:"default",rank:0,raw:t}}var o=s(81060),d=s(80927),x=s(92542),u=s(20909);let m={antigravity:{label:"Antigravity",color:"#F59E0B"},github:{label:"GitHub Copilot",color:"#333"},kiro:{label:"Kiro AI",color:"#FF6B35"},codex:{label:"OpenAI Codex",color:"#10A37F"},claude:{label:"Claude Code",color:"#D97757"}},p=[{key:"all",label:"All"},{key:"enterprise",label:"Enterprise"},{key:"team",label:"Team"},{key:"business",label:"Business"},{key:"ultra",label:"Ultra"},{key:"pro",label:"Pro"},{key:"free",label:"Free"},{key:"unknown",label:"Unknown"}];function h(){let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)({}),[h,f]=(0,r.useState)({}),[b,g]=(0,r.useState)({}),[j,y]=(0,r.useState)(!0),[v,N]=(0,r.useState)(null),[k,w]=(0,r.useState)(!1),[A,E]=(0,r.useState)(120),[C,I]=(0,r.useState)(!0),[S,q]=(0,r.useState)("all"),M=(0,r.useRef)(null),P=(0,r.useRef)(null),T=(0,r.useRef)({}),$=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed");let s=(await e.json()).connections||[];return t(s),s}catch{return t([]),[]}},[]),R=(0,r.useCallback)(async(e,t)=>{let s=Date.now();if(!(s-(T.current[e]||0)<3e4)){T.current[e]=s,f(t=>({...t,[e]:!0})),g(t=>({...t,[e]:null}));try{let s=await fetch(`/api/usage/${e}`);if(!s.ok){let t=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return;if(401===s.status)return void l(s=>({...s,[e]:{quotas:[],message:t}}));throw Error(`HTTP ${s.status}: ${t}`)}let a=await s.json(),r=function(e,t){if(!t||"object"!=typeof t)return[];let s=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"claude":t.message?s.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,i.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));s.sort((t,s)=>{let a=t.modelKey||t.name,r=s.modelKey||s.name;return(e.get(a)??999)-(e.get(r)??999)})}return s}(t,a);l(t=>({...t,[e]:{quotas:r,plan:a.plan||null,message:a.message||null,raw:a}}))}catch(t){g(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{f(t=>({...t,[e]:!1}))}}},[]),_=(0,r.useCallback)(async(e,t)=>{await R(e,t),N(new Date)},[R]),L=(0,r.useCallback)(async()=>{if(!k){w(!0),E(120);try{let e=(await $()).filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType);await Promise.all(e.map(e=>R(e.id,e.provider))),N(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{w(!1)}}},[k,$,R]);(0,r.useEffect)(()=>{(async()=>{I(!0),await L(),I(!1)})()},[]),(0,r.useEffect)(()=>{if(!j){M.current&&clearInterval(M.current),P.current&&clearInterval(P.current);return}return M.current=setInterval(L,12e4),P.current=setInterval(()=>{E(e=>e<=1?120:e-1)},1e3),()=>{M.current&&clearInterval(M.current),P.current&&clearInterval(P.current)}},[j,L]),(0,r.useEffect)(()=>{let e=()=>{document.hidden?(M.current&&clearInterval(M.current),P.current&&clearInterval(P.current)):j&&(M.current=setInterval(L,12e4),P.current=setInterval(()=>{E(e=>e<=1?120:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[j,L]);let O=(0,r.useMemo)(()=>e.filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType),[e]),D=(0,r.useMemo)(()=>{let e={antigravity:1,github:2,codex:3,claude:4,kiro:5};return[...O].sort((t,s)=>(e[t.provider]||9)-(e[s.provider]||9))},[O]),U=(0,r.useMemo)(()=>{let e={};for(let t of D)e[t.id]=c(s[t.id]?.plan);return e},[D,s]),F=(0,r.useMemo)(()=>{let e={all:D.length,enterprise:0,team:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of D){let s=U[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[D,U]),B=(0,r.useMemo)(()=>"all"===S?D:D.filter(e=>(U[e.id]?.key||"unknown")===S),[D,U,S]);return C?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(x.CardSkeleton,{}),(0,a.jsx)(x.CardSkeleton,{})]}):0===D.length?(0,a.jsx)(o.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] opacity-15",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-main",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-[400px] mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main m-0",children:"Provider Limits"}),(0,a.jsxs)("span",{className:"text-[13px] text-text-muted",children:[B.length," account",1!==B.length?"s":"",B.length!==D.length?` (filtered from ${D.length})`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>y(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/[0.08] bg-transparent cursor-pointer text-text-main text-[13px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:j?"#22c55e":"var(--text-muted)"},children:j?"toggle_on":"toggle_off"}),"Auto-refresh",j&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["(",A,"s)"]})]}),(0,a.jsxs)("button",{onClick:L,disabled:k,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-white/[0.06] border border-white/10 text-text-main text-[13px] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${k?"animate-spin":""}`,children:"refresh"}),"Refresh All"]})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:p.map(e=>{if("all"!==e.key&&!F[e.key])return null;let t=S===e.key;return(0,a.jsxs)("button",{onClick:()=>q(e.key),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold cursor-pointer",style:{border:t?"1px solid var(--primary, #E54D5E)":"1px solid rgba(255,255,255,0.12)",background:t?"rgba(249,120,21,0.14)":"transparent",color:t?"var(--primary, #E54D5E)":"var(--text-muted)"},children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"opacity-85",children:F[e.key]||0})]},e.key)})}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] overflow-hidden bg-black/15",children:[(0,a.jsxs)("div",{className:"items-center px-4 py-2.5 border-b border-white/[0.06] text-[11px] font-semibold uppercase tracking-wider text-text-muted",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px"},children:[(0,a.jsx)("div",{children:"Account"}),(0,a.jsx)("div",{children:"Model Quotas"}),(0,a.jsx)("div",{className:"text-center",children:"Last Used"}),(0,a.jsx)("div",{className:"text-center",children:"Actions"})]}),B.map((e,t)=>{let r=s[e.id],l=h[e.id],i=b[e.id],o=m[e.provider]||{label:e.provider,color:"#666"},x=U[e.id]||c(null);return(0,a.jsxs)("div",{className:"items-center px-4 py-3.5 transition-[background] duration-150 hover:bg-white/[0.02]",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px",borderBottom:t<B.length-1?"1px solid rgba(255,255,255,0.04)":"none"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden shrink-0",children:(0,a.jsx)(n.default,{src:`/providers/${e.provider}.png`,alt:e.provider,width:32,height:32,className:"object-contain",sizes:"32px"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[13px] font-semibold text-text-main truncate",children:e.name||o.label}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,a.jsx)("span",{title:r?.plan?`Raw plan: ${r.plan}`:"No plan from provider",children:(0,a.jsx)(d.default,{variant:x.variant,size:"sm",dot:!0,children:x.label})}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:o.label})]})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 pr-3",children:l?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),"Loading..."]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[300px]",children:i})]}):r?.message&&(!r.quotas||0===r.quotas.length)?(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:r.message}):r?.quotas?.length>0?r.quotas.map((e,t)=>{var s,r,l;let n=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):(s=e.used,(r=e.total)&&0!==r?!s||s<0?100:s>=r?0:Math.round((r-s)/r*100):0),i=n>70?{bar:"#22c55e",text:"#22c55e",bg:"rgba(34,197,94,0.12)"}:n>=30?{bar:"#eab308",text:"#eab308",bg:"rgba(234,179,8,0.12)"}:{bar:"#ef4444",text:"#ef4444",bg:"rgba(239,68,68,0.12)"},c=function(e){if(!e)return null;try{let t=new Date(e)-new Date;if(t<=0)return null;let s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);if(s>=24){let e=Math.floor(s/24);return`${e}d ${s%24}h`}return`${s}h ${a}m`}catch{return null}}(e.resetAt),o={"gemini-3-pro-high":"G3 Pro","gemini-3-pro-low":"G3 Pro Low","gemini-3-flash":"G3 Flash","gemini-2.5-flash":"G2.5 Flash","claude-opus-4-6-thinking":"Opus 4.6 Tk","claude-opus-4-5-thinking":"Opus 4.5 Tk","claude-opus-4-5":"Opus 4.5","claude-sonnet-4-5-thinking":"Sonnet 4.5 Tk","claude-sonnet-4-5":"Sonnet 4.5",chat:"Chat",completions:"Completions",premium_interactions:"Premium",session:"Session",weekly:"Weekly",agentic_request:"Agentic",agentic_request_freetrial:"Agentic (Trial)"}[l=e.name]||l;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-[200px] shrink-0",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold py-0.5 px-2 rounded whitespace-nowrap min-w-[60px] text-center",style:{background:i.bg,color:i.text},children:o}),c&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:["⏱ ",c]}),(0,a.jsx)("div",{className:"flex-1 h-1.5 rounded-sm bg-white/[0.06] min-w-[60px] overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-sm transition-[width] duration-300 ease-out",style:{width:`${Math.min(n,100)}%`,background:i.bar}})}),(0,a.jsxs)("span",{className:"text-[11px] font-semibold min-w-[32px] text-right",style:{color:i.text},children:[n,"%"]})]},t)}):(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:"No quota data"})}),(0,a.jsx)("div",{className:"text-center text-[11px] text-text-muted",children:v?(0,a.jsx)("span",{children:v.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}):"-"}),(0,a.jsx)("div",{className:"flex justify-center gap-0.5",children:(0,a.jsx)("button",{onClick:()=>_(e.id,e.provider),disabled:l,title:"Refresh quota",className:"p-1 rounded-md border-none bg-transparent cursor-pointer disabled:cursor-not-allowed disabled:opacity-30 opacity-60 hover:opacity-100 flex items-center justify-center transition-opacity duration-150",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] text-text-muted ${l?"animate-spin":""}`,children:"refresh"})})})]},e.id)}),0===B.length&&(0,a.jsxs)("div",{className:"py-6 px-4 text-center text-text-muted text-[13px]",children:["No accounts found for tier filter"," ",(0,a.jsx)("strong",{children:p.find(e=>e.key===S)?.label||S}),"."]})]})]})}function f(){let[e,t]=(0,r.useState)({lockouts:[],cacheStats:null}),[s,n]=(0,r.useState)(!0),i=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/rate-limits");e.ok&&t(await e.json())}catch{}finally{n(!1)}},[]);return(0,r.useEffect)(()=>{i();let e=setInterval(i,1e4);return()=>clearInterval(e)},[i]),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"lock_clock"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Model Lockouts"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Per-model rate limit locks • Auto-refresh 10s"})]}),e.lockouts.length>0&&(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold bg-orange-500/10 text-orange-400 border border-orange-500/20",children:[e.lockouts.length," locked"]})]}),0===e.lockouts.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40",children:"lock_open"}),(0,a.jsx)("p",{className:"text-sm",children:"No models currently locked"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:e.lockouts.map((e,t)=>{var s;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-orange-500/5 border border-orange-500/15",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-orange-400",children:"lock"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.model}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Account:"," ",(0,a.jsx)("span",{className:"font-mono",children:e.accountId?.slice(0,12)||"N/A"}),e.reason&&(0,a.jsxs)(a.Fragment,{children:[" — ",e.reason]})]})]})]}),(0,a.jsxs)("span",{className:"text-xs font-mono tabular-nums text-orange-400",children:[(s=e.remainingMs)<1e3?`${s}ms`:s<6e4?`${Math.ceil(s/1e3)}s`:`${Math.ceil(s/6e4)}m`," left"]})]},t)})})]})})}function b(){let[e,t]=(0,r.useState)({count:0,sessions:[]}),[s,n]=(0,r.useState)(!0),i=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/sessions");e.ok&&t(await e.json())}catch{}finally{n(!1)}},[]);return(0,r.useEffect)(()=>{i();let e=setInterval(i,5e3);return()=>clearInterval(e)},[i]),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Active Sessions"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tracked via request fingerprinting • Auto-refresh 5s"})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/20",children:[(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),(0,a.jsx)("span",{className:"text-sm font-semibold tabular-nums text-cyan-400",children:e.count})]})})]}),0===e.sessions.length?(0,a.jsxs)("div",{className:"text-center py-8 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[40px] mb-2 block opacity-40",children:"fingerprint"}),(0,a.jsx)("p",{className:"text-sm",children:"No active sessions"}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Sessions appear as requests flow through the proxy"})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-border/30",children:[(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Session"}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Age"}),(0,a.jsx)("th",{className:"text-right py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Requests"}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Connection"})]})}),(0,a.jsx)("tbody",{children:e.sessions.map(e=>{var t;return(0,a.jsxs)("tr",{className:"border-b border-border/10 hover:bg-surface/20 transition-colors",children:[(0,a.jsx)("td",{className:"py-2.5 px-3",children:(0,a.jsxs)("span",{className:"font-mono text-xs px-2 py-1 rounded bg-surface/40 text-text-muted",children:[e.sessionId.slice(0,12),"…"]})}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-text-muted tabular-nums",children:(t=e.ageMs)<6e4?`${Math.floor(t/1e3)}s`:t<36e5?`${Math.floor(t/6e4)}m`:`${Math.floor(t/36e5)}h`}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-right",children:(0,a.jsx)("span",{className:"font-semibold tabular-nums",children:e.requestCount})}),(0,a.jsx)("td",{className:"py-2.5 px-3",children:e.connectionId?(0,a.jsx)("span",{className:"text-xs font-mono text-cyan-400",children:e.connectionId.slice(0,10)}):(0,a.jsx)("span",{className:"text-text-muted/40",children:"—"})})]},e.sessionId)})})]})})]})}function g(){return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)(l.Qv,{}),children:(0,a.jsx)(h,{})}),(0,a.jsx)(f,{}),(0,a.jsx)(b,{})]})}}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=39387)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8013],{53586:(e,t,r)=>{Promise.resolve().then(r.bind(r,58802))},58802:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var l=r(95155),a=r(12115),o=r(40993);let s={debug:"text-gray-400",trace:"text-gray-500",info:"text-cyan-400",warn:"text-yellow-400",error:"text-red-400",fatal:"text-fuchsia-400"},n={debug:"bg-gray-500/10 border-gray-500/20",trace:"bg-gray-500/10 border-gray-500/20",info:"bg-cyan-500/10 border-cyan-500/20",warn:"bg-yellow-500/10 border-yellow-500/20",error:"bg-red-500/10 border-red-500/20",fatal:"bg-fuchsia-500/10 border-fuchsia-500/20"};function c(){let[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)(!0),[c,i]=(0,a.useState)(null),[d,x]=(0,a.useState)("all"),[u,m]=(0,a.useState)(""),[b,p]=(0,a.useState)(!0),[g,h]=(0,a.useState)(null),[v,f]=(0,a.useState)(null),y=(0,a.useRef)(null),j=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;"all"!==d&&e.set("level",d),e.set("limit","500");let r=await fetch(`/api/logs/console?${e.toString()}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let l=await r.json();t(l),h(new Date),i(null)}catch(e){i(e.message||"Failed to fetch logs")}finally{o(!1)}},[d]);(0,a.useEffect)(()=>{j();let e=setInterval(j,5e3);return()=>clearInterval(e)},[j]),(0,a.useEffect)(()=>{b&&y.current&&(y.current.scrollTop=y.current.scrollHeight)},[e,b]);let N=u?e.filter(e=>JSON.stringify(e).toLowerCase().includes(u.toLowerCase())):e;return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",children:[(0,l.jsxs)("select",{value:d,onChange:e=>x(e.target.value),"aria-label":"Filter by log level",className:"px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] focus:outline-2 focus:outline-[var(--color-accent)]",children:[(0,l.jsx)("option",{value:"all",children:"All Levels"}),(0,l.jsx)("option",{value:"debug",children:"Debug+"}),(0,l.jsx)("option",{value:"info",children:"Info+"}),(0,l.jsx)("option",{value:"warn",children:"Warn+"}),(0,l.jsx)("option",{value:"error",children:"Error+"})]}),(0,l.jsx)("input",{type:"text",placeholder:"Search logs...",value:u,onChange:e=>m(e.target.value),"aria-label":"Search log entries",className:"flex-1 min-w-[200px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsxs)("button",{onClick:()=>p(!b),title:b?"Disable auto-scroll":"Enable auto-scroll",className:`px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${b?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30":"bg-[var(--color-bg)] text-[var(--color-text-muted)] border-[var(--color-border)]"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-1",children:b?"vertical_align_bottom":"lock"}),"Auto-scroll"]}),(0,l.jsx)("button",{onClick:j,disabled:r,className:"px-3 py-2 rounded-lg text-sm font-medium bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-50 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle",children:"refresh"})}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto text-xs text-[var(--color-text-muted)]",children:[(0,l.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 animate-pulse"}),(0,l.jsxs)("span",{children:[N.length," entries"]}),(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsx)("span",{children:"Last 1h"}),g&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsxs)("span",{children:["Updated ",g.toLocaleTimeString()]})]})]})]}),c&&(0,l.jsxs)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-2",children:"error"}),c,(0,l.jsx)("span",{className:"text-xs ml-2 opacity-70",children:"— Make sure the application is writing logs to file (LOG_TO_FILE=true)"})]}),(0,l.jsxs)("div",{ref:y,className:"rounded-xl border border-[var(--color-border)] bg-[#0d1117] overflow-auto font-mono text-xs leading-relaxed",style:{maxHeight:"calc(100vh - 340px)",minHeight:"400px"},role:"log","aria-label":"Application console logs","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"sticky top-0 z-10 px-4 py-2 bg-[#161b22] border-b border-[#30363d] flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"}),(0,l.jsx)("span",{className:"ml-3 text-[#8b949e] text-[11px]",children:"OmniRoute — Application Console"})]}),(0,l.jsxs)("div",{className:"p-3 space-y-px",children:[0!==N.length||r?N.map((e,t)=>{let r=(e.level||"info").toLowerCase(),a=s[r]||s.info,o=n[r]||"",c=e.component||e.module||"",i=e.msg||e.message||"";return(0,l.jsxs)("div",{className:`group flex items-start gap-2 px-2 py-1 rounded hover:bg-white/5 transition-colors ${"error"===r||"fatal"===r?"bg-red-500/5":""}`,children:[(0,l.jsx)("span",{className:"text-[#484f58] whitespace-nowrap shrink-0 select-none",children:(e=>{try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return e}})(e.timestamp)}),(0,l.jsx)("span",{className:`inline-block px-1.5 py-0 rounded text-[10px] font-semibold uppercase border shrink-0 ${a} ${o}`,children:r.padEnd(5)}),c&&(0,l.jsxs)("span",{className:"text-purple-400/80 shrink-0",children:["[",c,"]"]}),(0,l.jsxs)("span",{className:"text-[#c9d1d9] flex-1 break-all",children:[i,e.correlationId&&(0,l.jsxs)("span",{className:"text-[#484f58] ml-2",children:["cid:",e.correlationId.slice(0,8)]})]}),(0,l.jsx)("button",{onClick:()=>{let r;return r=JSON.stringify(e,null,2),void navigator.clipboard.writeText(r).then(()=>{f(t),setTimeout(()=>f(null),2e3)})},title:"Copy log entry",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-[#8b949e] hover:text-white",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:v===t?"check":"content_copy"})})]},t)}):(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[40px] block mb-2 opacity-30",children:"terminal"}),(0,l.jsx)("p",{children:"No log entries found"}),(0,l.jsx)("p",{className:"text-[10px] mt-1 opacity-60",children:"Ensure LOG_TO_FILE=true is set in your .env file"})]}),r&&0===N.length&&(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[24px] animate-spin block mb-2",children:"progress_activity"}),"Loading logs..."]})]})]})]})}function i(){let[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)(!0),[s,n]=(0,a.useState)(null),[c,i]=(0,a.useState)(""),[d,x]=(0,a.useState)(""),[u,m]=(0,a.useState)(0),[b,p]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{o(!0),n(null);try{let e=new URLSearchParams;c&&e.set("action",c),d&&e.set("actor",d),e.set("limit",String(26)),e.set("offset",String(u));let r=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let l=await r.json();p(l.length>25),t(l.slice(0,25))}catch(e){n(e.message||"Failed to fetch audit log")}finally{o(!1)}},[c,d,u]);(0,a.useEffect)(()=>{g()},[g]);let h=()=>{m(0),g()};return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-[var(--color-text-main)]",children:"Audit Log"}),(0,l.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:"Administrative actions and security events"})]}),(0,l.jsx)("button",{onClick:g,disabled:r,"aria-label":"Refresh audit log",className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:r?"Loading...":"Refresh"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":"Filter audit log entries",children:[(0,l.jsx)("input",{type:"text",placeholder:"Filter by action...",value:c,onChange:e=>i(e.target.value),onKeyDown:e=>"Enter"===e.key&&h(),"aria-label":"Filter by action type",className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("input",{type:"text",placeholder:"Filter by actor...",value:d,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&h(),"aria-label":"Filter by actor",className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("button",{onClick:h,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:"Search"})]}),s&&(0,l.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:s}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,l.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":"Audit log entries",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Timestamp"}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Action"}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Actor"}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Target"}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"Details"}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:"IP"})]})}),(0,l.jsx)("tbody",{children:0!==e.length||r?e.map(e=>{var t;return(0,l.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(e.timestamp)}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(t=e.action).includes("delete")||t.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":t.includes("create")||t.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":t.includes("update")||t.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":t.includes("login")||t.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:e.action})}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:e.actor}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:e.target||"—"}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:e.details?JSON.stringify(e.details):"—"}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:e.ip_address||"—"})]},e.id)}):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:"No audit log entries found"})})})]})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Showing ",e.length," entries (offset ",u,")"]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{onClick:()=>m(Math.max(0,u-25)),disabled:0===u,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:"← Previous"}),(0,l.jsx)("button",{onClick:()=>m(u+25),disabled:!b,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:"Next →"})]})]})]})}function d(){let[e,t]=(0,a.useState)("request-logs");return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Iz,{options:[{value:"request-logs",label:"Request Logs"},{value:"proxy-logs",label:"Proxy Logs"},{value:"audit-logs",label:"Audit Logs"},{value:"console",label:"Console"}],value:e,onChange:t}),"request-logs"===e&&(0,l.jsx)(o.y7,{}),"proxy-logs"===e&&(0,l.jsx)(o.Lo,{}),"audit-logs"===e&&(0,l.jsx)(i,{}),"console"===e&&(0,l.jsx)(c,{})]})}}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=53586)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-19072ecdea202e4e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9971],{4051:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(95155),i=r(12115),a=r(73321);let n=[{id:"welcome",title:"Welcome",icon:"waving_hand"},{id:"security",title:"Security",icon:"lock"},{id:"provider",title:"Provider",icon:"dns"},{id:"test",title:"Test",icon:"play_circle"},{id:"done",title:"Ready!",icon:"check_circle"}],o=[{id:"openai",name:"OpenAI",color:"#10A37F"},{id:"anthropic",name:"Anthropic",color:"#D97757"},{id:"google",name:"Google AI",color:"#4285F4"},{id:"openrouter",name:"OpenRouter",color:"#6B21A8"},{id:"groq",name:"Groq",color:"#F55036"},{id:"mistral",name:"Mistral",color:"#FF7000"}];function c(){let e=(0,a.useRouter)(),[t,r]=(0,i.useState)(0),[c,l]=(0,i.useState)(!0),[d,m]=(0,i.useState)(""),[x,u]=(0,i.useState)(""),[p,h]=(0,i.useState)(!1),[g,y]=(0,i.useState)(null),[b,f]=(0,i.useState)(""),[j,v]=(0,i.useState)(""),[N,w]=(0,i.useState)(""),[k,C]=(0,i.useState)("idle"),[S,P]=(0,i.useState)("");(0,i.useEffect)(()=>{(async()=>{try{let t=await fetch("/api/settings");if(t.ok&&(await t.json()).setupComplete)return void e.replace("/dashboard")}catch{}l(!1)})()},[e]);let A=n[t],T=t===n.length-1,O=()=>{t<n.length-1&&r(t+1)},[_,R]=(0,i.useState)(""),I=async()=>{if(p)return void O();if(d===x){R("");try{let e=await fetch("/api/settings/require-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:!0,password:d})});if(!e.ok){let t=await e.json().catch(()=>({}));R(t.error||"Failed to set password. Try again.");return}O()}catch{R("Connection error. Please try again.")}}},q=async()=>{if(g&&j){R("");try{let e=o.find(e=>e.id===g),t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,name:N||e?.name||g,url:b||({openai:"https://api.openai.com",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com",openrouter:"https://openrouter.ai/api",groq:"https://api.groq.com/openai",mistral:"https://api.mistral.ai"})[g]||"",apiKey:j,isActive:!0})});if(!t.ok){let e=await t.json().catch(()=>({}));R(e.error||"Failed to add provider. Try again.");return}O()}catch{R("Connection error. Please try again.")}}},F=async()=>{C("testing"),P("Testing connection...");try{let e=await fetch("/api/providers");if(!e.ok)throw Error("Failed to fetch");let t=await e.json(),r=t.connections?.[0];if(!r){C("error"),P("No provider found. You can add one from the dashboard later.");return}let s=await fetch(`/api/providers/${r.id}/test`,{method:"POST"});if(s.ok)C("success"),P("Connection successful! Your provider is ready.");else{let e=await s.json().catch(()=>({}));C("error"),P(e.error||"Test failed, but you can configure this later.")}}catch{C("error"),P("Could not test right now. You can test from the dashboard.")}},Y=async()=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupComplete:!0})})}catch{}e.push("/dashboard")};return c?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,s.jsx)("div",{className:"animate-pulse text-text-muted",children:"Loading..."})}):(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,s.jsxs)("div",{className:"w-full max-w-lg",children:[(0,s.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:n.map((e,r)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-all duration-300 ${r<t?"bg-green-500/20 text-green-400":r===t?"bg-primary/20 text-primary ring-2 ring-primary/40":"bg-white/5 text-text-muted"}`,children:r<t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check"}):r+1}),r<n.length-1&&(0,s.jsx)("div",{className:`w-8 h-0.5 rounded-full transition-colors ${r<t?"bg-green-500/40":"bg-white/10"}`})]},e.id))}),(0,s.jsxs)("div",{className:"bg-surface rounded-2xl border border-white/[0.06] p-8 shadow-xl",children:[(0,s.jsxs)("div",{className:"text-center mb-6",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[48px] mb-3 block ${"done"===A.id?"text-green-400":"text-primary"}`,children:A.icon}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-text-main mb-1",children:A.title})]}),(0,s.jsxs)("div",{className:"min-h-[200px]",children:["welcome"===A.id&&(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsxs)("p",{className:"text-text-muted",children:[(0,s.jsx)("strong",{className:"text-text-main",children:"OmniRoute"})," is your local AI API proxy. It routes requests to multiple AI providers with load balancing, failover, and usage tracking."]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-3 mt-6",children:[{icon:"swap_horiz",label:"Multi-Provider"},{icon:"monitoring",label:"Usage Tracking"},{icon:"shield",label:"API Key Mgmt"}].map(e=>(0,s.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-3 text-center border border-white/[0.06]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[24px] mb-1 block",children:e.icon}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:e.label})]},e.icon))})]}),"security"===A.id&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted text-center",children:"Set a password to protect your dashboard, or skip for now."}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted",children:[(0,s.jsx)("input",{type:"checkbox",checked:p,onChange:e=>h(e.target.checked),className:"accent-primary"}),"Skip password setup"]}),!p&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",placeholder:"Enter password",value:d,onChange:e=>m(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,s.jsx)("input",{type:"password",placeholder:"Confirm password",value:x,onChange:e=>u(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),d&&x&&d!==x&&(0,s.jsx)("p",{className:"text-xs text-red-400",children:"Passwords do not match"})]})]}),"provider"===A.id&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted text-center",children:"Connect your first AI provider. You can add more later."}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",children:o.map(e=>(0,s.jsx)("button",{onClick:()=>{y(e.id),w(e.name)},className:`p-3 rounded-xl border text-center text-xs font-medium transition-all cursor-pointer ${g===e.id?"border-primary/60 bg-primary/10 text-primary":"border-white/10 bg-white/[0.03] text-text-muted hover:border-white/20"}`,children:e.name},e.id))}),g&&(0,s.jsxs)("div",{className:"space-y-3 mt-4",children:[(0,s.jsx)("input",{type:"password",placeholder:"API Key (required)",value:j,onChange:e=>v(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,s.jsx)("input",{type:"text",placeholder:"Custom URL (optional)",value:b,onChange:e=>f(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"})]})]}),"test"===A.id&&(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Let's verify your provider connection works."}),"idle"===k&&(0,s.jsx)("button",{onClick:F,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:"Run Connection Test"}),"testing"===k&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),(0,s.jsx)("span",{className:"text-sm",children:S})]}),"success"===k&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-green-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"check_circle"}),(0,s.jsx)("span",{className:"text-sm",children:S})]}),"error"===k&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"warning"}),(0,s.jsx)("span",{className:"text-sm",children:S})]}),(0,s.jsx)("button",{onClick:F,className:"text-xs text-text-muted underline cursor-pointer",children:"Retry"})]})]}),"done"===A.id&&(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"You're all set! Your OmniRoute instance is configured and ready to proxy AI requests."}),(0,s.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-4 border border-white/[0.06] text-left",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2 font-medium",children:"Your endpoint:"}),(0,s.jsx)("code",{className:"text-sm text-primary",children:"http://localhost:20128/api/v1"})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-white/[0.06]",children:[(0,s.jsx)("div",{children:t>0&&!T&&(0,s.jsx)("button",{onClick:()=>{t>0&&r(t-1)},className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:"Back"})}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[!T&&t>0&&(0,s.jsx)("button",{onClick:O,className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:"Skip"}),"welcome"===A.id&&(0,s.jsx)("button",{onClick:O,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:"Get Started"}),"security"===A.id&&(0,s.jsx)("button",{onClick:I,disabled:!p&&(!d||d!==x),className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:p?"Skip & Continue":"Set Password"}),"provider"===A.id&&(0,s.jsx)("button",{onClick:q,disabled:!g||!j,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:"Add Provider"}),"test"===A.id&&(0,s.jsx)("button",{onClick:O,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:"success"===k?"Continue":"Skip"}),T&&(0,s.jsx)("button",{onClick:Y,className:"px-6 py-2.5 bg-green-500 rounded-lg text-white font-medium text-sm hover:bg-green-500/90 transition-colors cursor-pointer",children:"Go to Dashboard →"})]})]})]}),!T&&(0,s.jsx)("div",{className:"text-center mt-4",children:(0,s.jsx)("button",{onClick:Y,className:"text-xs text-text-muted/60 hover:text-text-muted transition-colors cursor-pointer",children:"Skip wizard entirely"})})]})})}},73321:(e,t,r)=>{"use strict";var s=r(74645);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},89848:(e,t,r)=>{Promise.resolve().then(r.bind(r,4051))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=89848)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{7153:(e,s,t)=>{Promise.resolve().then(t.bind(t,49433))},49433:(e,s,t)=>{"use strict";t.d(s,{default:()=>p});var r=t(95155),l=t(12115),a=t(14051),i=t.n(a),n=t(5772),o=t(98500),d=t.n(o),c=t(73321),x=t(40993),m=t(20909),u=t(67671);function p({machineId:e}){let[s,t]=(0,l.useState)([]),[a,i]=(0,l.useState)([]),[n,o]=(0,l.useState)(!0),[c,u]=(0,l.useState)("/v1"),[p,f]=(0,l.useState)(null),[g,j]=(0,l.useState)({});(0,l.useEffect)(()=>{u(`${window.location.origin}/v1`)},[]);let v=(0,l.useCallback)(async()=>{try{let[e,s,r]=await Promise.all([fetch("/api/providers"),fetch("/api/models"),fetch("/api/provider-metrics")]);if(e.ok){let s=await e.json();t(s.connections||[])}if(s.ok){let e=await s.json();i(e.models||[])}if(r.ok){let e=await r.json();j(e.metrics||{})}}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=(0,l.useMemo)(()=>Object.entries(m.Q2).map(([e,t])=>{let r=s.filter(s=>s.provider===e),l=r.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,i=r.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length,n=new Set([e,t.alias].filter(Boolean)),o=a.filter(e=>n.has(e.provider)),d=m.IS[e]?"free":m.zN[e]?"oauth":"apikey";return{id:e,provider:t,total:r.length,connected:l,errors:i,modelCount:o.length,authType:d}}),[s,a]),y=(0,l.useMemo)(()=>{if(!p)return[];let e=new Set([p.id,p.provider?.alias].filter(Boolean));return a.filter(s=>e.has(s.provider))},[p,a]);return n?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(x.Qv,{}),(0,r.jsx)(x.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(x.Zp,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Quick Start"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Get up and running in 4 steps. Connect providers, route models, monitor everything."})]}),(0,r.jsxs)(d(),{href:"/docs",className:"hidden sm:inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"menu_book"}),"Full Docs"]})]}),(0,r.jsxs)("ol",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"key"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"1. Create API key"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Go to"," ",(0,r.jsx)(d(),{href:"/dashboard/endpoint",className:"text-primary hover:underline",children:"Endpoint"})," ","→ Registered Keys. Generate one key per environment."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-green-500/10 text-green-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"2. Connect providers"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Add accounts in"," ",(0,r.jsx)(d(),{href:"/dashboard/providers",className:"text-primary hover:underline",children:"Providers"}),". Supports OAuth, API Key, and free tiers."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"link"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"3. Point your client"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Set base URL to"," ",(0,r.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-surface text-xs font-mono",children:c})," ","in your IDE or API client."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"analytics"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"4. Monitor & optimize"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Track tokens, cost and errors in"," ",(0,r.jsx)(d(),{href:"/dashboard/usage",className:"text-primary hover:underline",children:"Request Logs"})," ","and"," ",(0,r.jsx)(d(),{href:"/dashboard/analytics",className:"text-primary hover:underline",children:"Analytics"}),"."]})]})]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:[{label:"Documentation",href:"/docs",icon:"menu_book"},{label:"Providers",href:"/dashboard/providers",icon:"dns"},{label:"Combos",href:"/dashboard/combos",icon:"layers"},{label:"Analytics",href:"/dashboard/analytics",icon:"analytics"},{label:"Health Monitor",href:"/dashboard/health",icon:"health_and_safety"},{label:"CLI Tools",href:"/dashboard/cli-tools",icon:"terminal"},{label:"Report issue",href:"https://github.com/diegosouzapw/OmniRoute/issues",external:!0,icon:"bug_report"}].map(e=>(0,r.jsxs)("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon||(e.external?"open_in_new":"arrow_forward")}),e.label]},e.href))})]})}),(0,r.jsxs)(x.Zp,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Providers Overview"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:[N.filter(e=>e.total>0).length," configured of"," ",N.length," available providers"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"hidden sm:flex items-center gap-3 text-[11px] text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," Free"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-blue-500"})," OAuth"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," API Key"]})]}),(0,r.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"settings"}),"Manage"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:N.map(e=>(0,r.jsx)(h,{item:e,metrics:g[e.provider.alias]||g[e.id],onClick:()=>f(e)},e.id))})]}),p&&(0,r.jsx)(b,{provider:p,models:y,onClose:()=>f(null)})]})}function h({item:e,metrics:s,onClick:t}){let[a,i]=(0,l.useState)(!1),o=e.errors>0?"text-red-500":e.connected>0?"text-green-500":"text-text-muted",d={free:{color:"bg-green-500",label:"Free"},oauth:{color:"bg-blue-500",label:"OAuth"},apikey:{color:"bg-amber-500",label:"API Key"}},c=d[e.authType]||d.apikey;return(0,r.jsx)("button",{onClick:t,className:"border border-border rounded-lg p-3 hover:bg-surface/40 transition-colors text-left cursor-pointer w-full",children:(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.provider.color||"#888"}15`},children:a?(0,r.jsx)("span",{className:"text-[10px] font-bold",style:{color:e.provider.color||"#888"},children:e.provider.textIcon||e.provider.id.slice(0,2).toUpperCase()}):(0,r.jsx)(n.default,{src:`/providers/${e.provider.id}.png`,alt:e.provider.name,width:26,height:26,className:"object-contain rounded-lg",sizes:"26px",onError:()=>i(!0)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm font-semibold truncate",children:e.provider.name}),(0,r.jsx)("span",{className:`size-2 rounded-full ${c.color} shrink-0`,title:c.label})]}),(0,r.jsx)("p",{className:`text-xs ${o}`,children:0===e.total?"Not configured":`${e.connected} active \xb7 ${e.errors} error`}),s&&s.totalRequests>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,r.jsx)("span",{className:"text-emerald-500",children:s.totalSuccesses}),"/",s.totalRequests," reqs"]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[s.successRate,"%"]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",s.avgLatencyMs,"ms"]})]})]}),(0,r.jsxs)("div",{className:"text-right shrink-0",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-text-main",children:e.modelCount}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted",children:"models"})]})]})})}function b({provider:e,models:s,onClose:t}){let[a,i]=(0,l.useState)(null),n=(0,u.i)(),o=(0,c.useRouter)(),d=e=>{t(),o.push(e)};return(0,r.jsx)(x.aF,{isOpen:!0,title:`${e.provider.name} — Models`,onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"token"}),s.length," model",1!==s.length?"s":""," available",e.total>0&&(0,r.jsxs)("span",{className:"ml-auto text-xs text-green-500",children:["● ",e.connected," connection",1!==e.connected?"s":""," active"]})]}),0===s.length?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"No models available for this provider."}),(0,r.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Configure a connection first in"," ",(0,r.jsx)("button",{onClick:()=>d("/dashboard/providers"),className:"text-primary hover:underline cursor-pointer",children:"Providers"})]})]}):(0,r.jsx)("div",{className:"flex flex-col gap-1 max-h-[400px] overflow-y-auto",children:s.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-surface/50 transition-colors group",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-mono text-sm text-text-main truncate",children:e.fullModel}),e.alias!==e.model&&(0,r.jsxs)("p",{className:"text-[10px] text-text-muted",children:["alias: ",e.alias]})]}),(0,r.jsx)("button",{onClick:()=>{var s;return s=e.fullModel,void(navigator.clipboard.writeText(s),i(s),n.success(`Copied: ${s}`),setTimeout(()=>i(null),2e3))},className:"shrink-0 ml-2 p-1.5 rounded-lg text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors opacity-0 group-hover:opacity-100",title:"Copy model name",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===e.fullModel?"check":"content_copy"})})]},e.fullModel))}),(0,r.jsxs)("div",{className:"flex gap-2 pt-2 border-t border-border",children:[(0,r.jsxs)(x.$n,{variant:"secondary",fullWidth:!0,size:"sm",onClick:()=>d(`/dashboard/providers/${e.id}`),className:"flex-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"settings"}),"Configure Provider"]}),(0,r.jsx)(x.$n,{variant:"ghost",size:"sm",onClick:t,children:"Close"})]})]})})}p.propTypes={machineId:i().string},h.propTypes={item:i().shape({id:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,alias:i().string}).isRequired,total:i().number.isRequired,connected:i().number.isRequired,errors:i().number.isRequired,modelCount:i().number.isRequired,authType:i().string.isRequired}).isRequired,metrics:i().shape({totalRequests:i().number,totalSuccesses:i().number,successRate:i().number,avgLatencyMs:i().number}),onClick:i().func.isRequired},b.propTypes={provider:i().object.isRequired,models:i().array.isRequired,onClose:i().func.isRequired}}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=7153)),_N_E=e.O()}]);
|