@jheavenknows/bluerouter 5.0.26 → 5.0.28
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +4 -4
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +7 -7
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +4 -4
- package/app/.next-cli-build/server/chunks/1998.js +1 -1
- package/app/.next-cli-build/server/chunks/2338.js +1 -1
- package/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/app/.next-cli-build/server/chunks/402.js +12 -4
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/5154.js +1 -1
- package/app/.next-cli-build/server/chunks/6328.js +1 -1
- package/app/.next-cli-build/server/chunks/9434.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{5263-c891a27f6a5ba6bc.js → 5263-3bedc29ea5569d6b.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/{page-4a4f5ef9723e55a7.js → page-dd303e911d957fc9.js} +4 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/page-78c5a8657c7cdc41.js +1 -0
- package/app/.next-cli-build/static/css/0ae523cfe1a85ec1.css +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/page-6b05f21639482913.js +0 -1
- package/app/.next-cli-build/static/css/1f71576c951970ec.css +0 -1
- /package/app/.next-cli-build/static/{mIuYBPwW0XxGfOrwVWtwj → p5_jdUG5LL3bJO17VYneL}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{mIuYBPwW0XxGfOrwVWtwj → p5_jdUG5LL3bJO17VYneL}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.21-to-5.0.22-5.0.22-20260625-112705 → upgrade-5.0.25-to-5.0.26-5.0.26-20260625-122655}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.22-to-5.0.23-5.0.23-20260625-113838 → upgrade-5.0.26-to-5.0.27-5.0.27-20260625-125701}/data.sqlite +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7593],{56484:(e,t,s)=>{"use strict";s.d(t,{default:()=>S});var n=s(95155),r=s(12115),l=s(35497),a=s(94027),d=s(11059);let i=Object.freeze({enabled:!0,requestsPerMinute:20,promptCharsMax:12e4,maxOutputTokens:0,forceThinkingOff:!0,allowedIpCidrs:[],expiresAt:""});function o(e){return String(e||"").trim().toLowerCase()}function c(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function x(e,t){let s=c(e?.allowedModels),n=s[0]||String(t||"programmer").trim()||"programmer",r=s.find(e=>/fast|small|haiku/i.test(e))||s.find(e=>e!==n)||n;return{codingModel:n,fastModel:r}}function m({icon:e,materialIcon:t,image:s,children:r,className:l=""}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${l}`,children:[s?(0,n.jsx)("img",{src:s,alt:"","aria-hidden":"true",className:"size-4 rounded-sm object-contain"}):t?(0,n.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] leading-none",children:t}):e?(0,n.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:e}):null,(0,n.jsx)("span",{children:r})]})}function u(e,t=0){let s=Number(e);return Number.isFinite(s)?Math.max(0,Math.floor(s)):t}function h(e,t=!0){return null==e||""===e?t:!0===e||"true"===e||1===e||"1"===e}function p(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function g(e){return e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0}function b(e={},t={}){let s={...t},n=e&&"object"==typeof e&&!Array.isArray(e)?e:{};return{enabled:h(n.enabled??s.enabled,!0),requestsPerMinute:u(n.requestsPerMinute??s.requestsPerMinute,0),promptCharsMax:u(n.promptCharsMax??s.promptCharsMax,0),maxOutputTokens:u(n.maxOutputTokens??n.outputTokensMax??n.maxTokens??n.max_tokens??n.max_completion_tokens??s.maxOutputTokens,0),forceThinkingOff:h(n.forceThinkingOff??s.forceThinkingOff,!0),allowedIpCidrs:p(n.allowedIpCidrs??s.allowedIpCidrs),expiresAt:String(n.expiresAt??s.expiresAt??"").trim()}}function f({models:e,emptyLabel:t="Chưa g\xe1n model"}){let s=c(e);return 0===s.length?(0,n.jsx)("span",{className:"text-xs text-text-muted",children:t}):(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[s.slice(0,8).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),s.length>8?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",s.length-8," model kh\xe1c"]}):null]})}function j({limits:e,showThinking:t=!1,showOutputLimit:s=!1}){if(!g(e))return(0,n.jsx)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"policy: chưa set, kh\xf4ng giới hạn"})});let r=b(e);return(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["policy: ",r.enabled?"bật":"tắt"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.requestsPerMinute||"∞"," req/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.promptCharsMax||"∞"," chars prompt"]}),s?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.maxOutputTokens||"∞"," output tokens"]}):null,t?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["thinking: ",r.forceThinkingOff?"force off":"client tự quyết"]}):null,r.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]})}function y({label:e,value:t,onChange:s,hint:r}){return(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:e}),(0,n.jsx)("input",{type:"number",min:"0",value:t,onChange:e=>s(u(e.target.value,0)),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"}),r?(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:r}):null]})}function v({isOpen:e,keyName:t,policy:s,setPolicy:r,onClose:a,onSave:d,onClear:o,saving:c,clearLabel:x="X\xf3a policy / kh\xf4ng limit"}){let m=b(s,i),u=(e,t)=>r(s=>b({...s,[e]:t},i));return(0,n.jsx)(l.aF,{isOpen:e,onClose:a,title:`Policy API key: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface/60 p-3 text-sm text-text-muted",children:["Key mới tự c\xf3 ",(0,n.jsx)("b",{children:"default policy"}),". Chỉ admin được sửa policy. Request/ph\xfat = 0 nghĩa l\xe0 kh\xf4ng giới hạn tần suất. Max output tokens = 0 nghĩa l\xe0 kh\xf4ng \xe9p giới hạn output."]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Bật policy"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Tắt mục n\xe0y th\xec policy được lưu nhưng kh\xf4ng \xe1p limit."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.enabled,onChange:e=>u("enabled",e.target.checked)})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsx)(y,{label:"Request / ph\xfat",value:m.requestsPerMinute,onChange:e=>u("requestsPerMinute",e),hint:"0 = kh\xf4ng giới hạn tần suất. Khuyến nghị user thường: 10–20 req/ph\xfat."}),(0,n.jsx)(y,{label:"Max output tokens",value:m.maxOutputTokens,onChange:e=>u("maxOutputTokens",e),hint:"0 = kh\xf4ng giới hạn. VS Code khuyến nghị 2048–3072; chat d\xe0i 4096–8192."})]}),(0,n.jsx)(y,{label:"Prompt chars tối đa",value:m.promptCharsMax,onChange:e=>u("promptCharsMax",e),hint:"0 = kh\xf4ng giới hạn input/prompt."}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Force Thinking Off"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Khi bật, gateway \xe9p request c\xf3 chat_template_kwargs.enable_thinking=false theo chuẩn llama.cpp."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.forceThinkingOff,onChange:e=>u("forceThinkingOff",e.target.checked)})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"IP/CIDR được ph\xe9p"}),(0,n.jsx)("textarea",{value:p(m.allowedIpCidrs).join("\n"),onChange:e=>u("allowedIpCidrs",[...new Set(String(e.target.value||"").split(/[\n,]+/).map(e=>e.trim()).filter(Boolean))]),rows:3,className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"10.0.0.0/8\n192.168.0.0/16"}),(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:"Để trống = mọi IP. Hỗ trợ IPv4 exact hoặc CIDR."})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Hết hạn l\xfac"}),(0,n.jsx)("input",{value:m.expiresAt,onChange:e=>u("expiresAt",e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"2026-12-31T23:59:59+07:00 hoặc để trống"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:a,children:"Hủy"}),o?(0,n.jsx)(l.$n,{variant:"outline",onClick:o,disabled:c,children:x}):null,(0,n.jsx)(l.$n,{onClick:()=>d(m),disabled:c,children:c?"Đang lưu...":"Lưu policy"})]})]})})}function N({open:e,keyName:t,models:s,setModels:a,activeProviders:d,modelAliases:i,onClose:o,onSave:x,saving:m,personalOnly:u,extraModels:h}){let[p,g]=(0,r.useState)(!1),b=c(s),f=e=>{let t=e?.value||e?.name||e;a(e=>c(e).filter(e=>e!==t))};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.aF,{isOpen:e,onClose:o,title:`Model access: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Chọn một hoặc nhiều model m\xe0 API key n\xe0y được ph\xe9p sử dụng. Trang n\xe0y kh\xf4ng cho lưu danh s\xe1ch model rỗng."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:"Model được ph\xe9p d\xf9ng"}),(0,n.jsx)(l.$n,{size:"sm",variant:"outline",onClick:()=>g(!0),children:"Th\xeam model"})]}),0===b.length?(0,n.jsx)("div",{className:"rounded-xl border border-dashed border-border p-4 text-sm text-text-muted",children:"Chưa chọn model n\xe0o. H\xe3y th\xeam \xedt nhất một model trước khi lưu."}):(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>f(e),className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-1 font-mono text-xs text-primary transition hover:bg-red-500/10 hover:text-red-600",title:"Bấm để gỡ model n\xe0y",children:[e," \xd7"]},e))}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:o,children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:x,disabled:m||0===b.length,children:m?"Đang lưu...":"Lưu danh s\xe1ch model"})]})]})}),(0,n.jsx)(l.rq,{isOpen:p,onClose:()=>g(!1),onSelect:e=>{let t=e?.value||e?.name||e;t&&a(e=>c([...e,t]))},onDeselect:f,activeProviders:d,modelAliases:i,title:"Chọn model được ph\xe9p d\xf9ng",addedModelValues:b,closeOnSelect:!1,personalOnly:u,extraModels:h})]})}function k({active:e}){return e?(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-1 text-xs font-medium text-emerald-700 dark:text-emerald-300",children:"Đang bật"}):(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-red-500/30 bg-red-500/10 px-2 py-1 text-xs font-medium text-red-700 dark:text-red-300",children:"Đ\xe3 tắt"})}function w({label:e,value:t,hint:s}){return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/70 p-4",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-semibold text-text-main",children:t}),s?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:s}):null]})}function C({pagination:e,pageSize:t,onPageChange:s,onPageSizeChange:r,loading:a}){let d=Number(e?.page||1),i=Number(e?.totalPages||1),o=Number(e?.total||0),c=0===o?0:(d-1)*t+1,x=Math.min(o,d*t);return(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-3 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["Hiển thị ",(0,n.jsx)("b",{children:c}),"–",(0,n.jsx)("b",{children:x})," / ",(0,n.jsx)("b",{children:o})," API keys"]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("select",{value:t,onChange:e=>r(Number(e.target.value)),className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",disabled:a,children:[(0,n.jsx)("option",{value:25,children:"25 / trang"}),(0,n.jsx)("option",{value:50,children:"50 / trang"}),(0,n.jsx)("option",{value:100,children:"100 / trang"})]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:a||d<=1,children:"Đầu"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.max(1,d-1)),disabled:a||d<=1,children:"Trước"}),(0,n.jsxs)("span",{className:"rounded-xl border border-border bg-surface px-3 py-2 text-sm",children:["Trang ",d,"/",i]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.min(i,d+1)),disabled:a||d>=i,children:"Sau"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(i),disabled:a||d>=i,children:"Cuối"})]})]})}function P({apiKey:e,owner:t,isAdmin:s,onRename:l,onEditModels:a,onEditPolicy:d,onAssignOwner:i,onDelete:o}){let[c,x]=(0,r.useState)(!1),u=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!c)return;let e=e=>{!u.current||u.current.contains(e.target)||x(!1)},t=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",t)}},[c]);let h=e=>{x(!1),e()};return(0,n.jsxs)("details",{ref:u,className:"group",open:c,onToggle:e=>x(e.currentTarget.open),children:[(0,n.jsx)("summary",{className:"flex h-9 cursor-pointer list-none items-center rounded-xl border border-border bg-background px-3 text-sm font-medium text-text-main transition hover:border-primary/50 hover:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 [&::-webkit-details-marker]:hidden",children:(0,n.jsx)("span",{"aria-hidden":"true",className:"text-lg leading-none",children:"⋯"})}),(0,n.jsxs)("div",{className:"ml-auto mt-2 w-40 overflow-hidden rounded-xl border border-border bg-background py-1 text-left shadow-xl shadow-black/10",children:[(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>h(()=>l(e.id,e.name)),children:(0,n.jsx)(m,{icon:"✏️",children:"Đổi t\xean"})}),(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>h(()=>a(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDCE6",children:"Models"})}),s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>h(()=>d(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDEE1️",children:"Policy"})}):null,s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>h(()=>i(e.id,t)),children:(0,n.jsx)(m,{icon:"\uD83D\uDC64",children:"Owner"})}):null,(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm font-medium text-red-600 transition hover:bg-red-500/10",onClick:()=>h(()=>o(e.id)),children:(0,n.jsx)(m,{icon:"\uD83D\uDDD1️",children:"X\xf3a"})})]})]})}function A({keys:e,visibleKeys:t,copied:s,copy:r,isAdmin:a,onToggleVisible:d,onToggleActive:i,onApiTest:o,onClaudeSettings:x,onOpenCodeSettings:u,onCodexSettings:h,onQwenSettings:p,onRename:f,onRotate:j,onEditModels:y,onEditPolicy:v,onAssignOwner:N,onDelete:w}){return(0,n.jsx)("div",{className:"overflow-hidden rounded-2xl border border-border",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"T\xean / Key"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Owner"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Ng\xe0y tạo"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 text-right font-medium",children:"Thao t\xe1c"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:e.map(e=>{var C;let A=t.has(e.id),S=e.ownerUser||e.createdByUser||"chưa g\xe1n",I=c(e.allowedModels),O=g(e.limits),$=b(e.limits||{});return(0,n.jsxs)("tr",{className:"align-top transition hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"min-w-[280px] px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||"API Key"}),(0,n.jsxs)("div",{className:"mt-2 flex max-w-[380px] items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2 font-mono text-xs text-text-main",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:A?e.key:(C=e.key)?C.length>12?`${C.slice(0,8)}...${C.slice(-4)}`:C:""}),(0,n.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>d(e.id),children:A?"Ẩn":"Hiện"})]}),e.createdByUser?(0,n.jsxs)("div",{className:"mt-2 text-xs text-text-muted",children:["Tạo bởi: ",e.createdByUser]}):null]}),(0,n.jsx)("td",{className:"whitespace-nowrap px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(k,{active:!!e.isActive}),(0,n.jsx)(l.lM,{checked:!!e.isActive,onChange:t=>i(e.id,t)})]})}),(0,n.jsx)("td",{className:"min-w-[160px] px-4 py-4",children:(0,n.jsx)("div",{className:"break-all text-sm text-text-main",children:S})}),(0,n.jsx)("td",{className:"min-w-[220px] px-4 py-4",children:I.length>0?(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[I.slice(0,3).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),I.length>3?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",I.length-3]}):null]}):(0,n.jsx)("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2 py-1 text-xs text-amber-700 dark:text-amber-300",children:"Legacy full access"})}),(0,n.jsx)("td",{className:"min-w-[220px] px-4 py-4",children:O?(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5 text-xs",children:[(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:$.enabled?"bật":"tắt"}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.requestsPerMinute||"∞","/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.promptCharsMax||"∞"," chars"]}),a&&$.maxOutputTokens>0?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.maxOutputTokens," out"]}):null,a&&$.forceThinkingOff?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"thinking off"}):null,$.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]}):(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs text-text-muted",children:"chưa set"})}),(0,n.jsx)("td",{className:"min-w-[150px] px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"kh\xf4ng r\xf5";try{return new Date(e).toLocaleString()}catch{return String(e)}}(e.createdAt)}),(0,n.jsx)("td",{className:"min-w-[180px] px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>r(e.key,e.id),children:(0,n.jsx)(m,{materialIcon:"content_copy",children:s===e.id?"Đ\xe3 copy":"Copy"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>o(e),children:(0,n.jsx)(m,{materialIcon:"science",children:"Test"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>x(e),children:(0,n.jsx)(m,{image:"/providers/claude.png",children:"Claude Code Settings"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>u(e),children:(0,n.jsx)(m,{image:"/providers/opencode.png",children:"OpenCode Settings"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>h(e),children:(0,n.jsx)(m,{image:"/providers/codex.png",children:"Codex Settings"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>p(e),children:(0,n.jsx)(m,{image:"/providers/qwen.png",children:"Qwen Code Settings"})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>j(e),children:(0,n.jsx)(m,{materialIcon:"key",children:"Đổi key"})}),(0,n.jsx)(P,{apiKey:e,owner:S,isAdmin:a,onRename:f,onEditModels:y,onEditPolicy:v,onAssignOwner:N,onDelete:w})]})})]},e.id)})})]})})})}function S(){let e,t,s,m,[h,p]=(0,r.useState)([]),[y,k]=(0,r.useState)(!0),[P,S]=(0,r.useState)(""),[I,O]=(0,r.useState)(!1),[$,M]=(0,r.useState)(""),[T,E]=(0,r.useState)(""),[K,_]=(0,r.useState)(""),[L,R]=(0,r.useState)(""),[D,U]=(0,r.useState)(new Set),[F,B]=(0,r.useState)(null),[q,z]=(0,r.useState)([]),[H,W]=(0,r.useState)(""),[Y,J]=(0,r.useState)(!1),[Q,V]=(0,r.useState)(!1),[X,Z]=(0,r.useState)([]),[G,ee]=(0,r.useState)([]),[et,es]=(0,r.useState)(!1),[en,er]=(0,r.useState)(i),[el,ea]=(0,r.useState)(i),[ed,ei]=(0,r.useState)(!1),[eo,ec]=(0,r.useState)(!1),[ex,em]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)([]),[ep,eg]=(0,r.useState)({}),[eb,ef]=(0,r.useState)(!1),[ej,ey]=(0,r.useState)(!1),[ev,eN]=(0,r.useState)(null),[ek,ew]=(0,r.useState)([]),[eC,eP]=(0,r.useState)(!1),[eA,eS]=(0,r.useState)(null),[eI,eO]=(0,r.useState)(i),[e$,eM]=(0,r.useState)(!1),[eT,eE]=(0,r.useState)(2),[eK,e_]=(0,r.useState)(0),[eL,eR]=(0,r.useState)(0),[eD,eU]=(0,r.useState)(""),[eF,eB]=(0,r.useState)(null),[eq,ez]=(0,r.useState)(null),[eH,eW]=(0,r.useState)(null),[eY,eJ]=(0,r.useState)(null),[eQ,eV]=(0,r.useState)(null),[eX,eZ]=(0,r.useState)(""),[eG,e0]=(0,r.useState)(""),[e1,e3]=(0,r.useState)("all"),[e2,e4]=(0,r.useState)(1),[e5,e8]=(0,r.useState)(25),[e6,e7]=(0,r.useState)({page:1,pageSize:25,total:0,totalAll:0,totalPages:1,status:"all",search:""}),{copied:e9,copy:te}=(0,d.C)(),{isAdmin:tt,isMonitorAdmin:ts,canManageApiKeys:tn,userId:tr}=(0,a.s)(),tl=tt||ts||tn,ta=Number.isFinite(Number(eT))?Number(eT):2,td=Number.isFinite(Number(eK))?Number(eK):h.length,ti=Number.isFinite(Number(eL))?Number(eL):Number(e6.totalAll||e6.total||0),to=Number(e6.total||0),tc=!tl&&td>=ta,tx=eD?`${eD}/v1`:"/v1",tm=eD?`${eD}/v1/chat/completions`:"/v1/chat/completions",tu=c(X)[0]||"",th=(e=c(eF?.allowedModels)[0],t=String(tu||"").trim(),e||t||"YOUR_MODEL"),tp=eF?b(eF.limits||{}):i,tg=tp.maxOutputTokens>0?tp.maxOutputTokens:0,tb=eF?function({endpoint:e,apiKey:t,model:s,maxOutputTokens:n=0}){let r=String(e||"/v1/chat/completions").replace(/"/g,""),l=String(t||"YOUR_API_KEY").replace(/"/g,""),a=u(n,0),d={model:String(s||"YOUR_MODEL"),messages:[{role:"user",content:"Say hi.\nReply in one short sentence."}],temperature:.2,stream:!1};a>0&&(d.max_tokens=a);let i=JSON.stringify(d).replace(/"/g,'\\"');return`curl.exe -X POST "${r}" ^
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7593],{56484:(e,t,s)=>{"use strict";s.d(t,{default:()=>O});var n=s(95155),r=s(12115),l=s(35497),a=s(94027),o=s(11059);let d=Object.freeze({enabled:!0,requestsPerMinute:20,promptCharsMax:12e4,maxOutputTokens:0,forceThinkingOff:!0,allowedIpCidrs:[],expiresAt:""});function i(e){return String(e||"").trim().toLowerCase()}function c(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function x(e,t){let s=c(e?.allowedModels),n=s[0]||String(t||"programmer").trim()||"programmer",r=s.find(e=>/fast|small|haiku/i.test(e))||s.find(e=>e!==n)||n;return{codingModel:n,fastModel:r}}function m({icon:e,materialIcon:t,image:s,children:r,className:l=""}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${l}`,children:[s?(0,n.jsx)("img",{src:s,alt:"","aria-hidden":"true",className:"size-4 rounded-sm object-contain"}):t?(0,n.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] leading-none",children:t}):e?(0,n.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:e}):null,(0,n.jsx)("span",{children:r})]})}function u(e,t=0){let s=Number(e);return Number.isFinite(s)?Math.max(0,Math.floor(s)):t}function h(e,t=!0){return null==e||""===e?t:!0===e||"true"===e||1===e||"1"===e}function p(e){return Array.isArray(e)?[...new Set(e.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function g(e){return e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0}function b(e={},t={}){let s={...t},n=e&&"object"==typeof e&&!Array.isArray(e)?e:{};return{enabled:h(n.enabled??s.enabled,!0),requestsPerMinute:u(n.requestsPerMinute??s.requestsPerMinute,0),promptCharsMax:u(n.promptCharsMax??s.promptCharsMax,0),maxOutputTokens:u(n.maxOutputTokens??n.outputTokensMax??n.maxTokens??n.max_tokens??n.max_completion_tokens??s.maxOutputTokens,0),forceThinkingOff:h(n.forceThinkingOff??s.forceThinkingOff,!0),allowedIpCidrs:p(n.allowedIpCidrs??s.allowedIpCidrs),expiresAt:String(n.expiresAt??s.expiresAt??"").trim()}}function f({models:e,emptyLabel:t="Chưa g\xe1n model"}){let s=c(e);return 0===s.length?(0,n.jsx)("span",{className:"text-xs text-text-muted",children:t}):(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[s.slice(0,8).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),s.length>8?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",s.length-8," model kh\xe1c"]}):null]})}function y({limits:e,showThinking:t=!1,showOutputLimit:s=!1}){if(!g(e))return(0,n.jsx)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"policy: chưa set, kh\xf4ng giới hạn"})});let r=b(e);return(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["policy: ",r.enabled?"bật":"tắt"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.requestsPerMinute||"∞"," req/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.promptCharsMax||"∞"," chars prompt"]}),s?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[r.maxOutputTokens||"∞"," output tokens"]}):null,t?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:["thinking: ",r.forceThinkingOff?"force off":"client tự quyết"]}):null,r.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]})}function j({label:e,value:t,onChange:s,hint:r}){return(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:e}),(0,n.jsx)("input",{type:"number",min:"0",value:t,onChange:e=>s(u(e.target.value,0)),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"}),r?(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:r}):null]})}function v({isOpen:e,keyName:t,policy:s,setPolicy:r,onClose:a,onSave:o,onClear:i,saving:c,clearLabel:x="X\xf3a policy / kh\xf4ng limit"}){let m=b(s,d),u=(e,t)=>r(s=>b({...s,[e]:t},d));return(0,n.jsx)(l.aF,{isOpen:e,onClose:a,title:`Policy API key: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface/60 p-3 text-sm text-text-muted",children:["Key mới tự c\xf3 ",(0,n.jsx)("b",{children:"default policy"}),". Chỉ admin được sửa policy. Request/ph\xfat = 0 nghĩa l\xe0 kh\xf4ng giới hạn tần suất. Max output tokens = 0 nghĩa l\xe0 kh\xf4ng \xe9p giới hạn output."]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Bật policy"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Tắt mục n\xe0y th\xec policy được lưu nhưng kh\xf4ng \xe1p limit."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.enabled,onChange:e=>u("enabled",e.target.checked)})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsx)(j,{label:"Request / ph\xfat",value:m.requestsPerMinute,onChange:e=>u("requestsPerMinute",e),hint:"0 = kh\xf4ng giới hạn tần suất. Khuyến nghị user thường: 10–20 req/ph\xfat."}),(0,n.jsx)(j,{label:"Max output tokens",value:m.maxOutputTokens,onChange:e=>u("maxOutputTokens",e),hint:"0 = kh\xf4ng giới hạn. VS Code khuyến nghị 2048–3072; chat d\xe0i 4096–8192."})]}),(0,n.jsx)(j,{label:"Prompt chars tối đa",value:m.promptCharsMax,onChange:e=>u("promptCharsMax",e),hint:"0 = kh\xf4ng giới hạn input/prompt."}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-3 text-sm",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{children:"Force Thinking Off"}),(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Khi bật, gateway \xe9p request c\xf3 chat_template_kwargs.enable_thinking=false theo chuẩn llama.cpp."})]}),(0,n.jsx)("input",{type:"checkbox",checked:m.forceThinkingOff,onChange:e=>u("forceThinkingOff",e.target.checked)})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"IP/CIDR được ph\xe9p"}),(0,n.jsx)("textarea",{value:p(m.allowedIpCidrs).join("\n"),onChange:e=>u("allowedIpCidrs",[...new Set(String(e.target.value||"").split(/[\n,]+/).map(e=>e.trim()).filter(Boolean))]),rows:3,className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"10.0.0.0/8\n192.168.0.0/16"}),(0,n.jsx)("span",{className:"mt-1 block text-xs text-text-muted",children:"Để trống = mọi IP. Hỗ trợ IPv4 exact hoặc CIDR."})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Hết hạn l\xfac"}),(0,n.jsx)("input",{value:m.expiresAt,onChange:e=>u("expiresAt",e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary",placeholder:"2026-12-31T23:59:59+07:00 hoặc để trống"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:a,children:"Hủy"}),i?(0,n.jsx)(l.$n,{variant:"outline",onClick:i,disabled:c,children:x}):null,(0,n.jsx)(l.$n,{onClick:()=>o(m),disabled:c,children:c?"Đang lưu...":"Lưu policy"})]})]})})}function N({open:e,keyName:t,models:s,setModels:a,activeProviders:o,modelAliases:d,onClose:i,onSave:x,saving:m,personalOnly:u,extraModels:h}){let[p,g]=(0,r.useState)(!1),b=c(s),f=e=>{let t=e?.value||e?.name||e;a(e=>c(e).filter(e=>e!==t))};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.aF,{isOpen:e,onClose:i,title:`Model access: ${t||"API Key"}`,size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Chọn một hoặc nhiều model m\xe0 API key n\xe0y được ph\xe9p sử dụng. Trang n\xe0y kh\xf4ng cho lưu danh s\xe1ch model rỗng."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:"Model được ph\xe9p d\xf9ng"}),(0,n.jsx)(l.$n,{size:"sm",variant:"outline",onClick:()=>g(!0),children:"Th\xeam model"})]}),0===b.length?(0,n.jsx)("div",{className:"rounded-xl border border-dashed border-border p-4 text-sm text-text-muted",children:"Chưa chọn model n\xe0o. H\xe3y th\xeam \xedt nhất một model trước khi lưu."}):(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>f(e),className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-1 font-mono text-xs text-primary transition hover:bg-red-500/10 hover:text-red-600",title:"Bấm để gỡ model n\xe0y",children:[e," \xd7"]},e))}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:i,children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:x,disabled:m||0===b.length,children:m?"Đang lưu...":"Lưu danh s\xe1ch model"})]})]})}),(0,n.jsx)(l.rq,{isOpen:p,onClose:()=>g(!1),onSelect:e=>{let t=e?.value||e?.name||e;t&&a(e=>c([...e,t]))},onDeselect:f,activeProviders:o,modelAliases:d,title:"Chọn model được ph\xe9p d\xf9ng",addedModelValues:b,closeOnSelect:!1,personalOnly:u,extraModels:h})]})}function k({active:e}){return e?(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-1 text-xs font-medium text-emerald-700 dark:text-emerald-300",children:"Đang bật"}):(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-red-500/30 bg-red-500/10 px-2 py-1 text-xs font-medium text-red-700 dark:text-red-300",children:"Đ\xe3 tắt"})}function w({label:e,value:t,hint:s}){return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/70 p-4",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-semibold text-text-main",children:t}),s?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:s}):null]})}function C({pagination:e,pageSize:t,onPageChange:s,onPageSizeChange:r,loading:a}){let o=Number(e?.page||1),d=Number(e?.totalPages||1),i=Number(e?.total||0),c=0===i?0:(o-1)*t+1,x=Math.min(i,o*t);return(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-3 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["Hiển thị ",(0,n.jsx)("b",{children:c}),"–",(0,n.jsx)("b",{children:x})," / ",(0,n.jsx)("b",{children:i})," API keys"]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("select",{value:t,onChange:e=>r(Number(e.target.value)),className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",disabled:a,children:[(0,n.jsx)("option",{value:25,children:"25 / trang"}),(0,n.jsx)("option",{value:50,children:"50 / trang"}),(0,n.jsx)("option",{value:100,children:"100 / trang"})]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:a||o<=1,children:"Đầu"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.max(1,o-1)),disabled:a||o<=1,children:"Trước"}),(0,n.jsxs)("span",{className:"rounded-xl border border-border bg-surface px-3 py-2 text-sm",children:["Trang ",o,"/",d]}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(Math.min(d,o+1)),disabled:a||o>=d,children:"Sau"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>s(d),disabled:a||o>=d,children:"Cuối"})]})]})}function P(e,t,s){(0,r.useEffect)(()=>{if(!t)return;let n=t=>{!e.current||e.current.contains(t.target)||s(!1)},r=e=>{"Escape"===e.key&&s(!1)};return document.addEventListener("pointerdown",n,!0),document.addEventListener("keydown",r),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("keydown",r)}},[e,t,s])}function A({apiKey:e,onClaudeSettings:t,onOpenCodeSettings:s,onCodexSettings:l,onQwenSettings:a}){let[o,d]=(0,r.useState)(!1),i=(0,r.useRef)(null);P(i,o,d);let c=e=>{d(!1),e()};return(0,n.jsxs)("details",{ref:i,className:"group",open:o,onToggle:e=>d(e.currentTarget.open),children:[(0,n.jsxs)("summary",{title:"Setup client config (Claude Code / OpenCode / Codex / Qwen)",className:"flex h-9 cursor-pointer list-none items-center gap-1.5 rounded-xl border border-border bg-background px-3 text-sm font-medium text-text-main transition hover:border-primary/50 hover:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 [&::-webkit-details-marker]:hidden",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] leading-none",children:"settings"}),(0,n.jsx)("span",{className:"hidden lg:inline",children:"Setup"}),(0,n.jsx)("span",{"aria-hidden":"true",className:"text-xs leading-none",children:"▾"})]}),(0,n.jsxs)("div",{className:"mt-2 w-48 overflow-hidden rounded-xl border border-border bg-background py-1 text-left shadow-xl shadow-black/10",children:[(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>c(()=>t(e)),children:(0,n.jsx)(m,{image:"/providers/claude.png",children:"Claude Code"})}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>c(()=>s(e)),children:(0,n.jsx)(m,{image:"/providers/opencode.png",children:"OpenCode"})}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>c(()=>l(e)),children:(0,n.jsx)(m,{image:"/providers/codex.png",children:"Codex"})}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>c(()=>a(e)),children:(0,n.jsx)(m,{image:"/providers/qwen.png",children:"Qwen Code"})})]})]})}function S({apiKey:e,owner:t,isAdmin:s,onRename:l,onRotate:a,onEditModels:o,onEditPolicy:d,onAssignOwner:i,onDelete:c}){let[x,u]=(0,r.useState)(!1),h=(0,r.useRef)(null);P(h,x,u);let p=e=>{u(!1),e()};return(0,n.jsxs)("details",{ref:h,className:"group",open:x,onToggle:e=>u(e.currentTarget.open),children:[(0,n.jsx)("summary",{title:"Thao t\xe1c kh\xe1c",className:"flex h-9 cursor-pointer list-none items-center rounded-xl border border-border bg-background px-3 text-sm font-medium text-text-main transition hover:border-primary/50 hover:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 [&::-webkit-details-marker]:hidden",children:(0,n.jsx)("span",{"aria-hidden":"true",className:"text-lg leading-none",children:"⋯"})}),(0,n.jsxs)("div",{className:"ml-auto mt-2 w-48 overflow-hidden rounded-xl border border-border bg-background py-1 text-left shadow-xl shadow-black/10",children:[(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>l(e.id,e.name)),children:(0,n.jsx)(m,{icon:"✏️",children:"Đổi t\xean"})}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>a(e)),children:(0,n.jsx)(m,{materialIcon:"key",children:"Đổi key"})}),(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>o(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDCE6",children:"Models"})}),s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>d(e)),children:(0,n.jsx)(m,{icon:"\uD83D\uDEE1️",children:"Policy"})}):null,s?(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm text-text-main transition hover:bg-surface",onClick:()=>p(()=>i(e.id,t)),children:(0,n.jsx)(m,{icon:"\uD83D\uDC64",children:"Owner"})}):null,(0,n.jsx)("div",{className:"my-1 border-t border-border"}),(0,n.jsx)("button",{type:"button",className:"block w-full px-3 py-2 text-left text-sm font-medium text-red-600 transition hover:bg-red-500/10",onClick:()=>p(()=>c(e.id)),children:(0,n.jsx)(m,{icon:"\uD83D\uDDD1️",children:"X\xf3a"})})]})]})}function I({keys:e,visibleKeys:t,copied:s,copy:r,isAdmin:a,onToggleVisible:o,onToggleActive:d,onApiTest:i,onClaudeSettings:x,onOpenCodeSettings:u,onCodexSettings:h,onQwenSettings:p,onRename:f,onRotate:y,onEditModels:j,onEditPolicy:v,onAssignOwner:N,onDelete:w}){return(0,n.jsx)("div",{className:"overflow-hidden rounded-2xl border border-border",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"T\xean / Key"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Owner"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 font-medium",children:"Ng\xe0y tạo"}),(0,n.jsx)("th",{className:"whitespace-nowrap px-4 py-3 text-right font-medium",children:"Thao t\xe1c"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:e.map(e=>{var C;let P=t.has(e.id),I=e.ownerUser||e.createdByUser||"chưa g\xe1n",O=c(e.allowedModels),M=g(e.limits),$=b(e.limits||{});return(0,n.jsxs)("tr",{className:"align-top transition hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"min-w-[280px] px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||"API Key"}),(0,n.jsxs)("div",{className:"mt-2 flex max-w-[380px] items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2 font-mono text-xs text-text-main",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:P?e.key:(C=e.key)?C.length>12?`${C.slice(0,8)}...${C.slice(-4)}`:C:""}),(0,n.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>o(e.id),children:P?"Ẩn":"Hiện"})]}),e.createdByUser?(0,n.jsxs)("div",{className:"mt-2 text-xs text-text-muted",children:["Tạo bởi: ",e.createdByUser]}):null]}),(0,n.jsx)("td",{className:"whitespace-nowrap px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(k,{active:!!e.isActive}),(0,n.jsx)(l.lM,{checked:!!e.isActive,onChange:t=>d(e.id,t)})]})}),(0,n.jsx)("td",{className:"min-w-[160px] px-4 py-4",children:(0,n.jsx)("div",{className:"break-all text-sm text-text-main",children:I})}),(0,n.jsx)("td",{className:"min-w-[220px] px-4 py-4",children:O.length>0?(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[O.slice(0,3).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 font-mono text-xs",children:e},e)),O.length>3?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs",children:["+",O.length-3]}):null]}):(0,n.jsx)("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2 py-1 text-xs text-amber-700 dark:text-amber-300",children:"Legacy full access"})}),(0,n.jsx)("td",{className:"min-w-[220px] px-4 py-4",children:M?(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5 text-xs",children:[(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:$.enabled?"bật":"tắt"}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.requestsPerMinute||"∞","/ph\xfat"]}),(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.promptCharsMax||"∞"," chars"]}),a&&$.maxOutputTokens>0?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:[$.maxOutputTokens," out"]}):null,a&&$.forceThinkingOff?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"thinking off"}):null,$.allowedIpCidrs.length>0?(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1",children:"IP locked"}):null]}):(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-xs text-text-muted",children:"chưa set"})}),(0,n.jsx)("td",{className:"min-w-[150px] px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"kh\xf4ng r\xf5";try{return new Date(e).toLocaleString()}catch{return String(e)}}(e.createdAt)}),(0,n.jsx)("td",{className:"min-w-[220px] px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>r(e.key,e.id),title:s===e.id?"Đ\xe3 copy API key":"Copy API key",children:(0,n.jsx)(m,{materialIcon:"content_copy",children:(0,n.jsx)("span",{className:"hidden lg:inline",children:s===e.id?"Đ\xe3 copy":"Copy"})})}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>i(e),title:"Test API key bằng curl",children:(0,n.jsx)(m,{materialIcon:"science",children:(0,n.jsx)("span",{className:"hidden lg:inline",children:"Test"})})}),(0,n.jsx)(A,{apiKey:e,onClaudeSettings:x,onOpenCodeSettings:u,onCodexSettings:h,onQwenSettings:p}),(0,n.jsx)(S,{apiKey:e,owner:I,isAdmin:a,onRename:f,onRotate:y,onEditModels:j,onEditPolicy:v,onAssignOwner:N,onDelete:w})]})})]},e.id)})})]})})})}function O(){let e,t,s,m,[h,p]=(0,r.useState)([]),[j,k]=(0,r.useState)(!0),[P,A]=(0,r.useState)(""),[S,O]=(0,r.useState)(!1),[M,$]=(0,r.useState)(""),[T,E]=(0,r.useState)(""),[K,_]=(0,r.useState)(""),[L,R]=(0,r.useState)(""),[D,U]=(0,r.useState)(new Set),[F,B]=(0,r.useState)(null),[q,z]=(0,r.useState)([]),[H,W]=(0,r.useState)(""),[Y,J]=(0,r.useState)(!1),[Q,V]=(0,r.useState)(!1),[X,Z]=(0,r.useState)([]),[G,ee]=(0,r.useState)([]),[et,es]=(0,r.useState)(!1),[en,er]=(0,r.useState)(d),[el,ea]=(0,r.useState)(d),[eo,ed]=(0,r.useState)(!1),[ei,ec]=(0,r.useState)(!1),[ex,em]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)([]),[ep,eg]=(0,r.useState)({}),[eb,ef]=(0,r.useState)(!1),[ey,ej]=(0,r.useState)(!1),[ev,eN]=(0,r.useState)(null),[ek,ew]=(0,r.useState)([]),[eC,eP]=(0,r.useState)(!1),[eA,eS]=(0,r.useState)(null),[eI,eO]=(0,r.useState)(d),[eM,e$]=(0,r.useState)(!1),[eT,eE]=(0,r.useState)(2),[eK,e_]=(0,r.useState)(0),[eL,eR]=(0,r.useState)(0),[eD,eU]=(0,r.useState)(""),[eF,eB]=(0,r.useState)(null),[eq,ez]=(0,r.useState)(null),[eH,eW]=(0,r.useState)(null),[eY,eJ]=(0,r.useState)(null),[eQ,eV]=(0,r.useState)(null),[eX,eZ]=(0,r.useState)(""),[eG,e0]=(0,r.useState)(""),[e1,e3]=(0,r.useState)("all"),[e2,e4]=(0,r.useState)(1),[e5,e8]=(0,r.useState)(25),[e6,e7]=(0,r.useState)({page:1,pageSize:25,total:0,totalAll:0,totalPages:1,status:"all",search:""}),{copied:e9,copy:te}=(0,o.C)(),{isAdmin:tt,isMonitorAdmin:ts,canManageApiKeys:tn,userId:tr}=(0,a.s)(),tl=tt||ts||tn,ta=Number.isFinite(Number(eT))?Number(eT):2,to=Number.isFinite(Number(eK))?Number(eK):h.length,td=Number.isFinite(Number(eL))?Number(eL):Number(e6.totalAll||e6.total||0),ti=Number(e6.total||0),tc=!tl&&to>=ta,tx=eD?`${eD}/v1`:"/v1",tm=eD?`${eD}/v1/chat/completions`:"/v1/chat/completions",tu=c(X)[0]||"",th=(e=c(eF?.allowedModels)[0],t=String(tu||"").trim(),e||t||"YOUR_MODEL"),tp=eF?b(eF.limits||{}):d,tg=tp.maxOutputTokens>0?tp.maxOutputTokens:0,tb=eF?function({endpoint:e,apiKey:t,model:s,maxOutputTokens:n=0}){let r=String(e||"/v1/chat/completions").replace(/"/g,""),l=String(t||"YOUR_API_KEY").replace(/"/g,""),a=u(n,0),o={model:String(s||"YOUR_MODEL"),messages:[{role:"user",content:"Say hi.\nReply in one short sentence."}],temperature:.2,stream:!1};a>0&&(o.max_tokens=a);let d=JSON.stringify(o).replace(/"/g,'\\"');return`curl.exe -X POST "${r}" ^
|
|
2
2
|
-H "Authorization: Bearer ${l}" ^
|
|
3
3
|
-H "Content-Type: application/json" ^
|
|
4
|
-
-d "${
|
|
4
|
+
-d "${d}"`}({endpoint:tm,apiKey:eF.key,model:th,maxOutputTokens:tg}):"",tf=eq?x(eq,tu):{codingModel:"programmer",fastModel:"programmer-fast"},ty=eq?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){return JSON.stringify({env:{ANTHROPIC_BASE_URL:e||"https://models-gateway.example.com/v1",ANTHROPIC_AUTH_TOKEN:t||"sk-xxxxx",ANTHROPIC_MODEL:s||"programmer",ANTHROPIC_SMALL_FAST_MODEL:n||s||"programmer-fast",ANTHROPIC_DEFAULT_OPUS_MODEL:s||"programmer",ANTHROPIC_DEFAULT_SONNET_MODEL:s||"programmer",ANTHROPIC_DEFAULT_HAIKU_MODEL:n||s||"programmer-fast"},theme:"dark",hasCompletedOnboarding:!0},null,2)}({baseUrl:tx,apiKey:eq.key,codingModel:tf.codingModel,fastModel:tf.fastModel}):"",tj=eq?['npm install -g @anthropic-ai/claude-code\nclaude --version\nmkdir $env:USERPROFILE\\.claude -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.claude\\settings.json", @\'',ty,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nclaude"].join("\n"):"",tv=eH?x(eH,tu):{codingModel:"programmer",fastModel:"programmer-fast"},tN=eH?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){let r=s||"programmer",l=n||r||"programmer-fast";return JSON.stringify({$schema:"https://opencode.ai/config.json",provider:{bluerouter:{npm:"@ai-sdk/openai-compatible",name:"BlueRouter",options:{baseURL:e||"https://models-gateway.example.com/v1",apiKey:t||"sk-xxxxx"},models:{[r]:{name:r,modalities:{input:["text","image"],output:["text"]}},[l]:{name:l,modalities:{input:["text"],output:["text"]}}}}},model:r,small_model:l,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:l}}},null,2)}({baseUrl:tx,apiKey:eH.key,codingModel:tv.codingModel,fastModel:tv.fastModel}):"",tk=eH?['npm install -g opencode-ai\nopencode --version\nmkdir $env:APPDATA\\opencode -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:APPDATA\\opencode\\opencode.json", @\'',tN,"'@, $utf8NoBom)\ncd D:\\path\\to\\your-project\nopencode"].join("\n"):"",tw=eY?x(eY,tu):{codingModel:"programmer",fastModel:"programmer-fast"},tC=eY?function({baseUrl:e,codingModel:t,fastModel:s}){let n=t||"programmer";return`model = "${n}"
|
|
5
5
|
model_provider = "bluerouter"
|
|
6
6
|
|
|
7
7
|
[model_providers.bluerouter]
|
|
@@ -12,5 +12,5 @@ wire_api = "responses"
|
|
|
12
12
|
|
|
13
13
|
[profiles.fast]
|
|
14
14
|
model = "${s||n||"programmer-fast"}"
|
|
15
|
-
model_provider = "bluerouter"`}({baseUrl:tx,codingModel:tw.codingModel,fastModel:tw.fastModel}):"",tP=eY?['npm install -g @openai/codex\ncodex --version\nmkdir $env:USERPROFILE\\.codex -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',tC,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eY.key}"`,`setx OPENAI_API_KEY "${eY.key}"`,"cd D:\\path\\to\\your-project\ncodex"].join("\n"):"",tA=eQ?x(eQ,tu):{codingModel:tu||"YOUR_MODEL",fastModel:tu||"YOUR_MODEL"},tS=eQ?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){let r=s||"programmer",l=n||r||"programmer-fast",a=e||"https://models-gateway.example.com/v1";return JSON.stringify({env:{OPENAI_API_KEY:t||"sk-xxxxx"},security:{auth:{selectedType:"openai"}},model:{name:r},modelProviders:{openai:[{id:r,name:r,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:12e4,maxRetries:2,contextWindowSize:131072,samplingParams:{temperature:.2}}},{id:l,name:l,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:6e4,maxRetries:2,reasoning:!1,contextWindowSize:65536,samplingParams:{temperature:.2,max_tokens:4096}}}]}},null,2)}({baseUrl:tx,apiKey:eQ.key,codingModel:tA.codingModel,fastModel:tA.fastModel}):"",tI=eQ?['npm install -g @qwen-code/qwen-code\nqwen --version\nmkdir $env:USERPROFILE\\.qwen -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.qwen\\settings.json", @\'',tS,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eQ.key}"`,`$env:OPENAI_BASE_URL = "${tx}"`,`$env:OPENAI_MODEL = "${tA.codingModel}"`,`setx OPENAI_API_KEY "${eQ.key}"`,`setx OPENAI_BASE_URL "${tx}"`,`setx OPENAI_MODEL "${tA.codingModel}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n"):"",tO=(0,r.useMemo)(()=>{let e=new Map;for(let t of q){let s=
|
|
16
|
-
C\xf3 thể d\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`);V(!0),S("");try{let e=tl?o(K||T||tr):void 0,t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$.trim(),ownerUser:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng tạo được API key");R(s.key),M(""),_(""),O(!1),e4(1),await tE()}catch(e){S(e.message||"Kh\xf4ng tạo được API key")}finally{V(!1)}}},tU=async(e,t)=>{let s=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));return s.ok?(await tE(),!0):(S(n.error||"Kh\xf4ng cập nhật được API key"),!1)},tF=async()=>{if(!ev)return;let e=c(ek);if(0===e.length)return void S("H\xe3y chọn \xedt nhất một model trước khi lưu quyền truy cập API key.");eP(!0),S("");try{await tU(ev.id,{allowedModels:e})&&(eN(null),ew([]))}finally{eP(!1)}},tB=async e=>{if(eA){eM(!0),S("");try{await tU(eA.id,{limits:b(e)})&&(eS(null),eO(i))}finally{eM(!1)}}},tq=async()=>{if(eA){eM(!0),S("");try{await tU(eA.id,{limits:{}})&&(eS(null),eO(i))}finally{eM(!1)}}};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Quản l\xfd API Keys"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:tl?"Bảng quản trị API key c\xf3 t\xecm kiếm, lọc trạng th\xe1i v\xe0 ph\xe2n trang để kh\xf4ng render qu\xe1 nhiều key c\xf9ng l\xfac.":`Bạn c\xf3 thể quản l\xfd API key của t\xe0i khoản m\xecnh. Mỗi user thường sở hữu tối đa ${ta} API keys. D\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",onClick:tE,disabled:y,children:y?"Đang tải...":"Refresh"}),(0,n.jsx)(l.$n,{onClick:()=>{O(!0),!T&&tr&&E(tr)},disabled:tc,children:"Tạo API Key"})]})]}),P?(0,n.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600 whitespace-pre-line",children:P}):null,(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsx)(w,{label:"Tổng API keys",value:ti,hint:tl?"To\xe0n hệ thống":`${td}/${ta} key của bạn`}),(0,n.jsx)(w,{label:"Đang hiển thị",value:to,hint:tT?"Theo bộ lọc hiện tại":"Kh\xf4ng filter"}),(0,n.jsx)(w,{label:"Page size",value:e5,hint:"Chỉ tải số d\xf2ng của trang hiện tại"})]}),tl?null:(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Giới hạn API key theo user"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["T\xe0i khoản của bạn đang c\xf3 ",td,"/",ta," API keys. Key bị disabled vẫn được t\xednh v\xe0o giới hạn."]})]}),(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-3 py-1 text-sm",children:tc?"Đ\xe3 đạt giới hạn":"C\xf2n c\xf3 thể tạo th\xeam"})]})}),(0,n.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default models cho API key mới"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"API key mới sẽ mặc định được d\xf9ng c\xe1c model n\xe0y. Cần cấu h\xecnh \xedt nhất một default model trước khi tạo API key."})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[X.length>0?(0,n.jsx)(f,{models:X,emptyLabel:"Chưa cấu h\xecnh default models"}):(0,n.jsx)("span",{className:"text-sm text-red-600",children:"Chưa cấu h\xecnh default models"}),tl?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{em(!0),tK()},children:G.length>0?`Đ\xe3 chọn ${G.length} model`:"Chọn default models..."}),(0,n.jsx)(l.$n,{size:"sm",onClick:tL,disabled:!t$||et||0===G.length,children:et?"Đang lưu...":"Lưu"})]}):null]}),tl?(0,n.jsx)("p",{className:"text-xs text-text-muted",children:ej?"Đang tải danh s\xe1ch model...":"Danh s\xe1ch model chỉ tải khi mở bộ chọn để trang load nhanh hơn."}):null]})}),(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default policy cho API key mới"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Policy n\xe0y được tự động g\xe1n cho key mới. Policy ri\xeang từng key vẫn c\xf3 thể override sau khi tạo."})]}),tl?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{ea(b(en||i,i)),ec(!0)},children:"Chỉnh default policy"}):null]}),(0,n.jsx)(j,{limits:en,showThinking:tl,showOutputLimit:tl})]})})]}),(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Th\xf4ng tin API endpoint"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng API key b\xean dưới để gọi gateway theo chuẩn OpenAI-compatible. Endpoint lấy theo domain hiện tại của dashboard."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Chat Completions"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tm})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>te(tx,"api-base-url"),children:"api-base-url"===e9?"Đ\xe3 copy Base URL":"Copy Base URL"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>te(tm,"api-chat-endpoint"),children:"api-chat-endpoint"===e9?"Đ\xe3 copy Endpoint":"Copy Endpoint"})]})]})}),L?(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h3",{className:"font-medium",children:"Đ\xe3 tạo API key"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-sm",children:L}),(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["H\xe3y copy ngay. Key mới mặc định được d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard, trừ khi admin chỉnh quyền model/policy.",(0,n.jsx)(f,{models:X,emptyLabel:"default models"})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(l.$n,{size:"sm",onClick:()=>te(L,"created"),children:"created"===e9?"Đ\xe3 copy":"Copy"}),(0,n.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>R(""),children:"Đ\xf3ng"})]})]})}):null,(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-end xl:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Danh s\xe1ch API keys"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xecm theo t\xean key, owner, model, id hoặc một phần API key. Backend chỉ trả về page hiện tại."})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,n.jsx)("input",{value:eX,onChange:e=>eZ(e.target.value),placeholder:"T\xecm API key, owner, model...",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary sm:w-80"}),(0,n.jsxs)("select",{value:e1,onChange:e=>{e3(e.target.value),e4(1)},className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,n.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,n.jsx)("option",{value:"active",children:"Chỉ key đang bật"}),(0,n.jsx)("option",{value:"inactive",children:"Chỉ key đ\xe3 tắt"})]}),tT?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eZ(""),e0(""),e3("all"),e4(1)},children:"X\xf3a lọc"}):null]})]}),y?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải API keys..."}):0===h.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:tT?"Kh\xf4ng t\xecm thấy API key ph\xf9 hợp bộ lọc.":"Chưa c\xf3 API key n\xe0o."}):(0,n.jsx)(A,{keys:h,visibleKeys:D,copied:e9,copy:te,isAdmin:tl,onToggleVisible:e=>{U(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onToggleActive:(e,t)=>tU(e,{isActive:t}),onApiTest:eB,onClaudeSettings:ez,onOpenCodeSettings:eW,onCodexSettings:eJ,onQwenSettings:eV,onRename:(e,t)=>{let s=prompt("T\xean API key mới",t||"");s?.trim()&&tU(e,{name:s.trim()})},onRotate:e=>{e?.id&&B({title:"Đổi API key",message:"Hệ thống sẽ tạo chuỗi API key mới cho record n\xe0y v\xe0 giữ nguy\xean t\xean, owner, model, policy. Key cũ sẽ hết hiệu lực ngay sau khi đổi.",onConfirm:async()=>{B(null),S("");let t=await fetch(`/api/keys/${e.id}/rotate`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)return void S(s.error||"Kh\xf4ng đổi được API key");let n=s.rotatedKey||s.key?.key||"";n&&R(n),await tE()}})},onEditModels:e=>{eN(e),ew(c(e.allowedModels)),tK()},onEditPolicy:e=>{tl&&(eS(e),eO(g(e.limits)?b(e.limits):i))},onAssignOwner:(e,t)=>{if(!tl)return;let s=prompt("G\xe1n owner username/email",t||tr||"");null!==s&&tU(e,{ownerUser:o(s)})},onDelete:e=>{B({title:"X\xf3a API Key",message:"Bạn chắc chắn muốn x\xf3a API key n\xe0y? Thao t\xe1c n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.",onConfirm:async()=>{B(null),(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&await tE()}})}}),(0,n.jsx)(C,{pagination:e6,pageSize:e5,onPageChange:e4,onPageSizeChange:e=>{e8(e),e4(1)},loading:y})]})}),(0,n.jsx)(l.aF,{isOpen:I,onClose:()=>O(!1),title:"Tạo API Key",size:"lg",children:(0,n.jsxs)("div",{className:"space-y-4",children:[0===X.length?(0,n.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:"Admin cần cấu h\xecnh default models trước khi tạo API key."}):tc?(0,n.jsxs)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:["Bạn đ\xe3 đạt giới hạn ",ta," API keys. H\xe3y x\xf3a bớt key cũ trước khi tạo key mới."]}):(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["Key n\xe0y sẽ được tạo với quyền d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard.",(0,n.jsx)(f,{models:X})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean API key"}),(0,n.jsx)("input",{value:$,onChange:e=>M(e.target.value),placeholder:"VD: VSCode, LibreChat, team-user",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),tl?(0,n.jsxs)("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Owner user"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{value:H,onChange:e=>W(e.target.value),placeholder:"Nhập từ kh\xf3a rồi bấm Tải",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>t_(H),disabled:Y,children:Y?"Đang tải":"Tải LDAP"})]}),(0,n.jsxs)("select",{value:T,onChange:e=>E(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,n.jsxs)("option",{value:tr||"",children:["G\xe1n cho t\xf4i (",tr||"local",")"]}),tO.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,n.jsx)("input",{value:K,onChange:e=>_(e.target.value),placeholder:"username hoặc email, kh\xf4ng bắt buộc",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"LDAP kh\xf4ng tự tải khi mở trang để giảm thời gian load. C\xf3 thể nhập owner thủ c\xf4ng hoặc nhập từ kh\xf3a rồi bấm Tải LDAP."})]}):(0,n.jsxs)("p",{className:"rounded-xl border border-border bg-surface p-3 text-sm text-text-muted",children:["Owner: ",tr||"user hiện tại"]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>O(!1),children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:tD,disabled:tM,children:Q?"Đang tạo...":"Tạo"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eF,onClose:()=>eB(null),title:"API Test bằng curl Windows",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Lệnh dưới đ\xe2y gọi thử endpoint Chat Completions bằng API key đang chọn v\xe0 đ\xe3 nh\xfang sẵn Bearer token."}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eF?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Endpoint"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tm})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model test"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:th})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Lệnh curl cho Windows CMD"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tb})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"D\xe1n lệnh v\xe0o CMD hoặc Windows Terminal để test nhanh. Nếu domain dashboard chạy sau reverse proxy, endpoint sẽ d\xf9ng đ\xfang domain đang mở tr\xean tr\xecnh duyệt."}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eB(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{onClick:()=>te(tb,`api-test-curl-${eF?.id||"current"}`),children:e9===`api-test-curl-${eF?.id||"current"}`?"Đ\xe3 copy":"Copy lệnh curl"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eq,onClose:()=>ez(null),title:"Claude Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy nội dung JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.claude\\settings.json"})," để Claude Code gọi qua gateway n\xe0y. Model coding d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tf.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tf.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eq?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tf.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tj})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Claude Code tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ty})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: chạy Claude Code trong thư mục project, kh\xf4ng chạy trong C:\\WINDOWS\\system32. Nếu d\xf9ng model fast ri\xeang như programmer-fast th\xec API key n\xe0y cũng phải được ph\xe9p d\xf9ng model đ\xf3 trong cột Model."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>ez(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(ty,`claude-code-help-${eq?.id||"current"}`),children:e9===`claude-code-help-${eq?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tj,`claude-code-settings-${eq?.id||"current"}`),children:e9===`claude-code-settings-${eq?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eH,onClose:()=>eW(null),title:"OpenCode Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%APPDATA%\\opencode\\opencode.json"})," hoặc ",(0,n.jsx)("span",{className:"font-mono",children:"opencode.json"})," trong project. Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tv.codingModel}),"; explorer/fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tv.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eH?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model ch\xednh"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tv.codingModel})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model fast"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tv.fastModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"opencode.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tN})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy OpenCode tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tk})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: API key n\xe0y cần được ph\xe9p gọi cả ",tv.codingModel," v\xe0 ",tv.fastModel,". Nếu OpenCode đang d\xf9ng đường dẫn config kh\xe1c, c\xf3 thể đặt file opencode.json ngay trong thư mục project."]}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eW(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tk,`opencode-help-${eH?.id||"current"}`),children:e9===`opencode-help-${eH?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tN,`opencode-settings-${eH?.id||"current"}`),children:e9===`opencode-settings-${eH?.id||"current"}`?"Đ\xe3 copy settings":"Copy opencode.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eY,onClose:()=>eJ(null),title:"Codex Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy TOML dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),". API key được set bằng biến m\xf4i trường ",(0,n.jsx)("span",{className:"font-mono",children:"OPENAI_API_KEY"}),". Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tw.codingModel}),"; profile fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tw.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eY?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tw.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"config.toml"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tC})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Codex tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tP})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo config.toml v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Codex d\xf9ng OpenAI-compatible endpoint của BlueRouter."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eJ(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tP,`codex-help-${eY?.id||"current"}`),children:e9===`codex-help-${eY?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tC,`codex-settings-${eY?.id||"current"}`),children:e9===`codex-settings-${eY?.id||"current"}`?"Đ\xe3 copy settings":"Copy config.toml"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eQ,onClose:()=>eV(null),title:"Qwen Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.qwen\\settings.json"})," để Qwen Code gọi qua OpenAI-compatible endpoint của BlueRouter. Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tA.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tA.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eQ?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tA.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tS})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Qwen Code tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tI})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo settings.json hợp lệ v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Qwen Code hỗ trợ OpenAI-compatible provider n\xean d\xf9ng tốt với BlueRouter."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eV(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tI,`qwen-code-help-${eQ?.id||"current"}`),children:e9===`qwen-code-help-${eQ?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tS,`qwen-code-settings-${eQ?.id||"current"}`),children:e9===`qwen-code-settings-${eQ?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(N,{open:!!ev,keyName:ev?.name,models:ek,setModels:ew,activeProviders:eu,modelAliases:ep,onClose:()=>{eN(null),ew([])},onSave:tF,saving:eC,personalOnly:!tl,extraModels:X}),(0,n.jsx)(v,{isOpen:eo,keyName:"Default cho API key mới",policy:el,setPolicy:ea,onClose:()=>{ec(!1),ea(en||i)},onSave:tR,saving:ed}),(0,n.jsx)(v,{isOpen:!!eA,keyName:eA?.name,policy:eI,setPolicy:eO,onClose:()=>{eS(null),eO(i)},onSave:tB,onClear:tq,saving:e$}),(0,n.jsx)(l.rq,{isOpen:ex,onClose:()=>em(!1),onSelect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&ee(e=>c([...e,t]))},onDeselect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&ee(e=>c(e).filter(e=>e!==t))},activeProviders:eu,modelAliases:ep,title:"Chọn default models cho API key",addedModelValues:G,closeOnSelect:!1}),F?(0,n.jsx)(l.uo,{isOpen:!!F,onClose:()=>B(null),onConfirm:F.onConfirm,title:F.title,message:F.message,confirmText:"X\xf3a",cancelText:"Hủy",variant:"danger"}):null]})}},84223:(e,t,s)=>{Promise.resolve().then(s.bind(s,56484))}},e=>{e.O(0,[2574,3862,246,5792,5263,5497,8441,3794,7358],()=>e(e.s=84223)),_N_E=e.O()}]);
|
|
15
|
+
model_provider = "bluerouter"`}({baseUrl:tx,codingModel:tw.codingModel,fastModel:tw.fastModel}):"",tP=eY?['npm install -g @openai/codex\ncodex --version\nmkdir $env:USERPROFILE\\.codex -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.codex\\config.toml", @\'',tC,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eY.key}"`,`setx OPENAI_API_KEY "${eY.key}"`,"cd D:\\path\\to\\your-project\ncodex"].join("\n"):"",tA=eQ?x(eQ,tu):{codingModel:tu||"YOUR_MODEL",fastModel:tu||"YOUR_MODEL"},tS=eQ?function({baseUrl:e,apiKey:t,codingModel:s,fastModel:n}){let r=s||"programmer",l=n||r||"programmer-fast",a=e||"https://models-gateway.example.com/v1";return JSON.stringify({env:{OPENAI_API_KEY:t||"sk-xxxxx"},security:{auth:{selectedType:"openai"}},model:{name:r},modelProviders:{openai:[{id:r,name:r,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:12e4,maxRetries:2,contextWindowSize:131072,samplingParams:{temperature:.2}}},{id:l,name:l,envKey:"OPENAI_API_KEY",baseUrl:a,generationConfig:{timeout:6e4,maxRetries:2,reasoning:!1,contextWindowSize:65536,samplingParams:{temperature:.2,max_tokens:4096}}}]}},null,2)}({baseUrl:tx,apiKey:eQ.key,codingModel:tA.codingModel,fastModel:tA.fastModel}):"",tI=eQ?['npm install -g @qwen-code/qwen-code\nqwen --version\nmkdir $env:USERPROFILE\\.qwen -Force\n$utf8NoBom = New-Object System.Text.UTF8Encoding $false\n[System.IO.File]::WriteAllText("$env:USERPROFILE\\.qwen\\settings.json", @\'',tS,"'@, $utf8NoBom)",`$env:OPENAI_API_KEY = "${eQ.key}"`,`$env:OPENAI_BASE_URL = "${tx}"`,`$env:OPENAI_MODEL = "${tA.codingModel}"`,`setx OPENAI_API_KEY "${eQ.key}"`,`setx OPENAI_BASE_URL "${tx}"`,`setx OPENAI_MODEL "${tA.codingModel}"`,"cd D:\\path\\to\\your-project\nqwen"].join("\n"):"",tO=(0,r.useMemo)(()=>{let e=new Map;for(let t of q){let s=i(t.username||t.email||t.userPrincipalName||t.sAMAccountName);s&&e.set(s,{id:s,label:`${t.displayName||t.username||s}${t.email?` \xb7 ${t.email}`:""}`})}for(let t of h){let s=i(t.ownerUser||t.createdByUser);s&&!e.has(s)&&e.set(s,{id:s,label:s})}return tr&&!e.has(tr)&&e.set(tr,{id:tr,label:`${tr} (t\xf4i)`}),[...e.values()].sort((e,t)=>e.label.localeCompare(t.label))},[q,h,tr]),tM=(s=c(G),m=c(X),!(s.length===m.length&&s.every((e,t)=>e===m[t]))),t$=Q||!M.trim()||0===X.length||tc,tT=!!eG||"all"!==e1,tE=async()=>{k(!0),A("");try{let e=new URLSearchParams;e.set("page",String(e2)),e.set("pageSize",String(e5)),eG&&e.set("q",eG),"all"!==e1&&e.set("status",e1);let t=await fetch(`/api/keys?${e.toString()}`,{cache:"no-store"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng tải được danh s\xe1ch API keys");let n=s.keys||[],r=s.pagination||{page:e2,pageSize:e5,total:n.length,totalAll:n.length,totalPages:1,search:eG,status:e1};if(0===n.length&&Number(r.total||0)>0&&e2>1)return void e4(Math.max(1,Number(r.totalPages||1)));let l=c(s.apiKeyDefaultModels||(s.apiKeyDefaultModel?[s.apiKeyDefaultModel]:[]));p(n),e7(r),eR(s.apiKeyTotal??r.totalAll??r.total??n.length);let a=b(s.apiKeyDefaultPolicy||d,d);Z(l),ee(l),er(a),ea(a),eE(s.apiKeyLimit??2),e_(s.apiKeyCount??r.totalAll??n.length)}catch(e){A(e.message||"Kh\xf4ng tải được danh s\xe1ch API keys")}finally{k(!1)}};(0,r.useEffect)(()=>{eU(window.location.origin)},[]),(0,r.useEffect)(()=>{let e=setTimeout(()=>{e4(1),e0(eX.trim())},350);return()=>clearTimeout(e)},[eX]),(0,r.useEffect)(()=>{tE()},[e2,e5,eG,e1]),(0,r.useEffect)(()=>{!T&&tr&&E(tr)},[tr,T]);let tK=async()=>{if(!eb&&!ey){ej(!0);try{let[e,t,s]=await Promise.allSettled([tl?fetch("/api/providers",{cache:"no-store"}):Promise.resolve(null),fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]),n=[],r=[];if("fulfilled"===e.status&&e.value?.ok){let t=await e.value.json().catch(()=>({}));n.push(...t.connections||[])}if("fulfilled"===t.status&&t.value.ok){let e=await t.value.json().catch(()=>({}));r.push(...e.connections||[])}if(eh(tl?[...n,...r]:r),"fulfilled"===s.status&&s.value.ok){let e=await s.value.json().catch(()=>({}));eg(e.aliases||{})}ef(!0)}catch{}finally{ej(!1)}}},t_=async(e=H)=>{if(tl){J(!0);try{let t=await fetch(`/api/auth/ldap/users?q=${encodeURIComponent(e||"")}`,{cache:"no-store"}),s=await t.json().catch(()=>({}));t.ok&&z(s.users||[])}catch{}finally{J(!1)}}},tL=async()=>{if(tl&&0!==G.length){es(!0),A("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultModels:G})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng lưu được default models");let s=c(t.apiKeyDefaultModels||(t.apiKeyDefaultModel?[t.apiKeyDefaultModel]:[])),n=b(t.apiKeyDefaultPolicy||d,d);Z(s),ee(s),er(n),ea(n)}catch(e){A(e.message||"Kh\xf4ng lưu được default models")}finally{es(!1)}}},tR=async e=>{if(!tl)return;let t=b(e,d);ed(!0),A("");try{let e=await fetch("/api/keys",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyDefaultPolicy:t})}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng lưu được default policy");let n=b(s.apiKeyDefaultPolicy||t,d);er(n),ea(n),ec(!1)}catch(e){A(e.message||"Kh\xf4ng lưu được default policy")}finally{ed(!1)}},tD=async()=>{if(M.trim()){if(0===X.length)return void A("Admin cần cấu h\xecnh default models trước khi tạo API key.");if(tc)return void A(`Mỗi user chỉ được tạo tối đa ${ta} API keys.
|
|
16
|
+
C\xf3 thể d\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`);V(!0),A("");try{let e=tl?i(K||T||tr):void 0,t=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:M.trim(),ownerUser:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng tạo được API key");R(s.key),$(""),_(""),O(!1),e4(1),await tE()}catch(e){A(e.message||"Kh\xf4ng tạo được API key")}finally{V(!1)}}},tU=async(e,t)=>{let s=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));return s.ok?(await tE(),!0):(A(n.error||"Kh\xf4ng cập nhật được API key"),!1)},tF=async()=>{if(!ev)return;let e=c(ek);if(0===e.length)return void A("H\xe3y chọn \xedt nhất một model trước khi lưu quyền truy cập API key.");eP(!0),A("");try{await tU(ev.id,{allowedModels:e})&&(eN(null),ew([]))}finally{eP(!1)}},tB=async e=>{if(eA){e$(!0),A("");try{await tU(eA.id,{limits:b(e)})&&(eS(null),eO(d))}finally{e$(!1)}}},tq=async()=>{if(eA){e$(!0),A("");try{await tU(eA.id,{limits:{}})&&(eS(null),eO(d))}finally{e$(!1)}}};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Quản l\xfd API Keys"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:tl?"Bảng quản trị API key c\xf3 t\xecm kiếm, lọc trạng th\xe1i v\xe0 ph\xe2n trang để kh\xf4ng render qu\xe1 nhiều key c\xf9ng l\xfac.":`Bạn c\xf3 thể quản l\xfd API key của t\xe0i khoản m\xecnh. Mỗi user thường sở hữu tối đa ${ta} API keys. D\xf9ng n\xfat Đổi key để xoay sang key mới m\xe0 kh\xf4ng cần x\xf3a/tạo lại.`})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",onClick:tE,disabled:j,children:j?"Đang tải...":"Refresh"}),(0,n.jsx)(l.$n,{onClick:()=>{O(!0),!T&&tr&&E(tr)},disabled:tc,children:"Tạo API Key"})]})]}),P?(0,n.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600 whitespace-pre-line",children:P}):null,(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsx)(w,{label:"Tổng API keys",value:td,hint:tl?"To\xe0n hệ thống":`${to}/${ta} key của bạn`}),(0,n.jsx)(w,{label:"Đang hiển thị",value:ti,hint:tT?"Theo bộ lọc hiện tại":"Kh\xf4ng filter"}),(0,n.jsx)(w,{label:"Page size",value:e5,hint:"Chỉ tải số d\xf2ng của trang hiện tại"})]}),tl?null:(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Giới hạn API key theo user"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["T\xe0i khoản của bạn đang c\xf3 ",to,"/",ta," API keys. Key bị disabled vẫn được t\xednh v\xe0o giới hạn."]})]}),(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-3 py-1 text-sm",children:tc?"Đ\xe3 đạt giới hạn":"C\xf2n c\xf3 thể tạo th\xeam"})]})}),(0,n.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default models cho API key mới"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"API key mới sẽ mặc định được d\xf9ng c\xe1c model n\xe0y. Cần cấu h\xecnh \xedt nhất một default model trước khi tạo API key."})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[X.length>0?(0,n.jsx)(f,{models:X,emptyLabel:"Chưa cấu h\xecnh default models"}):(0,n.jsx)("span",{className:"text-sm text-red-600",children:"Chưa cấu h\xecnh default models"}),tl?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{em(!0),tK()},children:G.length>0?`Đ\xe3 chọn ${G.length} model`:"Chọn default models..."}),(0,n.jsx)(l.$n,{size:"sm",onClick:tL,disabled:!tM||et||0===G.length,children:et?"Đang lưu...":"Lưu"})]}):null]}),tl?(0,n.jsx)("p",{className:"text-xs text-text-muted",children:ey?"Đang tải danh s\xe1ch model...":"Danh s\xe1ch model chỉ tải khi mở bộ chọn để trang load nhanh hơn."}):null]})}),(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Default policy cho API key mới"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Policy n\xe0y được tự động g\xe1n cho key mới. Policy ri\xeang từng key vẫn c\xf3 thể override sau khi tạo."})]}),tl?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{ea(b(en||d,d)),ec(!0)},children:"Chỉnh default policy"}):null]}),(0,n.jsx)(y,{limits:en,showThinking:tl,showOutputLimit:tl})]})})]}),(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium",children:"Th\xf4ng tin API endpoint"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng API key b\xean dưới để gọi gateway theo chuẩn OpenAI-compatible. Endpoint lấy theo domain hiện tại của dashboard."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Chat Completions"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tm})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>te(tx,"api-base-url"),children:"api-base-url"===e9?"Đ\xe3 copy Base URL":"Copy Base URL"}),(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>te(tm,"api-chat-endpoint"),children:"api-chat-endpoint"===e9?"Đ\xe3 copy Endpoint":"Copy Endpoint"})]})]})}),L?(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h3",{className:"font-medium",children:"Đ\xe3 tạo API key"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-sm",children:L}),(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["H\xe3y copy ngay. Key mới mặc định được d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard, trừ khi admin chỉnh quyền model/policy.",(0,n.jsx)(f,{models:X,emptyLabel:"default models"})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(l.$n,{size:"sm",onClick:()=>te(L,"created"),children:"created"===e9?"Đ\xe3 copy":"Copy"}),(0,n.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>R(""),children:"Đ\xf3ng"})]})]})}):null,(0,n.jsx)(l.Zp,{children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-end xl:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Danh s\xe1ch API keys"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xecm theo t\xean key, owner, model, id hoặc một phần API key. Backend chỉ trả về page hiện tại."})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,n.jsx)("input",{value:eX,onChange:e=>eZ(e.target.value),placeholder:"T\xecm API key, owner, model...",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary sm:w-80"}),(0,n.jsxs)("select",{value:e1,onChange:e=>{e3(e.target.value),e4(1)},className:"rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,n.jsx)("option",{value:"all",children:"Tất cả trạng th\xe1i"}),(0,n.jsx)("option",{value:"active",children:"Chỉ key đang bật"}),(0,n.jsx)("option",{value:"inactive",children:"Chỉ key đ\xe3 tắt"})]}),tT?(0,n.jsx)(l.$n,{variant:"outline",size:"sm",onClick:()=>{eZ(""),e0(""),e3("all"),e4(1)},children:"X\xf3a lọc"}):null]})]}),j?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải API keys..."}):0===h.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:tT?"Kh\xf4ng t\xecm thấy API key ph\xf9 hợp bộ lọc.":"Chưa c\xf3 API key n\xe0o."}):(0,n.jsx)(I,{keys:h,visibleKeys:D,copied:e9,copy:te,isAdmin:tl,onToggleVisible:e=>{U(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onToggleActive:(e,t)=>tU(e,{isActive:t}),onApiTest:eB,onClaudeSettings:ez,onOpenCodeSettings:eW,onCodexSettings:eJ,onQwenSettings:eV,onRename:(e,t)=>{let s=prompt("T\xean API key mới",t||"");s?.trim()&&tU(e,{name:s.trim()})},onRotate:e=>{e?.id&&B({title:"Đổi API key",message:"Hệ thống sẽ tạo chuỗi API key mới cho record n\xe0y v\xe0 giữ nguy\xean t\xean, owner, model, policy. Key cũ sẽ hết hiệu lực ngay sau khi đổi.",onConfirm:async()=>{B(null),A("");let t=await fetch(`/api/keys/${e.id}/rotate`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)return void A(s.error||"Kh\xf4ng đổi được API key");let n=s.rotatedKey||s.key?.key||"";n&&R(n),await tE()}})},onEditModels:e=>{eN(e),ew(c(e.allowedModels)),tK()},onEditPolicy:e=>{tl&&(eS(e),eO(g(e.limits)?b(e.limits):d))},onAssignOwner:(e,t)=>{if(!tl)return;let s=prompt("G\xe1n owner username/email",t||tr||"");null!==s&&tU(e,{ownerUser:i(s)})},onDelete:e=>{B({title:"X\xf3a API Key",message:"Bạn chắc chắn muốn x\xf3a API key n\xe0y? Thao t\xe1c n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.",onConfirm:async()=>{B(null),(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&await tE()}})}}),(0,n.jsx)(C,{pagination:e6,pageSize:e5,onPageChange:e4,onPageSizeChange:e=>{e8(e),e4(1)},loading:j})]})}),(0,n.jsx)(l.aF,{isOpen:S,onClose:()=>O(!1),title:"Tạo API Key",size:"lg",children:(0,n.jsxs)("div",{className:"space-y-4",children:[0===X.length?(0,n.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:"Admin cần cấu h\xecnh default models trước khi tạo API key."}):tc?(0,n.jsxs)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:["Bạn đ\xe3 đạt giới hạn ",ta," API keys. H\xe3y x\xf3a bớt key cũ trước khi tạo key mới."]}):(0,n.jsxs)("div",{className:"text-sm text-text-muted",children:["Key n\xe0y sẽ được tạo với quyền d\xf9ng default models v\xe0 default policy đang cấu h\xecnh trong Dashboard.",(0,n.jsx)(f,{models:X})]}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean API key"}),(0,n.jsx)("input",{value:M,onChange:e=>$(e.target.value),placeholder:"VD: VSCode, LibreChat, team-user",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),tl?(0,n.jsxs)("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Owner user"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{value:H,onChange:e=>W(e.target.value),placeholder:"Nhập từ kh\xf3a rồi bấm Tải",className:"min-w-0 flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>t_(H),disabled:Y,children:Y?"Đang tải":"Tải LDAP"})]}),(0,n.jsxs)("select",{value:T,onChange:e=>E(e.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,n.jsxs)("option",{value:tr||"",children:["G\xe1n cho t\xf4i (",tr||"local",")"]}),tO.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,n.jsx)("input",{value:K,onChange:e=>_(e.target.value),placeholder:"username hoặc email, kh\xf4ng bắt buộc",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"LDAP kh\xf4ng tự tải khi mở trang để giảm thời gian load. C\xf3 thể nhập owner thủ c\xf4ng hoặc nhập từ kh\xf3a rồi bấm Tải LDAP."})]}):(0,n.jsxs)("p",{className:"rounded-xl border border-border bg-surface p-3 text-sm text-text-muted",children:["Owner: ",tr||"user hiện tại"]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>O(!1),children:"Hủy"}),(0,n.jsx)(l.$n,{onClick:tD,disabled:t$,children:Q?"Đang tạo...":"Tạo"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eF,onClose:()=>eB(null),title:"API Test bằng curl Windows",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Lệnh dưới đ\xe2y gọi thử endpoint Chat Completions bằng API key đang chọn v\xe0 đ\xe3 nh\xfang sẵn Bearer token."}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eF?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Endpoint"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tm})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model test"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:th})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Lệnh curl cho Windows CMD"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tb})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"D\xe1n lệnh v\xe0o CMD hoặc Windows Terminal để test nhanh. Nếu domain dashboard chạy sau reverse proxy, endpoint sẽ d\xf9ng đ\xfang domain đang mở tr\xean tr\xecnh duyệt."}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eB(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{onClick:()=>te(tb,`api-test-curl-${eF?.id||"current"}`),children:e9===`api-test-curl-${eF?.id||"current"}`?"Đ\xe3 copy":"Copy lệnh curl"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eq,onClose:()=>ez(null),title:"Claude Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy nội dung JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.claude\\settings.json"})," để Claude Code gọi qua gateway n\xe0y. Model coding d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tf.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tf.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eq?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tf.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:ty})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Claude Code tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tj})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: chạy Claude Code trong thư mục project, kh\xf4ng chạy trong C:\\WINDOWS\\system32. Nếu d\xf9ng model fast ri\xeang như programmer-fast th\xec API key n\xe0y cũng phải được ph\xe9p d\xf9ng model đ\xf3 trong cột Model."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>ez(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tj,`claude-code-help-${eq?.id||"current"}`),children:e9===`claude-code-help-${eq?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(ty,`claude-code-settings-${eq?.id||"current"}`),children:e9===`claude-code-settings-${eq?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eH,onClose:()=>eW(null),title:"OpenCode Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%APPDATA%\\opencode\\opencode.json"})," hoặc ",(0,n.jsx)("span",{className:"font-mono",children:"opencode.json"})," trong project. Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tv.codingModel}),"; explorer/fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tv.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eH?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model ch\xednh"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tv.codingModel})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model fast"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tv.fastModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"opencode.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tN})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy OpenCode tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tk})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:["Lưu \xfd: API key n\xe0y cần được ph\xe9p gọi cả ",tv.codingModel," v\xe0 ",tv.fastModel,". Nếu OpenCode đang d\xf9ng đường dẫn config kh\xe1c, c\xf3 thể đặt file opencode.json ngay trong thư mục project."]}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eW(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tk,`opencode-help-${eH?.id||"current"}`),children:e9===`opencode-help-${eH?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tN,`opencode-settings-${eH?.id||"current"}`),children:e9===`opencode-settings-${eH?.id||"current"}`?"Đ\xe3 copy settings":"Copy opencode.json"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eY,onClose:()=>eJ(null),title:"Codex Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy TOML dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),". API key được set bằng biến m\xf4i trường ",(0,n.jsx)("span",{className:"font-mono",children:"OPENAI_API_KEY"}),". Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tw.codingModel}),"; profile fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tw.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eY?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tw.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"config.toml"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tC})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Codex tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tP})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo config.toml v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Codex d\xf9ng OpenAI-compatible endpoint của BlueRouter."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eJ(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tP,`codex-help-${eY?.id||"current"}`),children:e9===`codex-help-${eY?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tC,`codex-settings-${eY?.id||"current"}`),children:e9===`codex-settings-${eY?.id||"current"}`?"Đ\xe3 copy settings":"Copy config.toml"})]})]})}),(0,n.jsx)(l.aF,{isOpen:!!eQ,onClose:()=>eV(null),title:"Qwen Code Settings",size:"xl",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Copy JSON dưới đ\xe2y v\xe0o file ",(0,n.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.qwen\\settings.json"})," để Qwen Code gọi qua OpenAI-compatible endpoint của BlueRouter. Model ch\xednh d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tA.codingModel}),"; model fast d\xf9ng ",(0,n.jsx)("span",{className:"font-mono",children:tA.fastModel}),"."]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"API Key"}),(0,n.jsx)("div",{className:"mt-1 text-sm",children:eQ?.name||"API Key"})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Base URL"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tx})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-surface p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Model"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-sm",children:tA.codingModel})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"settings.json"}),(0,n.jsx)("pre",{className:"max-h-[420px] overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tS})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"C\xe0i v\xe0 chạy Qwen Code tr\xean Windows PowerShell"}),(0,n.jsx)("pre",{className:"overflow-auto rounded-xl border border-border bg-surface p-3 text-xs",children:tI})]}),(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:"Lưu \xfd: hướng dẫn đ\xe3 tự tạo settings.json hợp lệ v\xe0 set biến m\xf4i trường cho phi\xean PowerShell hiện tại. setx chỉ lưu lại cho terminal mở sau. Qwen Code hỗ trợ OpenAI-compatible provider n\xean d\xf9ng tốt với BlueRouter."}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"ghost",onClick:()=>eV(null),children:"Đ\xf3ng"}),(0,n.jsx)(l.$n,{variant:"outline",onClick:()=>te(tI,`qwen-code-help-${eQ?.id||"current"}`),children:e9===`qwen-code-help-${eQ?.id||"current"}`?"Đ\xe3 copy hướng dẫn":"Copy hướng dẫn"}),(0,n.jsx)(l.$n,{onClick:()=>te(tS,`qwen-code-settings-${eQ?.id||"current"}`),children:e9===`qwen-code-settings-${eQ?.id||"current"}`?"Đ\xe3 copy settings":"Copy settings.json"})]})]})}),(0,n.jsx)(N,{open:!!ev,keyName:ev?.name,models:ek,setModels:ew,activeProviders:eu,modelAliases:ep,onClose:()=>{eN(null),ew([])},onSave:tF,saving:eC,personalOnly:!tl,extraModels:X}),(0,n.jsx)(v,{isOpen:ei,keyName:"Default cho API key mới",policy:el,setPolicy:ea,onClose:()=>{ec(!1),ea(en||d)},onSave:tR,saving:eo}),(0,n.jsx)(v,{isOpen:!!eA,keyName:eA?.name,policy:eI,setPolicy:eO,onClose:()=>{eS(null),eO(d)},onSave:tB,onClear:tq,saving:eM}),(0,n.jsx)(l.rq,{isOpen:ex,onClose:()=>em(!1),onSelect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&ee(e=>c([...e,t]))},onDeselect:e=>{let t=String(e?.value||e?.name||e||"").trim();t&&ee(e=>c(e).filter(e=>e!==t))},activeProviders:eu,modelAliases:ep,title:"Chọn default models cho API key",addedModelValues:G,closeOnSelect:!1}),F?(0,n.jsx)(l.uo,{isOpen:!!F,onClose:()=>B(null),onConfirm:F.onConfirm,title:F.title,message:F.message,confirmText:"X\xf3a",cancelText:"Hủy",variant:"danger"}):null]})}},84223:(e,t,s)=>{Promise.resolve().then(s.bind(s,56484))}},e=>{e.O(0,[2574,3862,246,5792,5263,5497,8441,3794,7358],()=>e(e.s=84223)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3538],{43503:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var n=s(95155),r=s(12115),a=s(35497),l=s(57250);function i(e,t){return t.find(t=>t.id===e)?.name||e}function d(e){return String(e||"").trim().toLowerCase()}function o(e){return Array.isArray(e?.importedModels)?e.importedModels:[]}function c(){let[e,t]=(0,r.useState)(!0),[s,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(""),[h,u]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[g,j]=(0,r.useState)(!1),[f,y]=(0,r.useState)([]),[v,N]=(0,r.useState)([]),[k,w]=(0,r.useState)(null),[C,A]=(0,r.useState)(null),[I,M]=(0,r.useState)(""),[S,O]=(0,r.useState)(null),[$,T]=(0,r.useState)([]),[E,R]=(0,r.useState)(!1),[K,q]=(0,r.useState)(""),[z,U]=(0,r.useState)([]),[P,F]=(0,r.useState)(!1),[B,L]=(0,r.useState)(!1),[D,_]=(0,r.useState)({}),[G,H]=(0,r.useState)({}),[J,X]=(0,r.useState)(""),[Z,V]=(0,r.useState)({}),[W,Q]=(0,r.useState)(null),[Y,ee]=(0,r.useState)({}),[et,es]=(0,r.useState)(""),[en,er]=(0,r.useState)(""),[ea,el]=(0,r.useState)({}),[ei,ed]=(0,r.useState)({}),[eo,ec]=(0,r.useState)(""),[ex,em]=(0,r.useState)(!1),[eh,eu]=(0,r.useState)(!0),ep=(0,r.useCallback)(async()=>{t(!0),m("");try{let e=await fetch("/api/personal-cloud-providers",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được personal cloud providers");b(t.userId||""),j(!0===t.isAdmin),y(t.providers||[]),N(t.connections||[]),eu(!1!==t.globalRtkEnabled),el(t.routing||{}),ed(e=>{let s={...e};for(let[e,n]of Object.entries(t.routing||{}))s[e]={...n};return s}),X(e=>e||t.userId||"")}catch(e){m(e.message||"Kh\xf4ng tải được personal cloud providers")}finally{t(!1)}},[]),eb=(0,r.useCallback)(async()=>{if(g){L(!0);try{let e=await fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được quyền OAuth");_(t.permissions||{}),H(t.connectionsByUser||{})}catch(e){m(e.message||"Kh\xf4ng tải được quyền OAuth")}finally{L(!1)}}},[g]);(0,r.useEffect)(()=>{ep()},[ep]),(0,r.useEffect)(()=>{g&&eb()},[g,eb]),(0,r.useEffect)(()=>{let e=D[d(J)]||{},t={};for(let s of f)t[s.id]=!0===e[s.id];V(t)},[J,D,f]);let eg=(0,r.useMemo)(()=>{let e=d(S?.ownerUser||p);return e?$.filter(t=>d(t.ownerUser||t.createdByUser||p)===e):[]},[$,S,p]),ej=(0,r.useMemo)(()=>Array.from(new Set([...Object.keys(D||{}),...Object.keys(G||{})])).map(e=>{let t=D[e]||{},s=G[e]||{},n=f.filter(e=>t?.[e.id]===!0),r=f.some(e=>(s[e.id]||0)>0);return{userId:e,providerState:t,connectionsByProvider:s,enabledProviders:n,hasAnyConnection:r}}).filter(e=>e.enabledProviders.length>0||e.hasAnyConnection).sort((e,t)=>e.userId.localeCompare(t.userId)),[D,G,f]),ef=async()=>{w(null),u("OAuth account đ\xe3 được th\xeam. Model sẽ được import tự động nếu provider hỗ trợ."),await ep()},ey=async(e,t)=>{m(""),u("");try{let s=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));if(!s.ok)throw Error(n.error||"Kh\xf4ng cập nhật được connection");await ep()}catch(e){m(e.message||"Kh\xf4ng cập nhật được connection")}},ev=async e=>{m(""),u(""),M(e.id);try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/import-models`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng import được model");N(t=>t.map(t=>t.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t)),Q(t=>t?.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t);let n=s.modelImport?.source==="provider"?"provider":"catalog fallback";u(`Đ\xe3 cập nhật ${s.models?.length||0} model từ ${n}.`)}catch(e){m(e.message||"Kh\xf4ng import được model")}finally{M("")}},eN=async e=>{R(!0);try{let t=d(e?.ownerUser||p),s=t?`&ownerUser=${encodeURIComponent(t)}`:"",n=await fetch(`/api/keys?pageSize=100&status=active${s}`,{cache:"no-store"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||"Kh\xf4ng tải được API keys");let a=Array.isArray(r.keys)?r.keys:[];T(a);let l=d(r.userId),i=a.find(e=>d(e.ownerUser||e.createdByUser||l)===t);q(e=>e||i?.id||"")}catch(e){m(e.message||"Kh\xf4ng tải được API keys")}finally{R(!1)}},ek=async e=>{let t,s;m(""),u(""),O(e),U((s=(t=o(e)).filter(e=>"llm"===(e.type||"llm")).slice(0,3).map(e=>e.routeModel).filter(Boolean)).length>0?s:t.slice(0,3).map(e=>e.routeModel).filter(Boolean)),q(""),await eN(e)},ew=async()=>{if(!S)return;if(!K)return void m("Chọn API key cần th\xeam model.");let e=Array.from(new Set((Array.isArray(z)?z:[]).map(e=>String(e||"").trim()).filter(Boolean)));if(0===e.length)return void m("Chọn \xedt nhất một model.");F(!0),m(""),u("");try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(S.id)}/api-key-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyId:K,models:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng th\xeam được model v\xe0o API key");O(null),u(`Đ\xe3 th\xeam ${s.addedModels?.length||e.length} model v\xe0o API key ${s.key?.name||""}.`)}catch(e){m(e.message||"Kh\xf4ng th\xeam được model v\xe0o API key")}finally{F(!1)}},eC=async()=>{if(C){m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(C.id)}`,{method:"DELETE"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng x\xf3a được connection");A(null),await ep()}catch(e){m(e.message||"Kh\xf4ng x\xf3a được connection")}}},eA=async(e,t)=>{if(e?.id&&t?.routeModel){m(""),es(t.routeModel),ee(e=>({...e,[t.routeModel]:{...e[t.routeModel]||{},loading:!0}}));try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"POST"}),r=await n.json().catch(()=>({})),a={ok:r?.ok===!0,status:r?.status||n.status,text:r?.text||"",error:r?.error||(n.ok?"":"Test failed"),latencyMs:r?.latencyMs||0};ee(e=>({...e,[t.routeModel]:a}))}catch(e){ee(s=>({...s,[t.routeModel]:{ok:!1,error:e.message||"Test failed"}}))}finally{es("")}}},eI=async(e,t)=>{if(e?.id&&t?.routeModel&&window.confirm(`X\xf3a model ${t.routeModel} khỏi connection ${e.name||e.id}?`)){m(""),u(""),er(t.routeModel);try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"DELETE"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng x\xf3a được model");(e=>{if(!e?.connectionId&&!e?.id)return;let t=e.connectionId||e.id;N(s=>s.map(s=>s.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)),Q(s=>s?.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)})(r),ee(e=>{let s={...e};return delete s[t.routeModel],s}),u(`Đ\xe3 x\xf3a model ${t.routeModel}.`)}catch(e){m(e.message||"Kh\xf4ng x\xf3a được model")}finally{er("")}}},eM=(e,t)=>{ed(s=>{let n={...s[e]||{},...t};for(let e of Object.keys(n))(""===n[e]||void 0===n[e])&&delete n[e];return{...s,[e]:n}})},eS=async e=>{m(""),u(""),ec(e);try{let t=ei[e]||{},s={providerId:e,override:{fallbackStrategy:t.fallbackStrategy||"",stickyRoundRobinLimit:t.stickyRoundRobinLimit,stickyScope:t.stickyScope||"",stickyTtlMinutes:t.stickyTtlMinutes,stickyFallbackToClientIp:t.stickyFallbackToClientIp,stickyRebindOnFailure:t.stickyRebindOnFailure,stickyRebindFailureThreshold:t.stickyRebindFailureThreshold}},n=await fetch("/api/personal-cloud-providers/routing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng lưu được routing");el(r.routing||{}),u(`Đ\xe3 cập nhật routing cho ${e}.`)}catch(e){m(e.message||"Kh\xf4ng lưu được routing")}finally{ec("")}},eO=async e=>{m(""),u(""),ec(e);try{let t=await fetch(`/api/personal-cloud-providers/routing?providerId=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s?.error||"Kh\xf4ng reset được routing");el(s.routing||{}),ed(t=>{let s={...t};return delete s[e],s}),u(`Đ\xe3 reset ${e} về ch\xednh s\xe1ch mặc định.`)}catch(e){m(e.message||"Kh\xf4ng reset được routing")}finally{ec("")}},e$=async()=>{let e=d(J);if(!e)return void m("Nhập username/email cần cấp quyền.");c(!0),m(""),u("");try{let t=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,providers:Z})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng lưu được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{});let n=s.user?.id||e;n!==e&&X(n),u(`Đ\xe3 lưu quyền OAuth cho ${n}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng lưu được quyền OAuth")}finally{c(!1)}},eT=async e=>{let t=d(e);if(t&&window.confirm(`Thu hồi to\xe0n bộ quyền OAuth provider của ${t}? OAuth account của user n\xe0y sẽ bị X\xd3A hẳn (token, model đ\xe3 import) v\xe0 model tương ứng sẽ bị gỡ khỏi mọi API key đ\xe3 g\xe1n. H\xe0nh động n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.`)){c(!0),m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(t)}`,{method:"DELETE"}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng thu hồi được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{}),d(J)===t&&X(""),u(`Đ\xe3 thu hồi quyền v\xe0 x\xf3a OAuth account của ${t}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{c(!1)}}},eE=k?function(e={}){return{id:e.id,name:e.name||e.id,icon:e.icon||"cloud",color:e.color||"#64748b",website:e.website||"",notice:e.notice||null,deprecationNotice:e.deprecationNotice||"",serviceKinds:e.serviceKinds||["llm"]}}(k):null,eR=g?f:f.filter(e=>e.enabled),eK=o(S),eq=S?.modelImport||{},ez=o(W);return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Personal Cloud Providers"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Kết nối OAuth c\xe1 nh\xe2n cho Claude Code, OpenAI Codex v\xe0 Antigravity. Account c\xe1 nh\xe2n chỉ owner nh\xecn thấy, chỉ API key của owner được d\xf9ng. Cột RTK cho ph\xe9p override ri\xeang từng account (Lu\xf4n ON / Lu\xf4n OFF) bất kể cấu h\xecnh RTK global ở /dashboard/endpoint đang on hay off — để trống th\xec theo global."})]}),(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface px-4 py-3 text-sm",children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Current user"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-text-main",children:p||"—"})]})]})}),x?(0,n.jsx)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:x}):null,h?(0,n.jsx)("div",{className:"rounded-2xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:h}):null,(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===f.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted lg:col-span-3",children:"Admin chưa cấp quyền personal OAuth provider n\xe0o cho user n\xe0y."}):f.map(e=>(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("span",{className:"inline-flex size-10 shrink-0 items-center justify-center rounded-xl",style:{backgroundColor:`${e.color||"#64748b"}22`},children:(0,n.jsx)(l.A,{src:`/providers/${e.id}.png`,alt:e.name,size:34,className:"max-h-[34px] max-w-[34px] rounded-lg object-contain",fallbackText:e.id.slice(0,2).toUpperCase(),fallbackColor:e.color||"#64748b"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"font-semibold text-text-main",children:e.name}),e.enabled?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Enabled"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Locked"})]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e.enabled?"Được admin cấp quyền, c\xf3 thể add OAuth account c\xe1 nh\xe2n.":"Admin chưa cấp quyền cho user n\xe0y."})]})]}),e.deprecationNotice?(0,n.jsx)("p",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:e.deprecationNotice}):null,(0,n.jsxs)(a.$n,{fullWidth:!0,disabled:!e.enabled,onClick:()=>{e.enabled&&w(e)},icon:"add_link",children:["Add ",e.name," account"]})]},e.id))}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"My personal accounts"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"OAuth xong sẽ tự import model nếu provider hỗ trợ. Nếu kh\xf4ng gọi được endpoint model, hệ thống d\xf9ng catalog fallback để user vẫn chọn được model."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:ep,loading:e,icon:"refresh",children:"Refresh"})]}),e?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải..."}):0===v.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Chưa c\xf3 personal OAuth account n\xe0o."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Connection"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Models"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Created"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Active"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["RTK (Token Savings)",(0,n.jsxs)(a.Ex,{variant:eh?"success":"default",size:"sm",className:"normal-case",children:["Global: ",eh?"ON":"OFF"]}),(0,n.jsx)("button",{type:"button",onClick:()=>em(!0),title:"RTK l\xe0 g\xec? Bấm để xem giải th\xedch",className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-border text-[10px] font-bold normal-case text-text-muted transition-colors hover:border-brand-500 hover:text-brand-600",children:"?"})]})}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:v.map(e=>{let t=Array.isArray(e?.availableModels)?e.availableModels:[],s=e.modelImport||{};return(0,n.jsxs)("tr",{className:"align-top hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("div",{className:"mt-1 font-mono text-xs text-text-muted",children:e.id})]}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:24,className:"max-h-[24px] max-w-[24px] rounded object-contain",fallbackText:e.provider.slice(0,2).toUpperCase()}),(0,n.jsx)("span",{children:i(e.provider,f)})]})}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all text-text-main",children:e.email||e.displayName||"—"}),(0,n.jsxs)("div",{className:"mt-1 break-all text-xs text-text-muted",children:["Owner: ",e.ownerUser||p||"—"]})]}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[function(e={}){return"provider"===(e.source||"catalog")?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Imported"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Catalog"})}(s),(0,n.jsxs)("span",{className:"text-xs text-text-muted",children:[t.length," model(s)"]})]}),s.warning?(0,n.jsx)("div",{className:"mt-1 max-w-[320px] truncate text-xs text-amber-600 dark:text-amber-300",title:s.warning,children:s.warning}):null,t.length>0?(0,n.jsxs)("div",{className:"mt-2 flex max-w-[360px] flex-wrap gap-1",children:[t.slice(0,4).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 font-mono text-[11px] text-text-muted",children:e.routeModel},e.routeModel)),t.length>4?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:["+",t.length-4]}):null]}):null]}),(0,n.jsx)("td",{className:"px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"—";try{return new Intl.DateTimeFormat("vi-VN",{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}(e.createdAt)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsx)(a.lM,{checked:!1!==e.isActive,onChange:t=>ey(e.id,{isActive:t})})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("select",{value:!0===e.rtkEnabled?"on":!1===e.rtkEnabled?"off":"inherit",onChange:t=>{let s=t.target.value;ey(e.id,{rtkEnabled:"inherit"===s?null:"on"===s})},className:"h-9 w-full min-w-[140px] rounded-xl border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-brand-500",children:[(0,n.jsx)("option",{value:"inherit",children:"Theo global"}),(0,n.jsx)("option",{value:"on",children:"Lu\xf4n ON"}),(0,n.jsx)("option",{value:"off",children:"Lu\xf4n OFF"})]})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:I===e.id,onClick:()=>ev(e),children:"Import models"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",disabled:0===o(e).length,onClick:()=>{m(""),u(""),Q(e),ee({}),es(""),er("")},children:"Manage models"}),(0,n.jsx)(a.$n,{variant:"secondary",size:"sm",disabled:0===o(e).length,onClick:()=>ek(e),children:"Add to API key"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>{let t;return t=window.prompt("T\xean connection mới",e.name||""),void(t?.trim()&&ey(e.id,{name:t.trim()}))},children:"Rename"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",onClick:()=>A(e),children:"Delete"})]})})]},e.id)})})]})})]}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Routing strategy"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Khi bạn c\xf3 nhiều personal account cho c\xf9ng provider, đ\xe2y l\xe0 ch\xednh s\xe1ch chọn account cho từng request. Để trống = kế thừa ch\xednh s\xe1ch của admin ở ",(0,n.jsx)("span",{className:"font-mono",children:"/dashboard/providers/<provider>"}),"."]})]}),(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===eR.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted lg:col-span-3",children:"Bạn chưa được cấp quyền provider n\xe0o, n\xean chưa cần thiết lập routing."}):eR.map(e=>{let t=ei[e.id]||{},s=ea[e.id]||null,r=!s,l=t.fallbackStrategy||"",i="round-robin"===l,d=eo===e.id;return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:r?"Đang kế thừa policy global":`Override active: ${s.fallbackStrategy||"inherit"}`})]}),r?(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"Inherit"}):(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Override"})]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"Strategy"}),(0,n.jsxs)("select",{value:l,onChange:t=>eM(e.id,{fallbackStrategy:t.target.value}),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"Inherit (use global)"}),(0,n.jsx)("option",{value:"fill-first",children:"fill-first — chạy hết account 1 mới sang account 2"}),(0,n.jsx)("option",{value:"round-robin",children:"round-robin — lu\xe2n phi\xean theo sticky limit"}),(0,n.jsx)("option",{value:"least-latency",children:"least-latency — chọn account nhanh nhất"}),(0,n.jsx)("option",{value:"p2c",children:"p2c — power-of-two-choices"})]})]}),i?(0,n.jsxs)("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Round-robin sticky params (để trống = d\xf9ng gi\xe1 trị global)"}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky limit (số request li\xean tiếp trước khi rotate)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyRoundRobinLimit??"",onChange:t=>eM(e.id,{stickyRoundRobinLimit:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 3",disabled:d})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky scope"}),(0,n.jsxs)("select",{value:t.stickyScope||"",onChange:t=>eM(e.id,{stickyScope:t.target.value}),className:"h-9 w-full rounded-xl border border-border bg-background px-3 text-xs text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"(inherit)"}),(0,n.jsx)("option",{value:"global",children:"global — rotate cho mọi request"}),(0,n.jsx)("option",{value:"client_ip",children:"client_ip — sticky theo IP"}),(0,n.jsx)("option",{value:"client_session",children:"client_session — sticky theo CLI session"})]})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky TTL (ph\xfat)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyTtlMinutes??"",onChange:t=>eM(e.id,{stickyTtlMinutes:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 120",disabled:d})]})]}):null,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,n.jsx)(a.$n,{size:"sm",loading:d,onClick:()=>eS(e.id),children:"Save"}),(0,n.jsx)(a.$n,{size:"sm",variant:"ghost",disabled:d||r,onClick:()=>eO(e.id),children:"Reset to inherit"})]})]},e.id)})})]}),g?(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Nhập username/email rồi bật provider được ph\xe9p add personal account."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-end",children:[(0,n.jsx)(a.pd,{label:"User ID / Email",value:J,onChange:e=>X(e.target.value),placeholder:"anh-tct hoặc anh-tct@fujinet.net"}),(0,n.jsx)(a.$n,{onClick:e$,loading:s,icon:"save",children:"Save permissions"})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:f.map(e=>(0,n.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,n.jsx)(a.lM,{checked:!0===Z[e.id],onChange:t=>V(s=>({...s,[e.id]:t})),label:e.name,description:Z[e.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},e.id))}),(0,n.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,n.jsxs)("div",{className:"mb-3 flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Danh s\xe1ch user hiện đang được cấp quyền add personal OAuth account."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:eb,loading:B,icon:"refresh",children:"Refresh list"})]}),B?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):0===ej.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),f.map(e=>(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:e.name},e.id)),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ej.map(e=>(0,n.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all font-mono text-text-main",children:e.userId}),d(J)===e.userId?(0,n.jsx)("div",{className:"mt-1 text-xs text-brand-600 dark:text-brand-300",children:"Đang edit ở form ph\xeda tr\xean"}):null]}),f.map(t=>{let s=!0===e.providerState[t.id],r=e.connectionsByProvider?.[t.id]||0,i=r>0;return(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[s?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"ON"}):(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"OFF"}),i?(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${r} ${t.name} account${r>1?"s":""}`,children:[(0,n.jsx)(l.A,{src:`/providers/${t.id}.png`,alt:t.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:t.id.slice(0,2).toUpperCase(),fallbackColor:t.color||"#64748b"}),r>1?(0,n.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",r]}):null]}):null]})},t.id)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>(e=>{let t=d(e);X(t);let s=D[t]||{},n={};for(let e of f)n[e.id]=!0===s[e.id];V(n)})(e.userId),children:"Edit"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:s,onClick:()=>eT(e.userId),children:"Revoke"})]})})]},e.userId))})]})})]})]}):null,S?(0,n.jsx)(a.aF,{isOpen:!!S,onClose:()=>O(null),title:"Add models to API key",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>O(null),disabled:P,children:"Cancel"}),(0,n.jsx)(a.$n,{onClick:ew,loading:P,disabled:!K||0===z.length,children:"Add selected models"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:S.name||S.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(S.provider,f)," \xb7 ",eK.length," imported model(s)"]}),eq.warning?(0,n.jsx)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-300",children:eq.warning}):null,0===eK.length?(0,n.jsx)("div",{className:"mt-2 rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:'Chưa import được model n\xe0o từ provider. Bấm "Import models" tr\xean d\xf2ng connection trước khi g\xe1n v\xe0o API key.'}):null]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"API key"}),(0,n.jsxs)("select",{value:K,onChange:e=>q(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:E,children:[(0,n.jsx)("option",{value:"",children:E?"Đang tải API keys...":"Chọn API key"}),eg.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," \xb7 ",e.ownerUser||p]},e.id))]})]}),0!==eg.length||E?null:(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-300",children:"User n\xe0y chưa c\xf3 API key active để th\xeam model."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Models"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Model được lưu v\xe0o allowedModels của API key. Request sẽ route qua personal OAuth account của owner."})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>U(eK.map(e=>e.routeModel).filter(Boolean)),children:"Select all"}),(0,n.jsx)(a.$n,{variant:"ghost",size:"sm",onClick:()=>U([]),children:"Clear"})]})]}),(0,n.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:eK.map(e=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border border-border bg-background p-3 hover:bg-surface",children:[(0,n.jsx)("input",{type:"checkbox",className:"mt-1",checked:z.includes(e.routeModel),onChange:()=>{var t;return t=e.routeModel,void U(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("span",{className:"mt-1 block break-all font-mono text-xs text-text-muted",children:e.routeModel}),e.type&&"llm"!==e.type?(0,n.jsx)("span",{className:"mt-2 inline-flex rounded-full bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:e.type}):null]})]},e.routeModel))})]})}):null,W?(0,n.jsx)(a.aF,{isOpen:!!W,onClose:()=>Q(null),title:"Manage imported models",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>Q(null),children:"Close"}),(0,n.jsx)(a.$n,{variant:"outline",loading:I===W.id,onClick:()=>ev(W),icon:"refresh",children:"Re-import from provider"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:W.name||W.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(W.provider,f)," \xb7 ",ez.length," imported model(s)"]}),(0,n.jsx)("div",{className:"mt-2 text-xs text-text-muted",children:'Test gửi 1 prompt "Say hello in five words" qua ch\xednh OAuth account của bạn, qua đ\xfang proxy của connection. X\xf3a model sẽ bỏ n\xf3 khỏi list importable; c\xe1c API key đ\xe3 gắn model n\xe0y kh\xf4ng bị thay đổi (request đến model đ\xf3 sẽ do provider ph\xeda tr\xean quyết định chấp nhận hay kh\xf4ng).'})]}),0===ez.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:'Chưa c\xf3 model n\xe0o được import. Bấm "Re-import from provider".'}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Route ID"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Test result"}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ez.map(e=>{let t=Y[e.routeModel],s=et===e.routeModel,r=en===e.routeModel;return(0,n.jsxs)("tr",{className:"align-top",children:[(0,n.jsxs)("td",{className:"px-4 py-3",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),e.type&&"llm"!==e.type?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.type}):null]}),(0,n.jsx)("td",{className:"px-4 py-3 font-mono text-xs text-text-muted break-all",children:e.routeModel}),(0,n.jsx)("td",{className:"px-4 py-3 text-xs",children:s?(0,n.jsx)("span",{className:"text-text-muted",children:"Đang test..."}):t?t.ok?(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-green-700 dark:text-green-300",children:["OK \xb7 ",t.latencyMs||0,"ms"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.text||"").slice(0,200)})]}):(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-red-700 dark:text-red-300",children:["FAIL \xb7 status ",t.status||"?"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.error||"").slice(0,200)})]}):(0,n.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,n.jsx)("td",{className:"px-4 py-3",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:s,disabled:r,onClick:()=>eA(W,e),children:"Say hello"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:r,disabled:s,onClick:()=>eI(W,e),children:"Delete"})]})})]},e.routeModel)})})]})})]})}):null,ex?(0,n.jsx)(a.aF,{isOpen:ex,onClose:()=>em(!1),title:"RTK (Token Savings) l\xe0 g\xec?",size:"xl",footer:(0,n.jsx)(a.$n,{onClick:()=>em(!1),children:"Đ\xe3 hiểu"}),children:(0,n.jsxs)("div",{className:"space-y-5 text-sm text-text-main",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2",children:[(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Global RTK hiện đang:"}),(0,n.jsx)(a.Ex,{variant:eh?"success":"default",size:"sm",children:eh?"ON":"OFF"}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:'— \xe1p dụng cho mọi account chọn "Theo global"'})]}),(0,n.jsx)("p",{className:"text-text-muted",children:"RTK l\xe0 bộ lọc n\xe9n output của tool (Bash, Grep, Glob, Read...) ngay trong request trước khi gửi l\xean model, gi\xfap giảm số token phải gửi m\xe0 kh\xf4ng l\xe0m mất th\xf4ng tin quan trọng — chỉ t\xe1c động tới phần tool output, kh\xf4ng đụng v\xe0o nội dung chat."}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hoạt động ra sao với CLI tool"}),(0,n.jsx)("p",{className:"text-text-muted",children:"Mỗi khi Claude Code / Codex CLI / OpenCode... gọi tool v\xe0 nhận lại output, RTK tự nhận diện định dạng quen thuộc rồi r\xfat gọn theo đ\xfang cấu tr\xfac của n\xf3:"}),(0,n.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git diff"})," — giữ v\xe0i d\xf2ng context quanh thay đổi, cắt phần hunk qu\xe1 d\xe0i"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git status"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git log"})," — gom gọn danh s\xe1ch file thay đổi, danh s\xe1ch commit"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"grep"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"find"})," — giới hạn số match hiển thị mỗi file/thư mục"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"ls -la"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"tree"})," — t\xf3m tắt theo loại file, cắt c\xe2y thư mục qu\xe1 s\xe2u"]}),(0,n.jsx)("li",{children:"Build log (npm/yarn/cargo...) — chỉ giữ d\xf2ng quan trọng (lỗi, kết quả build)"}),(0,n.jsx)("li",{children:"Output d\xe0i chung kh\xf4ng r\xf5 định dạng — fallback dedup d\xf2ng lặp hoặc smart-truncate (giữ đầu + cuối)"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hiệu quả thực tế"}),(0,n.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full text-xs",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Loại output"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Trước"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Sau"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tiết kiệm"})]})}),(0,n.jsxs)("tbody",{className:"divide-y divide-border",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"git diff"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"7384B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3894B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"47.3%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"grep -n"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3723B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"1447B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"61.1%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"find"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"729B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"264B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"63.8%"})]})]})]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Khi n\xe0o KH\xd4NG bị n\xe9n"}),(0,n.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsx)("li",{children:"Chat thường kh\xf4ng gọi tool — kh\xf4ng c\xf3 g\xec để n\xe9n"}),(0,n.jsx)("li",{children:"Output nhỏ hơn 500B — kh\xf4ng đ\xe1ng n\xe9n"}),(0,n.jsxs)("li",{children:["Output b\xe1o lỗi (",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"is_error"}),") — lu\xf4n giữ nguy\xean để debug"]}),(0,n.jsx)("li",{children:"Output lớn hơn 10MB — bỏ qua để tr\xe1nh tốn CPU xử l\xfd"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Global vs từng account"}),(0,n.jsxs)("p",{className:"text-text-muted",children:["Dropdown RTK ở bảng tr\xean cho ph\xe9p override ri\xeang từng account:",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Theo global"})," (mặc định, d\xf9ng đ\xfang setting global),",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n ON"})," hoặc",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n OFF"})," — override lu\xf4n thắng global theo cả 2 chiều, n\xean c\xf3 thể để global OFF v\xe0 chỉ bật cho account d\xf9ng CLI tool, hoặc ngược lại."]})]})]})}):null,eE?(0,n.jsx)(a.LF,{isOpen:!!k,provider:k.id,providerInfo:eE,connectionScope:"personal",onSuccess:ef,onClose:()=>w(null)}):null,C?(0,n.jsx)(a.uo,{isOpen:!!C,onClose:()=>A(null),onConfirm:eC,title:"Delete personal account",message:`X\xf3a connection ${C.name||C.id}?`,confirmText:"Delete",cancelText:"Cancel",variant:"danger"}):null]})}},47584:(e,t,s)=>{Promise.resolve().then(s.bind(s,43503))}},e=>{e.O(0,[2574,3862,246,5792,5263,5497,8441,3794,7358],()=>e(e.s=47584)),_N_E=e.O()}]);
|