@cartanova/qgrid-cli 2.10.9 → 2.11.0
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/bundle/dist/_virtual/_rolldown/runtime.js +1 -10
- package/bundle/dist/application/monit/log-buffer.js +12 -6
- package/bundle/dist/application/monit/monit.frame.js +11 -3
- package/bundle/dist/application/monit/monit.types.js +1 -1
- package/bundle/dist/application/qgrid/conv-routing.js +9 -6
- package/bundle/dist/application/qgrid/expired-token-reminder.js +2 -2
- package/bundle/dist/application/qgrid/oauth.js +31 -4
- package/bundle/dist/application/qgrid/qgrid-image-generation.js +1 -1
- package/bundle/dist/application/qgrid/qgrid-response-format.js +22 -20
- package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +43 -34
- package/bundle/dist/application/qgrid/qgrid.dispatcher.js +128 -93
- package/bundle/dist/application/qgrid/qgrid.frame.js +930 -49
- package/bundle/dist/application/qgrid/qgrid.types.js +212 -5
- package/bundle/dist/application/qgrid/schema-prompt.js +75 -48
- package/bundle/dist/application/qgrid/slack-user-map.js +1 -1
- package/bundle/dist/application/qgrid/token-death.js +1 -1
- package/bundle/dist/application/qgrid/token-subscriber.js +83 -30
- package/bundle/dist/application/qgrid/token-trigger-setup.js +1 -1
- package/bundle/dist/application/qgrid/token-window-keepalive.js +8 -6
- package/bundle/dist/application/qgrid/tool-emulation-schema.js +13 -13
- package/bundle/dist/application/qgrid/tool-emulation.js +19 -15
- package/bundle/dist/application/request-log/json-schema-type-text.js +29 -12
- package/bundle/dist/application/request-log/request-log.model.js +83 -69
- package/bundle/dist/application/request-log/request-log.types.js +8 -2
- package/bundle/dist/application/request-log/zod-code-format.js +1 -1
- package/bundle/dist/application/request-log-step/request-log-step.model.js +1 -1
- package/bundle/dist/application/request-log-step/request-log-step.types.js +1 -1
- package/bundle/dist/application/setting/setting.constant.js +1 -1
- package/bundle/dist/application/setting/setting.model.js +2 -2
- package/bundle/dist/application/setting/setting.store.js +2 -2
- package/bundle/dist/application/setting/setting.types.js +1 -1
- package/bundle/dist/application/sonamu.generated.js +40 -16
- package/bundle/dist/application/sonamu.generated.sso.js +2 -1
- package/bundle/dist/application/token/token.model.js +26 -9
- package/bundle/dist/application/token/token.types.js +20 -3
- package/bundle/dist/i18n/en.js +15 -1
- package/bundle/dist/i18n/ko.js +15 -1
- package/bundle/dist/i18n/sd.generated.js +2 -1
- package/bundle/dist/migrations/20260807133553_manual__backfill_request_log_cost.js +8 -6
- package/bundle/dist/migrations/20261018215031_alter_request_logs_add1_alter1.js +15 -0
- package/bundle/dist/server-bootstrap.js +4 -2
- package/bundle/dist/server-error-handler.js +1 -1
- package/bundle/dist/sonamu.config.js +37 -8
- package/bundle/dist/startup-migrations.js +17 -7
- package/bundle/dist/testing/global.js +1 -1
- package/bundle/dist/testing/schema-bench.js +0 -0
- package/bundle/dist/testing/test-database-name.js +1 -1
- package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +1 -1
- package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +11 -5
- package/bundle/dist/utils/providers/anthropic/anthropic-quota.js +4 -4
- package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +1 -1
- package/bundle/dist/utils/providers/anthropic/claude-session.js +20 -19
- package/bundle/dist/utils/providers/anthropic/fence-strip.js +1 -1
- package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +49 -23
- package/bundle/dist/utils/providers/common/credentials.js +5 -1
- package/bundle/dist/utils/providers/common/effort.js +3 -3
- package/bundle/dist/utils/providers/common/model-cost.js +69 -14
- package/bundle/dist/utils/providers/common/provider-types.js +29 -1
- package/bundle/dist/utils/providers/common/schema-validation.js +78 -40
- package/bundle/dist/utils/providers/common/smooth-weighted-round-robin.js +1 -1
- package/bundle/dist/utils/providers/common/strictifier.js +62 -43
- package/bundle/dist/utils/providers/common/thinking.js +3 -2
- package/bundle/dist/utils/providers/common/ttft.js +1 -1
- package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +427 -0
- package/bundle/dist/utils/providers/grok/grok-constants.js +55 -0
- package/bundle/dist/utils/providers/grok/grok-direct-client.js +196 -0
- package/bundle/dist/utils/providers/grok/grok-dispatcher.js +1313 -0
- package/bundle/dist/utils/providers/grok/grok-headers.js +118 -0
- package/bundle/dist/utils/providers/grok/grok-media-client.js +420 -0
- package/bundle/dist/utils/providers/grok/grok-models.js +114 -0
- package/bundle/dist/utils/providers/grok/grok-oauth.js +455 -0
- package/bundle/dist/utils/providers/grok/grok-quota.js +119 -0
- package/bundle/dist/utils/providers/grok/grok-refresh.js +192 -0
- package/bundle/dist/utils/providers/grok/grok-types.js +186 -0
- package/bundle/dist/utils/providers/grok/grok-voice-client.js +199 -0
- package/bundle/dist/utils/providers/grok/index.js +11 -0
- package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +111 -83
- package/bundle/dist/utils/providers/openai/openai-callback-relay.js +3 -2
- package/bundle/dist/utils/providers/openai/openai-constants.js +1 -1
- package/bundle/dist/utils/providers/openai/openai-direct-client.js +23 -7
- package/bundle/dist/utils/providers/openai/openai-dispatcher.js +143 -106
- package/bundle/dist/utils/providers/openai/openai-image-generation.js +48 -33
- package/bundle/dist/utils/providers/openai/openai-oauth.js +28 -13
- package/bundle/dist/utils/providers/openai/openai-quota.js +38 -27
- package/bundle/dist/utils/providers/openai/openai-refresh.js +17 -9
- package/bundle/dist/utils/providers/openai/openai-sse.js +1 -1
- package/bundle/dist/utils/providers/openai/openai-transport-config.js +1 -1
- package/bundle/dist/utils/quiet-hours.js +1 -1
- package/bundle/dist/utils/slack-notify.js +14 -8
- package/bundle/dist/utils/subset-loaders.js +4 -5
- package/bundle/src/application/monit/log-buffer.ts +23 -9
- package/bundle/src/application/monit/monit.frame.ts +22 -5
- package/bundle/src/application/monit/monit.types.ts +6 -0
- package/bundle/src/application/qgrid/conv-routing.test.ts +76 -4
- package/bundle/src/application/qgrid/conv-routing.ts +35 -9
- package/bundle/src/application/qgrid/expired-token-reminder.ts +9 -1
- package/bundle/src/application/qgrid/oauth.ts +51 -15
- package/bundle/src/application/qgrid/qgrid-image-generation.ts +9 -0
- package/bundle/src/application/qgrid/qgrid-response-format.ts +50 -25
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +33 -0
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +87 -40
- package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +97 -0
- package/bundle/src/application/qgrid/qgrid.dispatcher.ts +274 -126
- package/bundle/src/application/qgrid/qgrid.frame.test.ts +1013 -3
- package/bundle/src/application/qgrid/qgrid.frame.ts +1415 -60
- package/bundle/src/application/qgrid/qgrid.types.ts +335 -0
- package/bundle/src/application/qgrid/schema-prompt.ts +105 -41
- package/bundle/src/application/qgrid/slack-user-map.ts +5 -0
- package/bundle/src/application/qgrid/token-death.ts +4 -0
- package/bundle/src/application/qgrid/token-subscriber.test.ts +21 -19
- package/bundle/src/application/qgrid/token-subscriber.ts +186 -53
- package/bundle/src/application/qgrid/token-trigger-setup.ts +2 -0
- package/bundle/src/application/qgrid/token-window-keepalive.ts +49 -6
- package/bundle/src/application/qgrid/tool-emulation-schema.ts +33 -29
- package/bundle/src/application/qgrid/tool-emulation.ts +52 -27
- package/bundle/src/application/request-log/json-schema-type-text.test.ts +5 -5
- package/bundle/src/application/request-log/json-schema-type-text.ts +81 -26
- package/bundle/src/application/request-log/request-log.entity.json +8 -0
- package/bundle/src/application/request-log/request-log.model.test.ts +111 -4
- package/bundle/src/application/request-log/request-log.model.ts +279 -145
- package/bundle/src/application/request-log/request-log.types.ts +17 -0
- package/bundle/src/application/request-log/zod-code-format.ts +11 -0
- package/bundle/src/application/request-log-step/request-log-step.model.ts +1 -0
- package/bundle/src/application/request-log-step/request-log-step.types.ts +2 -0
- package/bundle/src/application/setting/setting.constant.ts +9 -0
- package/bundle/src/application/setting/setting.model.ts +12 -2
- package/bundle/src/application/setting/setting.store.ts +5 -1
- package/bundle/src/application/setting/setting.types.ts +8 -0
- package/bundle/src/application/sonamu.generated.http +135 -0
- package/bundle/src/application/sonamu.generated.sso.ts +3 -0
- package/bundle/src/application/sonamu.generated.ts +29 -0
- package/bundle/src/application/token/token.identity.test.ts +20 -0
- package/bundle/src/application/token/token.model.ts +66 -7
- package/bundle/src/application/token/token.types.ts +24 -1
- package/bundle/src/i18n/en.ts +19 -0
- package/bundle/src/i18n/ko.ts +21 -0
- package/bundle/src/i18n/sd.generated.ts +24 -2
- package/bundle/src/migrations/20260807133553_manual__backfill_request_log_cost.ts +16 -8
- package/bundle/src/migrations/20261018215031_alter_request_logs_add1_alter1.ts +15 -0
- package/bundle/src/server-bootstrap.ts +4 -2
- package/bundle/src/server-error-handler.ts +1 -0
- package/bundle/src/sonamu.config.ts +69 -7
- package/bundle/src/startup-migrations.ts +27 -9
- package/bundle/src/testing/global.ts +20 -0
- package/bundle/src/testing/schema-bench.ts +105 -30
- package/bundle/src/testing/test-database-name.ts +2 -0
- package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +8 -0
- package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +41 -6
- package/bundle/src/utils/providers/anthropic/anthropic-quota.ts +7 -3
- package/bundle/src/utils/providers/anthropic/anthropic-thinking.ts +6 -0
- package/bundle/src/utils/providers/anthropic/claude-session.ts +58 -24
- package/bundle/src/utils/providers/anthropic/fence-strip.ts +11 -0
- package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +110 -45
- package/bundle/src/utils/providers/common/credentials.ts +8 -0
- package/bundle/src/utils/providers/common/effort.ts +9 -2
- package/bundle/src/utils/providers/common/model-cost.test.ts +48 -1
- package/bundle/src/utils/providers/common/model-cost.ts +259 -158
- package/bundle/src/utils/providers/common/provider-dispatcher.ts +98 -2
- package/bundle/src/utils/providers/common/provider-types.ts +46 -3
- package/bundle/src/utils/providers/common/schema-validation.test.ts +5 -1
- package/bundle/src/utils/providers/common/schema-validation.ts +124 -56
- package/bundle/src/utils/providers/common/smooth-weighted-round-robin.ts +4 -0
- package/bundle/src/utils/providers/common/strictifier.ts +185 -59
- package/bundle/src/utils/providers/common/thinking.ts +2 -2
- package/bundle/src/utils/providers/common/ttft.ts +4 -2
- package/bundle/src/utils/providers/grok/__fixtures__/golden-responses-1.0.60.json +164 -0
- package/bundle/src/utils/providers/grok/grok-backend-protocol.test.ts +325 -0
- package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +721 -0
- package/bundle/src/utils/providers/grok/grok-constants.ts +105 -0
- package/bundle/src/utils/providers/grok/grok-direct-client.test.ts +179 -0
- package/bundle/src/utils/providers/grok/grok-direct-client.ts +313 -0
- package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +1395 -0
- package/bundle/src/utils/providers/grok/grok-dispatcher.ts +2105 -0
- package/bundle/src/utils/providers/grok/grok-headers.test.ts +149 -0
- package/bundle/src/utils/providers/grok/grok-headers.ts +199 -0
- package/bundle/src/utils/providers/grok/grok-media-client.test.ts +446 -0
- package/bundle/src/utils/providers/grok/grok-media-client.ts +703 -0
- package/bundle/src/utils/providers/grok/grok-models.test.ts +96 -0
- package/bundle/src/utils/providers/grok/grok-models.ts +161 -0
- package/bundle/src/utils/providers/grok/grok-oauth.test.ts +406 -0
- package/bundle/src/utils/providers/grok/grok-oauth.ts +771 -0
- package/bundle/src/utils/providers/grok/grok-quota.test.ts +142 -0
- package/bundle/src/utils/providers/grok/grok-quota.ts +198 -0
- package/bundle/src/utils/providers/grok/grok-refresh.test.ts +239 -0
- package/bundle/src/utils/providers/grok/grok-refresh.ts +325 -0
- package/bundle/src/utils/providers/grok/grok-types.test.ts +252 -0
- package/bundle/src/utils/providers/grok/grok-types.ts +374 -0
- package/bundle/src/utils/providers/grok/grok-voice-client.test.ts +321 -0
- package/bundle/src/utils/providers/grok/grok-voice-client.ts +284 -0
- package/bundle/src/utils/providers/grok/index.ts +20 -0
- package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +221 -137
- package/bundle/src/utils/providers/openai/openai-callback-relay.ts +12 -1
- package/bundle/src/utils/providers/openai/openai-constants.ts +2 -0
- package/bundle/src/utils/providers/openai/openai-direct-client.ts +111 -21
- package/bundle/src/utils/providers/openai/openai-dispatcher.ts +322 -169
- package/bundle/src/utils/providers/openai/openai-image-generation.ts +116 -36
- package/bundle/src/utils/providers/openai/openai-oauth.ts +48 -20
- package/bundle/src/utils/providers/openai/openai-quota.ts +77 -46
- package/bundle/src/utils/providers/openai/openai-refresh.ts +42 -18
- package/bundle/src/utils/providers/openai/openai-sse.ts +27 -3
- package/bundle/src/utils/providers/openai/openai-transport-config.ts +2 -0
- package/bundle/src/utils/quiet-hours.ts +12 -1
- package/bundle/src/utils/slack-notify.ts +44 -13
- package/bundle/src/utils/subset-loaders.ts +7 -7
- package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +1 -0
- package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +31 -0
- package/bundle/web-dist/client/assets/index-Be2qCZmI.css +1 -0
- package/bundle/web-dist/client/assets/logs-C47OJGEI.js +1 -0
- package/bundle/web-dist/client/assets/monit-BS9no0dU.js +4 -0
- package/bundle/web-dist/client/assets/plus-sdACTfH0.js +1 -0
- package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +1 -0
- package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +1 -0
- package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +5 -0
- package/bundle/web-dist/client/assets/{services.generated-BsieU37H.js → services.generated-CefiDXEv.js} +5 -5
- package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +1 -0
- package/bundle/web-dist/client/assets/show-u8Np69q3.js +2 -0
- package/bundle/web-dist/client/assets/tokens-QvP410NW.js +1 -0
- package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +1 -0
- package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +1 -0
- package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +1 -0
- package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +244 -0
- package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +1 -0
- package/bundle/web-dist/client/index.html +6 -6
- package/bundle/web-dist/server/assets/clsx-D_N5PN_2.js +16 -0
- package/bundle/web-dist/server/assets/{lazyRouteComponent-Dtd0NR4r.js → lazyRouteComponent-D8iTIHyn.js} +129 -2
- package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +825 -0
- package/bundle/web-dist/server/assets/{monit-DvzribSE.js → monit-B2hqorPe.js} +385 -126
- package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +28 -0
- package/bundle/web-dist/server/assets/{react-dom-B4a6-uuR.js → react-dom-BIYQzBqG.js} +2 -129
- package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +44 -0
- package/bundle/web-dist/server/assets/{request-model-CbqfnQOJ.js → request-model-I6OdODSH.js} +15 -6
- package/bundle/web-dist/server/assets/{routes-BAPWTizT.js → routes-B95YlUv2.js} +760 -213
- package/bundle/web-dist/server/assets/{services.generated-CEbGjsI0.js → services.generated-DQATJ6qf.js} +12821 -12194
- package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +830 -0
- package/bundle/web-dist/server/assets/{show-CxVZTAdv.js → show-Bxaj3rhH.js} +1355 -419
- package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +1038 -0
- package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +18 -0
- package/bundle/web-dist/server/assets/use-oauth-login-flow-CKDHgc3U.js +2379 -0
- package/bundle/web-dist/server/assets/{use-update-token-mutation-CfYmk_4_.js → use-update-token-mutation-BEbgOzaa.js} +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +4303 -22810
- package/dist/cli.js +9 -9
- package/package.json +4 -11
- package/postinstall.mjs +12 -0
- package/skills/qgrid/SKILL.md +1 -0
- package/skills/qgrid/references/cli-env-and-server-boot.md +4 -1
- package/skills/qgrid/references/decision-rationale.md +24 -1
- package/skills/qgrid/references/grok-runtime.md +89 -0
- package/skills/qgrid/references/provider-runtime-differences.md +30 -29
- package/skills/qgrid/references/repo-map.md +10 -0
- package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
- package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
- package/skills/qgrid/references/token-auth-quota-lifecycle.md +56 -3
- package/bundle/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -406
- package/bundle/dist/node_modules/.pnpm/@vitest_expect@4.1.10/node_modules/@vitest/expect/dist/index.js +0 -1507
- package/bundle/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js +0 -887
- package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/chunk-artifact.js +0 -2756
- package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/index.js +0 -8
- package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/utils.js +0 -8
- package/bundle/dist/node_modules/.pnpm/@vitest_snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.js +0 -922
- package/bundle/dist/node_modules/.pnpm/@vitest_spy@4.1.10/node_modules/@vitest/spy/dist/index.js +0 -386
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +0 -121
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/constants.js +0 -51
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/diff.js +0 -1317
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js +0 -561
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js +0 -40
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js +0 -272
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/offset.js +0 -27
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/serialize.js +0 -77
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/source-map.js +0 -381
- package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/timers.js +0 -51
- package/bundle/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.js +0 -2986
- package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.js +0 -10
- package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.js +0 -109
- package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.js +0 -10
- package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.js +0 -10
- package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.js +0 -10
- package/bundle/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1126
- package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
- package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -432
- package/bundle/dist/node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js +0 -517
- package/bundle/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js +0 -101
- package/bundle/dist/node_modules/.pnpm/vite@8.0.3_@emnapi_core@1.11.2_@emnapi_runtime@1.11.2_@types_node@25.0.7_esbuild@0.27.4_5b35fc1fb85d2af4d105e0d74f940f50/node_modules/vite/dist/node/module-runner.js +0 -1265
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -9
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/benchmark.CX_oY03V.js +0 -41
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -19
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.Chj8NDwU.js +0 -202
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.DdgEv5B1.js +0 -46
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +0 -119
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js +0 -3044
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +0 -59
- package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/index.js +0 -28
- package/bundle/dist/testing/setup-mocks.js +0 -16
- package/bundle/src/testing/setup-mocks.ts +0 -44
- package/bundle/web-dist/client/assets/index-Bw2s88Ot.css +0 -1
- package/bundle/web-dist/client/assets/index-CrXKu_J8.js +0 -106
- package/bundle/web-dist/client/assets/logs-B2SmWJXA.js +0 -1
- package/bundle/web-dist/client/assets/monit-D-JwXXoA.js +0 -1
- package/bundle/web-dist/client/assets/plus-B62CuqT8.js +0 -1
- package/bundle/web-dist/client/assets/refresh-cw-NNcU0Cmq.js +0 -1
- package/bundle/web-dist/client/assets/request-model-CojtinqK.js +0 -1
- package/bundle/web-dist/client/assets/routes-C5r4gTvY.js +0 -5
- package/bundle/web-dist/client/assets/settings-D3tDSAck.js +0 -1
- package/bundle/web-dist/client/assets/show-Cah_kUKC.js +0 -2
- package/bundle/web-dist/client/assets/tokens-DU2Iyxxd.js +0 -1
- package/bundle/web-dist/client/assets/use-oauth-login-flow-D0UaR9_e.js +0 -1
- package/bundle/web-dist/client/assets/use-update-token-mutation-DAq0F8p-.js +0 -1
- package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
- package/bundle/web-dist/client/assets/vendor-tanstack-DJRQAbrY.js +0 -1
- package/bundle/web-dist/server/assets/logs-l91avYif.js +0 -509
- package/bundle/web-dist/server/assets/plus-KZrECewT.js +0 -19
- package/bundle/web-dist/server/assets/refresh-cw-BND93JrF.js +0 -23
- package/bundle/web-dist/server/assets/settings-BZR5HSAL.js +0 -461
- package/bundle/web-dist/server/assets/tokens-D1hb4eKk.js +0 -448
- package/bundle/web-dist/server/assets/use-oauth-login-flow-Cvdy0zF8.js +0 -178
- package/dist/cli.d.ts +0 -10
- /package/bundle/web-dist/client/assets/{cost-DH2jZbrw.js → cost-DB3HbU7T.js} +0 -0
- /package/bundle/web-dist/client/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
- /package/bundle/web-dist/server/assets/{cost-eEHeTRT5.js → cost-BC9yzyA9.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as require_react_dom } from "./react-dom-
|
|
3
|
-
import { o as
|
|
4
|
-
import { i as formatUsd } from "./cost-
|
|
5
|
-
import { t as useUpdateTokenMutation } from "./use-update-token-mutation-
|
|
6
|
-
import { n as
|
|
1
|
+
import { F as require_react, N as useQueryClient, k as require_jsx_dev_runtime, n as QgridService, o as TokenService, tt as __toESM } from "./services.generated-DQATJ6qf.js";
|
|
2
|
+
import { t as require_react_dom } from "./react-dom-BIYQzBqG.js";
|
|
3
|
+
import { i as o, n as useOAuthLoginFlow, r as OAuthCodeEntry, t as isOAuthProvider } from "./use-oauth-login-flow-CKDHgc3U.js";
|
|
4
|
+
import { i as formatUsd } from "./cost-BC9yzyA9.js";
|
|
5
|
+
import { t as useUpdateTokenMutation } from "./use-update-token-mutation-BEbgOzaa.js";
|
|
6
|
+
import { n as unpricedRequestTitle, t as unpricedRequestLabel } from "./total-cost-fTE9Xy82.js";
|
|
7
7
|
//#region ../../node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
|
|
8
8
|
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom());
|
|
9
9
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
@@ -2235,71 +2235,118 @@ function useSortable({ animateLayoutChanges = defaultAnimateLayoutChanges, attri
|
|
|
2235
2235
|
KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left;
|
|
2236
2236
|
//#endregion
|
|
2237
2237
|
//#region ~icons/lucide/gauge.jsx
|
|
2238
|
-
var
|
|
2239
|
-
var
|
|
2238
|
+
var import_jsx_dev_runtime = require_jsx_dev_runtime();
|
|
2239
|
+
var _jsxFileName$3 = "~icons/lucide/gauge.jsx";
|
|
2240
|
+
var lucideGauge = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
|
|
2240
2241
|
viewBox: "0 0 24 24",
|
|
2241
2242
|
width: "1.2em",
|
|
2242
2243
|
height: "1.2em",
|
|
2243
2244
|
...props,
|
|
2244
|
-
children: /* @__PURE__ */ (0,
|
|
2245
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
|
|
2245
2246
|
fill: "none",
|
|
2246
2247
|
stroke: "currentColor",
|
|
2247
2248
|
strokeLinecap: "round",
|
|
2248
2249
|
strokeLinejoin: "round",
|
|
2249
2250
|
strokeWidth: 2,
|
|
2250
2251
|
d: "m12 14l4-4M3.34 19a10 10 0 1 1 17.32 0"
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2252
|
+
}, void 0, false, {
|
|
2253
|
+
fileName: _jsxFileName$3,
|
|
2254
|
+
lineNumber: 2,
|
|
2255
|
+
columnNumber: 95
|
|
2256
|
+
}, void 0)
|
|
2257
|
+
}, void 0, false, {
|
|
2258
|
+
fileName: _jsxFileName$3,
|
|
2259
|
+
lineNumber: 2,
|
|
2260
|
+
columnNumber: 30
|
|
2261
|
+
}, void 0);
|
|
2253
2262
|
//#endregion
|
|
2254
2263
|
//#region ~icons/lucide/grip-vertical.jsx
|
|
2255
|
-
var
|
|
2264
|
+
var _jsxFileName$2 = "~icons/lucide/grip-vertical.jsx";
|
|
2265
|
+
var lucideGripVertical = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
|
|
2256
2266
|
viewBox: "0 0 24 24",
|
|
2257
2267
|
width: "1.2em",
|
|
2258
2268
|
height: "1.2em",
|
|
2259
2269
|
...props,
|
|
2260
|
-
children: /* @__PURE__ */ (0,
|
|
2270
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("g", {
|
|
2261
2271
|
fill: "none",
|
|
2262
2272
|
stroke: "currentColor",
|
|
2263
2273
|
strokeLinecap: "round",
|
|
2264
2274
|
strokeLinejoin: "round",
|
|
2265
2275
|
strokeWidth: 2,
|
|
2266
2276
|
children: [
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2268
2278
|
cx: 9,
|
|
2269
2279
|
cy: 12,
|
|
2270
2280
|
r: 1
|
|
2271
|
-
}
|
|
2272
|
-
|
|
2281
|
+
}, void 0, false, {
|
|
2282
|
+
fileName: _jsxFileName$2,
|
|
2283
|
+
lineNumber: 2,
|
|
2284
|
+
columnNumber: 200
|
|
2285
|
+
}, void 0),
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2273
2287
|
cx: 9,
|
|
2274
2288
|
cy: 5,
|
|
2275
2289
|
r: 1
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2290
|
+
}, void 0, false, {
|
|
2291
|
+
fileName: _jsxFileName$2,
|
|
2292
|
+
lineNumber: 2,
|
|
2293
|
+
columnNumber: 231
|
|
2294
|
+
}, void 0),
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2278
2296
|
cx: 9,
|
|
2279
2297
|
cy: 19,
|
|
2280
2298
|
r: 1
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2299
|
+
}, void 0, false, {
|
|
2300
|
+
fileName: _jsxFileName$2,
|
|
2301
|
+
lineNumber: 2,
|
|
2302
|
+
columnNumber: 261
|
|
2303
|
+
}, void 0),
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2283
2305
|
cx: 15,
|
|
2284
2306
|
cy: 12,
|
|
2285
2307
|
r: 1
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2308
|
+
}, void 0, false, {
|
|
2309
|
+
fileName: _jsxFileName$2,
|
|
2310
|
+
lineNumber: 2,
|
|
2311
|
+
columnNumber: 292
|
|
2312
|
+
}, void 0),
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2288
2314
|
cx: 15,
|
|
2289
2315
|
cy: 5,
|
|
2290
2316
|
r: 1
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2317
|
+
}, void 0, false, {
|
|
2318
|
+
fileName: _jsxFileName$2,
|
|
2319
|
+
lineNumber: 2,
|
|
2320
|
+
columnNumber: 324
|
|
2321
|
+
}, void 0),
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("circle", {
|
|
2293
2323
|
cx: 15,
|
|
2294
2324
|
cy: 19,
|
|
2295
2325
|
r: 1
|
|
2296
|
-
}
|
|
2326
|
+
}, void 0, false, {
|
|
2327
|
+
fileName: _jsxFileName$2,
|
|
2328
|
+
lineNumber: 2,
|
|
2329
|
+
columnNumber: 355
|
|
2330
|
+
}, void 0)
|
|
2297
2331
|
]
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2332
|
+
}, void 0, true, {
|
|
2333
|
+
fileName: _jsxFileName$2,
|
|
2334
|
+
lineNumber: 2,
|
|
2335
|
+
columnNumber: 102
|
|
2336
|
+
}, void 0)
|
|
2337
|
+
}, void 0, false, {
|
|
2338
|
+
fileName: _jsxFileName$2,
|
|
2339
|
+
lineNumber: 2,
|
|
2340
|
+
columnNumber: 37
|
|
2341
|
+
}, void 0);
|
|
2300
2342
|
//#endregion
|
|
2301
2343
|
//#region src/components/qgrid/UsageCard.tsx
|
|
2302
|
-
var
|
|
2344
|
+
var _jsxFileName$1 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/UsageCard.tsx";
|
|
2345
|
+
var QUOTA_THRESHOLD_PROVIDERS = new Set([
|
|
2346
|
+
"anthropic",
|
|
2347
|
+
"openai",
|
|
2348
|
+
"grok"
|
|
2349
|
+
]);
|
|
2303
2350
|
function validateThreshold(raw) {
|
|
2304
2351
|
const trimmed = raw.trim();
|
|
2305
2352
|
if (trimmed === "") return {
|
|
@@ -2336,7 +2383,7 @@ function validateWeight(raw) {
|
|
|
2336
2383
|
value
|
|
2337
2384
|
};
|
|
2338
2385
|
}
|
|
2339
|
-
var PROVIDER_THEMES = {
|
|
2386
|
+
var PROVIDER_THEMES = new Map(Object.entries({
|
|
2340
2387
|
openai: {
|
|
2341
2388
|
stripe: "bg-openai-400",
|
|
2342
2389
|
bar: "bg-openai-bar",
|
|
@@ -2354,8 +2401,14 @@ var PROVIDER_THEMES = {
|
|
|
2354
2401
|
bar: "bg-google-400",
|
|
2355
2402
|
badge: "bg-google-50 text-google-600",
|
|
2356
2403
|
cost: "text-google-600"
|
|
2404
|
+
},
|
|
2405
|
+
grok: {
|
|
2406
|
+
stripe: "bg-sand-800",
|
|
2407
|
+
bar: "bg-sand-600",
|
|
2408
|
+
badge: "bg-sand-800 text-sand-50",
|
|
2409
|
+
cost: "text-sand-800"
|
|
2357
2410
|
}
|
|
2358
|
-
};
|
|
2411
|
+
}));
|
|
2359
2412
|
var DEFAULT_THEME = {
|
|
2360
2413
|
stripe: "bg-sand-400",
|
|
2361
2414
|
bar: "bg-sienna-400",
|
|
@@ -2363,7 +2416,7 @@ var DEFAULT_THEME = {
|
|
|
2363
2416
|
cost: "text-sienna-600"
|
|
2364
2417
|
};
|
|
2365
2418
|
function getProviderTheme(provider) {
|
|
2366
|
-
return PROVIDER_THEMES
|
|
2419
|
+
return PROVIDER_THEMES.get(provider) ?? DEFAULT_THEME;
|
|
2367
2420
|
}
|
|
2368
2421
|
function barColor(pct, theme) {
|
|
2369
2422
|
if (pct >= 95) return "bg-danger-400";
|
|
@@ -2384,37 +2437,127 @@ function formatWindowLabel(fallback, windowDurationMins) {
|
|
|
2384
2437
|
if (hours >= 24) return `${Math.round(hours / 24)}d`;
|
|
2385
2438
|
return `${Math.round(hours)}h`;
|
|
2386
2439
|
}
|
|
2440
|
+
function formatPeriodType(periodType) {
|
|
2441
|
+
if (!periodType) return null;
|
|
2442
|
+
const label = periodType.replace(/^USAGE_PERIOD_TYPE_/, "").toLowerCase();
|
|
2443
|
+
return label && label !== "unspecified" ? label : null;
|
|
2444
|
+
}
|
|
2445
|
+
/** Grok 등 provider별 상태 표시(on-demand 제외, ZDR 비디오 제외, keepalive 미적용, 과금 주기). */
|
|
2446
|
+
function UsageStateNotes({ usage }) {
|
|
2447
|
+
const period = formatPeriodType(usage.periodType);
|
|
2448
|
+
if (!(usage.onDemandExcluded === true || usage.zdrVideoExcluded === true || usage.keepaliveApplicable === false || period !== null || !!usage.tier)) return null;
|
|
2449
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2450
|
+
className: "flex flex-wrap items-center gap-1 text-[10px]",
|
|
2451
|
+
children: [
|
|
2452
|
+
usage.onDemandExcluded === true && /* @__PURE__ */ (void 0)("span", {
|
|
2453
|
+
className: "px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700",
|
|
2454
|
+
title: "xAI에서 on-demand 과금을 끄면 다시 라우팅됩니다",
|
|
2455
|
+
children: "excluded: on-demand billing enabled"
|
|
2456
|
+
}, void 0, false, {
|
|
2457
|
+
fileName: _jsxFileName$1,
|
|
2458
|
+
lineNumber: 172,
|
|
2459
|
+
columnNumber: 9
|
|
2460
|
+
}, this),
|
|
2461
|
+
usage.zdrVideoExcluded === true && /* @__PURE__ */ (void 0)("span", {
|
|
2462
|
+
className: "px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700",
|
|
2463
|
+
title: "xAI에서 data-retention opt-out(Zero Data Retention)을 끄면 비디오가 다시 라우팅됩니다",
|
|
2464
|
+
children: "video unavailable: zero data retention"
|
|
2465
|
+
}, void 0, false, {
|
|
2466
|
+
fileName: _jsxFileName$1,
|
|
2467
|
+
lineNumber: 180,
|
|
2468
|
+
columnNumber: 9
|
|
2469
|
+
}, this),
|
|
2470
|
+
period !== null && /* @__PURE__ */ (void 0)("span", {
|
|
2471
|
+
className: "px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600",
|
|
2472
|
+
children: period
|
|
2473
|
+
}, void 0, false, {
|
|
2474
|
+
fileName: _jsxFileName$1,
|
|
2475
|
+
lineNumber: 188,
|
|
2476
|
+
columnNumber: 9
|
|
2477
|
+
}, this),
|
|
2478
|
+
usage.tier && /* @__PURE__ */ (void 0)("span", {
|
|
2479
|
+
className: "px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600",
|
|
2480
|
+
children: usage.tier
|
|
2481
|
+
}, void 0, false, {
|
|
2482
|
+
fileName: _jsxFileName$1,
|
|
2483
|
+
lineNumber: 191,
|
|
2484
|
+
columnNumber: 9
|
|
2485
|
+
}, this),
|
|
2486
|
+
usage.keepaliveApplicable === false && /* @__PURE__ */ (void 0)("span", {
|
|
2487
|
+
className: "px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-400",
|
|
2488
|
+
title: "이 provider는 토큰 윈도 keepalive 대상이 아닙니다",
|
|
2489
|
+
children: "keepalive n/a"
|
|
2490
|
+
}, void 0, false, {
|
|
2491
|
+
fileName: _jsxFileName$1,
|
|
2492
|
+
lineNumber: 194,
|
|
2493
|
+
columnNumber: 9
|
|
2494
|
+
}, this)
|
|
2495
|
+
]
|
|
2496
|
+
}, void 0, true, {
|
|
2497
|
+
fileName: _jsxFileName$1,
|
|
2498
|
+
lineNumber: 170,
|
|
2499
|
+
columnNumber: 5
|
|
2500
|
+
}, this);
|
|
2501
|
+
}
|
|
2387
2502
|
function UsageRow({ label, utilization, resetsAt, windowDurationMins, theme, threshold }) {
|
|
2388
2503
|
const pct = utilization ?? 0;
|
|
2389
2504
|
const hasThreshold = threshold !== void 0 && threshold !== null;
|
|
2390
|
-
return /* @__PURE__ */ (0,
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2391
2506
|
className: "flex items-center gap-2",
|
|
2392
2507
|
children: [
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2394
2509
|
className: "text-xs text-sand-600 w-7 shrink-0",
|
|
2395
2510
|
children: formatWindowLabel(label, windowDurationMins)
|
|
2396
|
-
}
|
|
2397
|
-
|
|
2511
|
+
}, void 0, false, {
|
|
2512
|
+
fileName: _jsxFileName$1,
|
|
2513
|
+
lineNumber: 228,
|
|
2514
|
+
columnNumber: 7
|
|
2515
|
+
}, this),
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2398
2517
|
className: "relative flex-1 min-w-0 h-2 bg-sand-200 rounded-full overflow-hidden",
|
|
2399
|
-
children: [/* @__PURE__ */ (0,
|
|
2518
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2400
2519
|
className: `h-full rounded-full transition-all duration-300 ${barColor(pct, theme)}`,
|
|
2401
2520
|
style: { width: `${Math.min(pct, 100)}%` }
|
|
2402
|
-
}
|
|
2521
|
+
}, void 0, false, {
|
|
2522
|
+
fileName: _jsxFileName$1,
|
|
2523
|
+
lineNumber: 232,
|
|
2524
|
+
columnNumber: 9
|
|
2525
|
+
}, this), hasThreshold && /* @__PURE__ */ (void 0)("div", {
|
|
2403
2526
|
className: "absolute top-[-2px] bottom-[-2px] w-0.5 bg-sienna-500 rounded-full",
|
|
2404
2527
|
style: { left: `calc(${Math.min(threshold, 100)}% - 1px)` }
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
|
|
2528
|
+
}, void 0, false, {
|
|
2529
|
+
fileName: _jsxFileName$1,
|
|
2530
|
+
lineNumber: 238,
|
|
2531
|
+
columnNumber: 11
|
|
2532
|
+
}, this)]
|
|
2533
|
+
}, void 0, true, {
|
|
2534
|
+
fileName: _jsxFileName$1,
|
|
2535
|
+
lineNumber: 231,
|
|
2536
|
+
columnNumber: 7
|
|
2537
|
+
}, this),
|
|
2538
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2408
2539
|
className: "text-xs tabular-nums text-sand-700 w-9 text-right shrink-0",
|
|
2409
2540
|
children: [pct, "%"]
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2541
|
+
}, void 0, true, {
|
|
2542
|
+
fileName: _jsxFileName$1,
|
|
2543
|
+
lineNumber: 244,
|
|
2544
|
+
columnNumber: 7
|
|
2545
|
+
}, this),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2412
2547
|
className: "hidden sm:inline text-[10px] text-sand-400 w-24 text-right shrink-0",
|
|
2413
2548
|
title: formatResets(resetsAt),
|
|
2414
2549
|
children: formatResets(resetsAt)
|
|
2415
|
-
}
|
|
2550
|
+
}, void 0, false, {
|
|
2551
|
+
fileName: _jsxFileName$1,
|
|
2552
|
+
lineNumber: 245,
|
|
2553
|
+
columnNumber: 7
|
|
2554
|
+
}, this)
|
|
2416
2555
|
]
|
|
2417
|
-
}
|
|
2556
|
+
}, void 0, true, {
|
|
2557
|
+
fileName: _jsxFileName$1,
|
|
2558
|
+
lineNumber: 227,
|
|
2559
|
+
columnNumber: 5
|
|
2560
|
+
}, this);
|
|
2418
2561
|
}
|
|
2419
2562
|
function TokenUsage({ token, theme }) {
|
|
2420
2563
|
const queryClient = useQueryClient();
|
|
@@ -2426,52 +2569,124 @@ function TokenUsage({ token, theme }) {
|
|
|
2426
2569
|
dataUpdatedAt,
|
|
2427
2570
|
queryClient
|
|
2428
2571
|
]);
|
|
2429
|
-
if (token.reauth_required) return /* @__PURE__ */ (0,
|
|
2572
|
+
if (token.reauth_required) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2430
2573
|
className: "py-1",
|
|
2431
|
-
children: [/* @__PURE__ */ (0,
|
|
2574
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2432
2575
|
className: "text-[11px] text-amber-600",
|
|
2433
2576
|
children: "Session expired"
|
|
2434
|
-
}
|
|
2577
|
+
}, void 0, false, {
|
|
2578
|
+
fileName: _jsxFileName$1,
|
|
2579
|
+
lineNumber: 267,
|
|
2580
|
+
columnNumber: 9
|
|
2581
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2435
2582
|
className: "text-[10px] text-sand-400 mt-0.5",
|
|
2436
2583
|
children: "Please re-login via OAuth"
|
|
2437
|
-
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2584
|
+
}, void 0, false, {
|
|
2585
|
+
fileName: _jsxFileName$1,
|
|
2586
|
+
lineNumber: 268,
|
|
2587
|
+
columnNumber: 9
|
|
2588
|
+
}, this)]
|
|
2589
|
+
}, void 0, true, {
|
|
2590
|
+
fileName: _jsxFileName$1,
|
|
2591
|
+
lineNumber: 266,
|
|
2592
|
+
columnNumber: 7
|
|
2593
|
+
}, this);
|
|
2594
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2440
2595
|
className: "animate-pulse space-y-2 py-2",
|
|
2441
|
-
children: [/* @__PURE__ */ (0,
|
|
2442
|
-
|
|
2443
|
-
|
|
2596
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-2 w-full bg-sand-200 rounded-full" }, void 0, false, {
|
|
2597
|
+
fileName: _jsxFileName$1,
|
|
2598
|
+
lineNumber: 276,
|
|
2599
|
+
columnNumber: 9
|
|
2600
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-2 w-3/4 bg-sand-200 rounded-full" }, void 0, false, {
|
|
2601
|
+
fileName: _jsxFileName$1,
|
|
2602
|
+
lineNumber: 277,
|
|
2603
|
+
columnNumber: 9
|
|
2604
|
+
}, this)]
|
|
2605
|
+
}, void 0, true, {
|
|
2606
|
+
fileName: _jsxFileName$1,
|
|
2607
|
+
lineNumber: 275,
|
|
2608
|
+
columnNumber: 7
|
|
2609
|
+
}, this);
|
|
2610
|
+
if (data?.error) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2444
2611
|
className: "py-1",
|
|
2445
|
-
children: [/* @__PURE__ */ (0,
|
|
2612
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2446
2613
|
className: "text-[11px] text-amber-600",
|
|
2447
2614
|
children: "Unavailable"
|
|
2448
|
-
}
|
|
2615
|
+
}, void 0, false, {
|
|
2616
|
+
fileName: _jsxFileName$1,
|
|
2617
|
+
lineNumber: 285,
|
|
2618
|
+
columnNumber: 9
|
|
2619
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2449
2620
|
className: "text-[10px] text-sand-400 mt-0.5",
|
|
2450
2621
|
children: data.error
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
}
|
|
2622
|
+
}, void 0, false, {
|
|
2623
|
+
fileName: _jsxFileName$1,
|
|
2624
|
+
lineNumber: 286,
|
|
2625
|
+
columnNumber: 9
|
|
2626
|
+
}, this)]
|
|
2627
|
+
}, void 0, true, {
|
|
2628
|
+
fileName: _jsxFileName$1,
|
|
2629
|
+
lineNumber: 284,
|
|
2630
|
+
columnNumber: 7
|
|
2631
|
+
}, this);
|
|
2632
|
+
if (!data?.fiveHour && !data?.sevenDay) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2633
|
+
className: "space-y-1.5 py-1",
|
|
2634
|
+
children: [data && /* @__PURE__ */ (void 0)(UsageStateNotes, { usage: data }, void 0, false, {
|
|
2635
|
+
fileName: _jsxFileName$1,
|
|
2636
|
+
lineNumber: 294,
|
|
2637
|
+
columnNumber: 18
|
|
2638
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2639
|
+
className: "text-[11px] text-sand-400",
|
|
2640
|
+
children: "No usage data"
|
|
2641
|
+
}, void 0, false, {
|
|
2642
|
+
fileName: _jsxFileName$1,
|
|
2643
|
+
lineNumber: 295,
|
|
2644
|
+
columnNumber: 9
|
|
2645
|
+
}, this)]
|
|
2646
|
+
}, void 0, true, {
|
|
2647
|
+
fileName: _jsxFileName$1,
|
|
2648
|
+
lineNumber: 293,
|
|
2649
|
+
columnNumber: 7
|
|
2650
|
+
}, this);
|
|
2457
2651
|
const thresholdForPrimary = QUOTA_THRESHOLD_PROVIDERS.has(token.provider) ? token.quota_threshold : null;
|
|
2458
|
-
return /* @__PURE__ */ (0,
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2459
2653
|
className: "space-y-1.5 py-1",
|
|
2460
|
-
children: [
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2654
|
+
children: [
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(UsageStateNotes, { usage: data }, void 0, false, {
|
|
2656
|
+
fileName: _jsxFileName$1,
|
|
2657
|
+
lineNumber: 307,
|
|
2658
|
+
columnNumber: 7
|
|
2659
|
+
}, this),
|
|
2660
|
+
data.fiveHour && /* @__PURE__ */ (void 0)(UsageRow, {
|
|
2661
|
+
label: "5h",
|
|
2662
|
+
utilization: data.fiveHour.utilization,
|
|
2663
|
+
resetsAt: data.fiveHour.resetsAt,
|
|
2664
|
+
windowDurationMins: data.fiveHour.windowDurationMins,
|
|
2665
|
+
theme,
|
|
2666
|
+
threshold: thresholdForPrimary
|
|
2667
|
+
}, void 0, false, {
|
|
2668
|
+
fileName: _jsxFileName$1,
|
|
2669
|
+
lineNumber: 309,
|
|
2670
|
+
columnNumber: 9
|
|
2671
|
+
}, this),
|
|
2672
|
+
data.sevenDay && /* @__PURE__ */ (void 0)(UsageRow, {
|
|
2673
|
+
label: formatPeriodType(data.periodType) === "monthly" ? "1mo" : "7d",
|
|
2674
|
+
utilization: data.sevenDay.utilization,
|
|
2675
|
+
resetsAt: data.sevenDay.resetsAt,
|
|
2676
|
+
windowDurationMins: data.sevenDay.windowDurationMins,
|
|
2677
|
+
theme,
|
|
2678
|
+
threshold: token.provider === "grok" ? thresholdForPrimary : void 0
|
|
2679
|
+
}, void 0, false, {
|
|
2680
|
+
fileName: _jsxFileName$1,
|
|
2681
|
+
lineNumber: 319,
|
|
2682
|
+
columnNumber: 9
|
|
2683
|
+
}, this)
|
|
2684
|
+
]
|
|
2685
|
+
}, void 0, true, {
|
|
2686
|
+
fileName: _jsxFileName$1,
|
|
2687
|
+
lineNumber: 306,
|
|
2688
|
+
columnNumber: 5
|
|
2689
|
+
}, this);
|
|
2475
2690
|
}
|
|
2476
2691
|
function ThresholdControl({ token }) {
|
|
2477
2692
|
const [pos, setPos] = (0, import_react.useState)(null);
|
|
@@ -2499,11 +2714,19 @@ function ThresholdControl({ token }) {
|
|
|
2499
2714
|
setValue(String(token.quota_threshold ?? 100));
|
|
2500
2715
|
};
|
|
2501
2716
|
const close = () => setPos(null);
|
|
2502
|
-
if (!supported) return /* @__PURE__ */ (0,
|
|
2717
|
+
if (!supported) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2503
2718
|
className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] text-sand-300 border border-sand-100",
|
|
2504
2719
|
title: "Quota threshold는 이 provider에서 지원되지 않습니다",
|
|
2505
|
-
children: [/* @__PURE__ */ (0,
|
|
2506
|
-
|
|
2720
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideGauge, { className: "size-3" }, void 0, false, {
|
|
2721
|
+
fileName: _jsxFileName$1,
|
|
2722
|
+
lineNumber: 385,
|
|
2723
|
+
columnNumber: 9
|
|
2724
|
+
}, this), "n/a"]
|
|
2725
|
+
}, void 0, true, {
|
|
2726
|
+
fileName: _jsxFileName$1,
|
|
2727
|
+
lineNumber: 381,
|
|
2728
|
+
columnNumber: 7
|
|
2729
|
+
}, this);
|
|
2507
2730
|
const adjust = (delta) => {
|
|
2508
2731
|
const current = /^\d+$/.test(value.trim()) ? Number(value.trim()) : 0;
|
|
2509
2732
|
const next = Math.min(Math.max(current + delta, 0), 100);
|
|
@@ -2518,83 +2741,147 @@ function ThresholdControl({ token }) {
|
|
|
2518
2741
|
await Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
|
|
2519
2742
|
close();
|
|
2520
2743
|
};
|
|
2521
|
-
return /* @__PURE__ */ (0,
|
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2522
2745
|
className: "inline-flex",
|
|
2523
|
-
children: [/* @__PURE__ */ (0,
|
|
2746
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
2524
2747
|
ref: triggerRef,
|
|
2525
2748
|
type: "button",
|
|
2526
2749
|
title: "사용률 제한 설정",
|
|
2527
2750
|
onClick: open ? close : openPopover,
|
|
2528
2751
|
className: "flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150",
|
|
2529
|
-
children: [/* @__PURE__ */ (0,
|
|
2530
|
-
|
|
2752
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideGauge, { className: "size-3" }, void 0, false, {
|
|
2753
|
+
fileName: _jsxFileName$1,
|
|
2754
|
+
lineNumber: 421,
|
|
2755
|
+
columnNumber: 9
|
|
2756
|
+
}, this), "Set limit"]
|
|
2757
|
+
}, void 0, true, {
|
|
2758
|
+
fileName: _jsxFileName$1,
|
|
2759
|
+
lineNumber: 414,
|
|
2760
|
+
columnNumber: 7
|
|
2761
|
+
}, this), open && pos && /* @__PURE__ */ (void 0)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (void 0)("div", {
|
|
2531
2762
|
className: "fixed inset-0 z-40",
|
|
2532
2763
|
onPointerDown: close
|
|
2533
|
-
}
|
|
2764
|
+
}, void 0, false, {
|
|
2765
|
+
fileName: _jsxFileName$1,
|
|
2766
|
+
lineNumber: 429,
|
|
2767
|
+
columnNumber: 11
|
|
2768
|
+
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
2534
2769
|
className: "fixed z-50 w-60 panel shadow-xl p-3",
|
|
2535
2770
|
style: {
|
|
2536
2771
|
top: pos.top,
|
|
2537
2772
|
left: pos.left
|
|
2538
2773
|
},
|
|
2539
2774
|
children: [
|
|
2540
|
-
/* @__PURE__ */ (0
|
|
2775
|
+
/* @__PURE__ */ (void 0)("label", {
|
|
2541
2776
|
htmlFor: `threshold-${token.id}`,
|
|
2542
2777
|
className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
|
|
2543
2778
|
children: "사용률 제한"
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2779
|
+
}, void 0, false, {
|
|
2780
|
+
fileName: _jsxFileName$1,
|
|
2781
|
+
lineNumber: 434,
|
|
2782
|
+
columnNumber: 13
|
|
2783
|
+
}, this),
|
|
2784
|
+
/* @__PURE__ */ (void 0)("div", {
|
|
2546
2785
|
className: "mt-1 flex items-center gap-2",
|
|
2547
2786
|
children: [
|
|
2548
|
-
/* @__PURE__ */ (0
|
|
2787
|
+
/* @__PURE__ */ (void 0)("button", {
|
|
2549
2788
|
type: "button",
|
|
2550
2789
|
onClick: () => adjust(-10),
|
|
2551
2790
|
className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150",
|
|
2552
2791
|
children: "−"
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2792
|
+
}, void 0, false, {
|
|
2793
|
+
fileName: _jsxFileName$1,
|
|
2794
|
+
lineNumber: 441,
|
|
2795
|
+
columnNumber: 15
|
|
2796
|
+
}, this),
|
|
2797
|
+
/* @__PURE__ */ (void 0)(o, {
|
|
2555
2798
|
id: `threshold-${token.id}`,
|
|
2556
2799
|
value,
|
|
2557
2800
|
onChange: (e) => setValue(e.target.value),
|
|
2558
2801
|
inputMode: "numeric",
|
|
2559
2802
|
className: `h-9 w-14 border rounded-md text-center text-sm text-sand-900 bg-white tabular-nums focus:outline-none ${validation.ok ? "border-sand-200 focus:border-sienna-300" : "border-red-300 focus:border-red-400"}`
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2803
|
+
}, void 0, false, {
|
|
2804
|
+
fileName: _jsxFileName$1,
|
|
2805
|
+
lineNumber: 448,
|
|
2806
|
+
columnNumber: 15
|
|
2807
|
+
}, this),
|
|
2808
|
+
/* @__PURE__ */ (void 0)("button", {
|
|
2562
2809
|
type: "button",
|
|
2563
2810
|
onClick: () => adjust(10),
|
|
2564
2811
|
className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150",
|
|
2565
2812
|
children: "+"
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2813
|
+
}, void 0, false, {
|
|
2814
|
+
fileName: _jsxFileName$1,
|
|
2815
|
+
lineNumber: 459,
|
|
2816
|
+
columnNumber: 15
|
|
2817
|
+
}, this),
|
|
2818
|
+
/* @__PURE__ */ (void 0)("span", {
|
|
2568
2819
|
className: "text-sm text-sand-500",
|
|
2569
2820
|
children: "%"
|
|
2570
|
-
}
|
|
2821
|
+
}, void 0, false, {
|
|
2822
|
+
fileName: _jsxFileName$1,
|
|
2823
|
+
lineNumber: 466,
|
|
2824
|
+
columnNumber: 15
|
|
2825
|
+
}, this)
|
|
2571
2826
|
]
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2827
|
+
}, void 0, true, {
|
|
2828
|
+
fileName: _jsxFileName$1,
|
|
2829
|
+
lineNumber: 440,
|
|
2830
|
+
columnNumber: 13
|
|
2831
|
+
}, this),
|
|
2832
|
+
validation.ok ? /* @__PURE__ */ (void 0)("p", {
|
|
2574
2833
|
className: "mt-1.5 text-[11px] text-sand-500 leading-snug",
|
|
2575
2834
|
children: validation.value === null ? "제한 없음 — 사용률과 무관하게 항상 사용합니다." : "기준 사용률이 임계치에 달하면 해당 토큰을 건너뜁니다."
|
|
2576
|
-
}
|
|
2835
|
+
}, void 0, false, {
|
|
2836
|
+
fileName: _jsxFileName$1,
|
|
2837
|
+
lineNumber: 469,
|
|
2838
|
+
columnNumber: 15
|
|
2839
|
+
}, this) : /* @__PURE__ */ (void 0)("p", {
|
|
2577
2840
|
className: "mt-1.5 text-[11px] text-red-500",
|
|
2578
2841
|
children: validation.error
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2842
|
+
}, void 0, false, {
|
|
2843
|
+
fileName: _jsxFileName$1,
|
|
2844
|
+
lineNumber: 475,
|
|
2845
|
+
columnNumber: 15
|
|
2846
|
+
}, this),
|
|
2847
|
+
/* @__PURE__ */ (void 0)("div", {
|
|
2581
2848
|
className: "mt-2 flex items-center justify-end gap-1.5",
|
|
2582
|
-
children: [/* @__PURE__ */ (0
|
|
2849
|
+
children: [/* @__PURE__ */ (void 0)("button", {
|
|
2583
2850
|
type: "button",
|
|
2584
2851
|
className: "px-2 py-1 text-[11px] font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
|
|
2585
2852
|
onClick: close,
|
|
2586
2853
|
children: "Cancel"
|
|
2587
|
-
}
|
|
2854
|
+
}, void 0, false, {
|
|
2855
|
+
fileName: _jsxFileName$1,
|
|
2856
|
+
lineNumber: 478,
|
|
2857
|
+
columnNumber: 15
|
|
2858
|
+
}, this), /* @__PURE__ */ (void 0)("button", {
|
|
2588
2859
|
type: "button",
|
|
2589
2860
|
className: "px-2 py-1 text-[11px] font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150",
|
|
2590
2861
|
disabled: updateMutation.isPending || !validation.ok,
|
|
2591
2862
|
onClick: save,
|
|
2592
2863
|
children: updateMutation.isPending ? "Saving..." : "Save"
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2864
|
+
}, void 0, false, {
|
|
2865
|
+
fileName: _jsxFileName$1,
|
|
2866
|
+
lineNumber: 485,
|
|
2867
|
+
columnNumber: 15
|
|
2868
|
+
}, this)]
|
|
2869
|
+
}, void 0, true, {
|
|
2870
|
+
fileName: _jsxFileName$1,
|
|
2871
|
+
lineNumber: 477,
|
|
2872
|
+
columnNumber: 13
|
|
2873
|
+
}, this)
|
|
2595
2874
|
]
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2875
|
+
}, void 0, true, {
|
|
2876
|
+
fileName: _jsxFileName$1,
|
|
2877
|
+
lineNumber: 430,
|
|
2878
|
+
columnNumber: 11
|
|
2879
|
+
}, this)] }, void 0, true)]
|
|
2880
|
+
}, void 0, true, {
|
|
2881
|
+
fileName: _jsxFileName$1,
|
|
2882
|
+
lineNumber: 413,
|
|
2883
|
+
columnNumber: 5
|
|
2884
|
+
}, this);
|
|
2598
2885
|
}
|
|
2599
2886
|
function WeightControl({ token }) {
|
|
2600
2887
|
const [pos, setPos] = (0, import_react.useState)(null);
|
|
@@ -2633,73 +2920,125 @@ function WeightControl({ token }) {
|
|
|
2633
2920
|
await Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
|
|
2634
2921
|
close();
|
|
2635
2922
|
};
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2923
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2637
2924
|
className: "inline-flex",
|
|
2638
|
-
children: [/* @__PURE__ */ (0,
|
|
2925
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
2639
2926
|
ref: triggerRef,
|
|
2640
2927
|
type: "button",
|
|
2641
2928
|
title: "라우팅 가중치 설정",
|
|
2642
2929
|
onClick: pos ? close : openPopover,
|
|
2643
2930
|
className: "flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150",
|
|
2644
2931
|
children: ["Weight ", token.weight]
|
|
2645
|
-
}
|
|
2932
|
+
}, void 0, true, {
|
|
2933
|
+
fileName: _jsxFileName$1,
|
|
2934
|
+
lineNumber: 556,
|
|
2935
|
+
columnNumber: 7
|
|
2936
|
+
}, this), pos && /* @__PURE__ */ (void 0)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (void 0)("div", {
|
|
2646
2937
|
className: "fixed inset-0 z-40",
|
|
2647
2938
|
onPointerDown: close
|
|
2648
|
-
}
|
|
2939
|
+
}, void 0, false, {
|
|
2940
|
+
fileName: _jsxFileName$1,
|
|
2941
|
+
lineNumber: 567,
|
|
2942
|
+
columnNumber: 11
|
|
2943
|
+
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
2649
2944
|
className: "fixed z-50 w-60 panel shadow-xl p-3",
|
|
2650
2945
|
style: pos,
|
|
2651
2946
|
children: [
|
|
2652
|
-
/* @__PURE__ */ (0
|
|
2947
|
+
/* @__PURE__ */ (void 0)("label", {
|
|
2653
2948
|
htmlFor: `weight-${token.id}`,
|
|
2654
2949
|
className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
|
|
2655
2950
|
children: "라우팅 가중치"
|
|
2656
|
-
}
|
|
2657
|
-
|
|
2951
|
+
}, void 0, false, {
|
|
2952
|
+
fileName: _jsxFileName$1,
|
|
2953
|
+
lineNumber: 569,
|
|
2954
|
+
columnNumber: 13
|
|
2955
|
+
}, this),
|
|
2956
|
+
/* @__PURE__ */ (void 0)("div", {
|
|
2658
2957
|
className: "mt-1 flex items-center gap-2",
|
|
2659
2958
|
children: [
|
|
2660
|
-
/* @__PURE__ */ (0
|
|
2959
|
+
/* @__PURE__ */ (void 0)("button", {
|
|
2661
2960
|
type: "button",
|
|
2662
2961
|
onClick: () => adjust(-1),
|
|
2663
2962
|
className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600",
|
|
2664
2963
|
children: "−"
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2964
|
+
}, void 0, false, {
|
|
2965
|
+
fileName: _jsxFileName$1,
|
|
2966
|
+
lineNumber: 576,
|
|
2967
|
+
columnNumber: 15
|
|
2968
|
+
}, this),
|
|
2969
|
+
/* @__PURE__ */ (void 0)(o, {
|
|
2667
2970
|
id: `weight-${token.id}`,
|
|
2668
2971
|
value,
|
|
2669
2972
|
onChange: (event) => setValue(event.target.value),
|
|
2670
2973
|
inputMode: "numeric",
|
|
2671
2974
|
className: `h-9 w-16 border rounded-md text-center text-sm tabular-nums ${validation.ok ? "border-sand-200" : "border-red-300"}`
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2975
|
+
}, void 0, false, {
|
|
2976
|
+
fileName: _jsxFileName$1,
|
|
2977
|
+
lineNumber: 583,
|
|
2978
|
+
columnNumber: 15
|
|
2979
|
+
}, this),
|
|
2980
|
+
/* @__PURE__ */ (void 0)("button", {
|
|
2674
2981
|
type: "button",
|
|
2675
2982
|
onClick: () => adjust(1),
|
|
2676
2983
|
className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600",
|
|
2677
2984
|
children: "+"
|
|
2678
|
-
}
|
|
2985
|
+
}, void 0, false, {
|
|
2986
|
+
fileName: _jsxFileName$1,
|
|
2987
|
+
lineNumber: 594,
|
|
2988
|
+
columnNumber: 15
|
|
2989
|
+
}, this)
|
|
2679
2990
|
]
|
|
2680
|
-
}
|
|
2681
|
-
|
|
2991
|
+
}, void 0, true, {
|
|
2992
|
+
fileName: _jsxFileName$1,
|
|
2993
|
+
lineNumber: 575,
|
|
2994
|
+
columnNumber: 13
|
|
2995
|
+
}, this),
|
|
2996
|
+
/* @__PURE__ */ (void 0)("p", {
|
|
2682
2997
|
className: `mt-1.5 text-[11px] ${validation.ok ? "text-sand-500" : "text-red-500"}`,
|
|
2683
2998
|
children: validation.ok ? "새 요청의 상대 배정 비율입니다." : validation.error
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2999
|
+
}, void 0, false, {
|
|
3000
|
+
fileName: _jsxFileName$1,
|
|
3001
|
+
lineNumber: 602,
|
|
3002
|
+
columnNumber: 13
|
|
3003
|
+
}, this),
|
|
3004
|
+
/* @__PURE__ */ (void 0)("div", {
|
|
2686
3005
|
className: "mt-2 flex items-center justify-end gap-1.5",
|
|
2687
|
-
children: [/* @__PURE__ */ (0
|
|
3006
|
+
children: [/* @__PURE__ */ (void 0)("button", {
|
|
2688
3007
|
type: "button",
|
|
2689
3008
|
onClick: close,
|
|
2690
3009
|
className: "px-2 py-1 text-[11px]",
|
|
2691
3010
|
children: "Cancel"
|
|
2692
|
-
}
|
|
3011
|
+
}, void 0, false, {
|
|
3012
|
+
fileName: _jsxFileName$1,
|
|
3013
|
+
lineNumber: 606,
|
|
3014
|
+
columnNumber: 15
|
|
3015
|
+
}, this), /* @__PURE__ */ (void 0)("button", {
|
|
2693
3016
|
type: "button",
|
|
2694
3017
|
onClick: save,
|
|
2695
3018
|
disabled: updateMutation.isPending || !validation.ok,
|
|
2696
3019
|
className: "px-2 py-1 text-[11px] rounded-md bg-sienna-400 text-white disabled:opacity-50",
|
|
2697
3020
|
children: updateMutation.isPending ? "Saving..." : "Save"
|
|
2698
|
-
}
|
|
2699
|
-
|
|
3021
|
+
}, void 0, false, {
|
|
3022
|
+
fileName: _jsxFileName$1,
|
|
3023
|
+
lineNumber: 609,
|
|
3024
|
+
columnNumber: 15
|
|
3025
|
+
}, this)]
|
|
3026
|
+
}, void 0, true, {
|
|
3027
|
+
fileName: _jsxFileName$1,
|
|
3028
|
+
lineNumber: 605,
|
|
3029
|
+
columnNumber: 13
|
|
3030
|
+
}, this)
|
|
2700
3031
|
]
|
|
2701
|
-
}
|
|
2702
|
-
|
|
3032
|
+
}, void 0, true, {
|
|
3033
|
+
fileName: _jsxFileName$1,
|
|
3034
|
+
lineNumber: 568,
|
|
3035
|
+
columnNumber: 11
|
|
3036
|
+
}, this)] }, void 0, true)]
|
|
3037
|
+
}, void 0, true, {
|
|
3038
|
+
fileName: _jsxFileName$1,
|
|
3039
|
+
lineNumber: 555,
|
|
3040
|
+
columnNumber: 5
|
|
3041
|
+
}, this);
|
|
2703
3042
|
}
|
|
2704
3043
|
/**
|
|
2705
3044
|
* 재로그인의 유일한 진입점.
|
|
@@ -2712,42 +3051,81 @@ function WeightControl({ token }) {
|
|
|
2712
3051
|
*/
|
|
2713
3052
|
function ReloginButton({ token }) {
|
|
2714
3053
|
const oauth = useOAuthLoginFlow();
|
|
3054
|
+
const provider = isOAuthProvider(token.provider) ? token.provider : null;
|
|
2715
3055
|
const submitCode = async (pastedCode) => {
|
|
2716
3056
|
if (await oauth.submitCode(pastedCode)) oauth.reset();
|
|
2717
3057
|
};
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
3058
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
2719
3059
|
type: "button",
|
|
2720
3060
|
title: "기존 이름으로 다시 로그인",
|
|
2721
|
-
disabled: oauth.loadingProvider !== null,
|
|
2722
|
-
onClick: () =>
|
|
3061
|
+
disabled: provider === null || oauth.loadingProvider !== null,
|
|
3062
|
+
onClick: () => {
|
|
3063
|
+
if (provider) oauth.start(provider, token.name ?? "");
|
|
3064
|
+
},
|
|
2723
3065
|
className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium border border-sienna-300 text-sienna-600 hover:bg-sienna-50 disabled:opacity-50 transition-colors duration-150",
|
|
2724
|
-
children: oauth.loadingProvider === token.provider ? /* @__PURE__ */ (0,
|
|
2725
|
-
|
|
3066
|
+
children: oauth.loadingProvider === token.provider ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: "size-2.5 border-2 border-sienna-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
|
|
3067
|
+
fileName: _jsxFileName$1,
|
|
3068
|
+
lineNumber: 655,
|
|
3069
|
+
columnNumber: 13
|
|
3070
|
+
}, this), "로그인 대기"] }, void 0, true) : "재로그인"
|
|
3071
|
+
}, void 0, false, {
|
|
3072
|
+
fileName: _jsxFileName$1,
|
|
3073
|
+
lineNumber: 644,
|
|
3074
|
+
columnNumber: 7
|
|
3075
|
+
}, this), oauth.codeEntryProvider && /* @__PURE__ */ (void 0)("div", {
|
|
2726
3076
|
className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
|
|
2727
|
-
children: [/* @__PURE__ */ (0
|
|
3077
|
+
children: [/* @__PURE__ */ (void 0)("div", {
|
|
2728
3078
|
className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
|
|
2729
3079
|
onClick: oauth.reset,
|
|
2730
3080
|
onKeyDown: () => {}
|
|
2731
|
-
}
|
|
3081
|
+
}, void 0, false, {
|
|
3082
|
+
fileName: _jsxFileName$1,
|
|
3083
|
+
lineNumber: 665,
|
|
3084
|
+
columnNumber: 11
|
|
3085
|
+
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
2732
3086
|
className: "relative panel shadow-xl w-full max-w-md mx-4",
|
|
2733
|
-
children: [/* @__PURE__ */ (0
|
|
3087
|
+
children: [/* @__PURE__ */ (void 0)("div", {
|
|
2734
3088
|
className: "px-5 py-4 border-b border-sand-100/60",
|
|
2735
|
-
children: /* @__PURE__ */ (0
|
|
3089
|
+
children: /* @__PURE__ */ (void 0)("h3", {
|
|
2736
3090
|
className: "text-base font-medium text-sand-900",
|
|
2737
3091
|
children: "재로그인"
|
|
2738
|
-
}
|
|
2739
|
-
|
|
3092
|
+
}, void 0, false, {
|
|
3093
|
+
fileName: _jsxFileName$1,
|
|
3094
|
+
lineNumber: 672,
|
|
3095
|
+
columnNumber: 15
|
|
3096
|
+
}, this)
|
|
3097
|
+
}, void 0, false, {
|
|
3098
|
+
fileName: _jsxFileName$1,
|
|
3099
|
+
lineNumber: 671,
|
|
3100
|
+
columnNumber: 13
|
|
3101
|
+
}, this), /* @__PURE__ */ (void 0)("div", {
|
|
2740
3102
|
className: "px-5 py-4",
|
|
2741
|
-
children: /* @__PURE__ */ (0
|
|
3103
|
+
children: /* @__PURE__ */ (void 0)(OAuthCodeEntry, {
|
|
2742
3104
|
provider: oauth.codeEntryProvider,
|
|
2743
3105
|
isPending: oauth.completeMutation.isPending,
|
|
2744
3106
|
isError: oauth.completeMutation.isError,
|
|
2745
3107
|
onSubmit: (code) => void submitCode(code),
|
|
2746
3108
|
onRestart: oauth.reset
|
|
2747
|
-
}
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
3109
|
+
}, void 0, false, {
|
|
3110
|
+
fileName: _jsxFileName$1,
|
|
3111
|
+
lineNumber: 675,
|
|
3112
|
+
columnNumber: 15
|
|
3113
|
+
}, this)
|
|
3114
|
+
}, void 0, false, {
|
|
3115
|
+
fileName: _jsxFileName$1,
|
|
3116
|
+
lineNumber: 674,
|
|
3117
|
+
columnNumber: 13
|
|
3118
|
+
}, this)]
|
|
3119
|
+
}, void 0, true, {
|
|
3120
|
+
fileName: _jsxFileName$1,
|
|
3121
|
+
lineNumber: 670,
|
|
3122
|
+
columnNumber: 11
|
|
3123
|
+
}, this)]
|
|
3124
|
+
}, void 0, true, {
|
|
3125
|
+
fileName: _jsxFileName$1,
|
|
3126
|
+
lineNumber: 664,
|
|
3127
|
+
columnNumber: 9
|
|
3128
|
+
}, this)] }, void 0, true);
|
|
2751
3129
|
}
|
|
2752
3130
|
function SortableTokenCard({ token }) {
|
|
2753
3131
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
@@ -2757,13 +3135,14 @@ function SortableTokenCard({ token }) {
|
|
|
2757
3135
|
easing: "ease"
|
|
2758
3136
|
}
|
|
2759
3137
|
});
|
|
2760
|
-
const
|
|
3138
|
+
const totalCostParams = {
|
|
2761
3139
|
num: 0,
|
|
2762
|
-
page: 1
|
|
2763
|
-
|
|
2764
|
-
|
|
3140
|
+
page: 1
|
|
3141
|
+
};
|
|
3142
|
+
if (token.name) totalCostParams.token_name = token.name;
|
|
3143
|
+
const { data: costData } = QgridService.useTotalCost(totalCostParams, { enabled: !!token.name });
|
|
2765
3144
|
const theme = getProviderTheme(token.provider);
|
|
2766
|
-
return /* @__PURE__ */ (0,
|
|
3145
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2767
3146
|
ref: setNodeRef,
|
|
2768
3147
|
style: {
|
|
2769
3148
|
transform: CSS.Translate.toString(transform),
|
|
@@ -2772,41 +3151,85 @@ function SortableTokenCard({ token }) {
|
|
|
2772
3151
|
zIndex: isDragging ? 10 : void 0
|
|
2773
3152
|
},
|
|
2774
3153
|
className: "relative rounded-lg bg-white border border-sand-200/80 overflow-hidden shadow-sm hover:shadow-md transition-shadow duration-200",
|
|
2775
|
-
children: [/* @__PURE__ */ (0,
|
|
3154
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `absolute inset-y-0 left-0 w-1 ${theme.stripe}` }, void 0, false, {
|
|
3155
|
+
fileName: _jsxFileName$1,
|
|
3156
|
+
lineNumber: 724,
|
|
3157
|
+
columnNumber: 7
|
|
3158
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2776
3159
|
className: "pl-4 pr-3 py-3",
|
|
2777
3160
|
children: [
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
3161
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2779
3162
|
className: "flex items-start justify-between gap-2 mb-2",
|
|
2780
|
-
children: [/* @__PURE__ */ (0,
|
|
3163
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2781
3164
|
className: "flex items-center gap-1.5 min-w-0",
|
|
2782
|
-
children: [/* @__PURE__ */ (0,
|
|
3165
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
2783
3166
|
type: "button",
|
|
2784
3167
|
"aria-label": "순서 변경 핸들",
|
|
2785
3168
|
...attributes,
|
|
2786
3169
|
...listeners,
|
|
2787
3170
|
className: "shrink-0 -m-1 p-1 text-sand-300 hover:text-sand-500 cursor-grab active:cursor-grabbing touch-none",
|
|
2788
|
-
children: /* @__PURE__ */ (0,
|
|
2789
|
-
|
|
3171
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideGripVertical, { className: "size-3.5" }, void 0, false, {
|
|
3172
|
+
fileName: _jsxFileName$1,
|
|
3173
|
+
lineNumber: 737,
|
|
3174
|
+
columnNumber: 15
|
|
3175
|
+
}, this)
|
|
3176
|
+
}, void 0, false, {
|
|
3177
|
+
fileName: _jsxFileName$1,
|
|
3178
|
+
lineNumber: 730,
|
|
3179
|
+
columnNumber: 13
|
|
3180
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2790
3181
|
className: "text-[13px] font-medium text-sand-800 truncate select-none",
|
|
2791
3182
|
children: token.name ?? "Unnamed"
|
|
2792
|
-
}
|
|
2793
|
-
|
|
3183
|
+
}, void 0, false, {
|
|
3184
|
+
fileName: _jsxFileName$1,
|
|
3185
|
+
lineNumber: 739,
|
|
3186
|
+
columnNumber: 13
|
|
3187
|
+
}, this)]
|
|
3188
|
+
}, void 0, true, {
|
|
3189
|
+
fileName: _jsxFileName$1,
|
|
3190
|
+
lineNumber: 729,
|
|
3191
|
+
columnNumber: 11
|
|
3192
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2794
3193
|
className: `text-[11px] tabular-nums font-medium shrink-0 ${theme.cost}`,
|
|
2795
|
-
children: formatUsd(costData?.usd ?? 0)
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
3194
|
+
children: [formatUsd(costData?.usd ?? 0), costData && unpricedRequestLabel(costData) ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
3195
|
+
className: "ml-1 font-normal text-sand-400",
|
|
3196
|
+
title: unpricedRequestTitle(costData) ?? void 0,
|
|
3197
|
+
children: unpricedRequestLabel(costData)
|
|
3198
|
+
}, void 0, false, {
|
|
3199
|
+
fileName: _jsxFileName$1,
|
|
3200
|
+
lineNumber: 746,
|
|
3201
|
+
columnNumber: 15
|
|
3202
|
+
}, this) : null]
|
|
3203
|
+
}, void 0, true, {
|
|
3204
|
+
fileName: _jsxFileName$1,
|
|
3205
|
+
lineNumber: 743,
|
|
3206
|
+
columnNumber: 11
|
|
3207
|
+
}, this)]
|
|
3208
|
+
}, void 0, true, {
|
|
3209
|
+
fileName: _jsxFileName$1,
|
|
3210
|
+
lineNumber: 728,
|
|
3211
|
+
columnNumber: 9
|
|
3212
|
+
}, this),
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2799
3214
|
className: "flex flex-wrap items-center gap-1 mb-2",
|
|
2800
3215
|
children: [
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2802
3217
|
className: `text-[10px] px-1.5 py-0.5 rounded-full uppercase ${theme.badge}`,
|
|
2803
3218
|
children: token.provider
|
|
2804
|
-
}
|
|
2805
|
-
|
|
3219
|
+
}, void 0, false, {
|
|
3220
|
+
fileName: _jsxFileName$1,
|
|
3221
|
+
lineNumber: 756,
|
|
3222
|
+
columnNumber: 11
|
|
3223
|
+
}, this),
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2806
3225
|
className: `text-[10px] px-1.5 py-0.5 rounded-full ${token.active ? "bg-sage-100 text-sage-600" : "bg-sand-200 text-sand-500"}`,
|
|
2807
3226
|
children: token.active ? "Active" : "Inactive"
|
|
2808
|
-
}
|
|
2809
|
-
|
|
3227
|
+
}, void 0, false, {
|
|
3228
|
+
fileName: _jsxFileName$1,
|
|
3229
|
+
lineNumber: 759,
|
|
3230
|
+
columnNumber: 11
|
|
3231
|
+
}, this),
|
|
3232
|
+
QUOTA_THRESHOLD_PROVIDERS.has(token.provider) && token.quota_threshold !== null && /* @__PURE__ */ (void 0)("span", {
|
|
2810
3233
|
className: "px-1.5 py-0.5 rounded-full bg-sienna-50 text-[10px] tabular-nums font-medium text-sienna-600",
|
|
2811
3234
|
title: `사용률 ${token.quota_threshold}% 이상이면 이 토큰 제외`,
|
|
2812
3235
|
children: [
|
|
@@ -2814,31 +3237,78 @@ function SortableTokenCard({ token }) {
|
|
|
2814
3237
|
token.quota_threshold,
|
|
2815
3238
|
"%"
|
|
2816
3239
|
]
|
|
2817
|
-
}
|
|
3240
|
+
}, void 0, true, {
|
|
3241
|
+
fileName: _jsxFileName$1,
|
|
3242
|
+
lineNumber: 765,
|
|
3243
|
+
columnNumber: 13
|
|
3244
|
+
}, this)
|
|
2818
3245
|
]
|
|
2819
|
-
}
|
|
2820
|
-
|
|
3246
|
+
}, void 0, true, {
|
|
3247
|
+
fileName: _jsxFileName$1,
|
|
3248
|
+
lineNumber: 755,
|
|
3249
|
+
columnNumber: 9
|
|
3250
|
+
}, this),
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TokenUsage, {
|
|
2821
3252
|
token,
|
|
2822
3253
|
theme
|
|
2823
|
-
}
|
|
2824
|
-
|
|
3254
|
+
}, void 0, false, {
|
|
3255
|
+
fileName: _jsxFileName$1,
|
|
3256
|
+
lineNumber: 773,
|
|
3257
|
+
columnNumber: 9
|
|
3258
|
+
}, this),
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2825
3260
|
className: "mt-2 flex flex-wrap items-center gap-1.5",
|
|
2826
3261
|
children: [
|
|
2827
|
-
token.reauth_required && /* @__PURE__ */ (0
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
3262
|
+
token.reauth_required && /* @__PURE__ */ (void 0)(ReloginButton, { token }, void 0, false, {
|
|
3263
|
+
fileName: _jsxFileName$1,
|
|
3264
|
+
lineNumber: 777,
|
|
3265
|
+
columnNumber: 37
|
|
3266
|
+
}, this),
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex-1" }, void 0, false, {
|
|
3268
|
+
fileName: _jsxFileName$1,
|
|
3269
|
+
lineNumber: 778,
|
|
3270
|
+
columnNumber: 11
|
|
3271
|
+
}, this),
|
|
3272
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(WeightControl, { token }, void 0, false, {
|
|
3273
|
+
fileName: _jsxFileName$1,
|
|
3274
|
+
lineNumber: 779,
|
|
3275
|
+
columnNumber: 11
|
|
3276
|
+
}, this),
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ThresholdControl, { token }, void 0, false, {
|
|
3278
|
+
fileName: _jsxFileName$1,
|
|
3279
|
+
lineNumber: 780,
|
|
3280
|
+
columnNumber: 11
|
|
3281
|
+
}, this)
|
|
2831
3282
|
]
|
|
2832
|
-
}
|
|
3283
|
+
}, void 0, true, {
|
|
3284
|
+
fileName: _jsxFileName$1,
|
|
3285
|
+
lineNumber: 774,
|
|
3286
|
+
columnNumber: 9
|
|
3287
|
+
}, this)
|
|
2833
3288
|
]
|
|
2834
|
-
}
|
|
2835
|
-
|
|
3289
|
+
}, void 0, true, {
|
|
3290
|
+
fileName: _jsxFileName$1,
|
|
3291
|
+
lineNumber: 727,
|
|
3292
|
+
columnNumber: 7
|
|
3293
|
+
}, this)]
|
|
3294
|
+
}, void 0, true, {
|
|
3295
|
+
fileName: _jsxFileName$1,
|
|
3296
|
+
lineNumber: 719,
|
|
3297
|
+
columnNumber: 5
|
|
3298
|
+
}, this);
|
|
2836
3299
|
}
|
|
2837
3300
|
var PROVIDERS = [
|
|
2838
3301
|
"all",
|
|
2839
3302
|
"openai",
|
|
2840
|
-
"anthropic"
|
|
3303
|
+
"anthropic",
|
|
3304
|
+
"grok"
|
|
2841
3305
|
];
|
|
3306
|
+
var PROVIDER_FILTER_LABELS = {
|
|
3307
|
+
all: "All",
|
|
3308
|
+
openai: "OpenAI",
|
|
3309
|
+
anthropic: "Anthropic",
|
|
3310
|
+
grok: "Grok"
|
|
3311
|
+
};
|
|
2842
3312
|
function UsageCard() {
|
|
2843
3313
|
const { data, isLoading } = TokenService.useTokens("A", { orderBy: "ord-asc" });
|
|
2844
3314
|
const queryClient = useQueryClient();
|
|
@@ -2875,66 +3345,143 @@ function UsageCard() {
|
|
|
2875
3345
|
}
|
|
2876
3346
|
});
|
|
2877
3347
|
};
|
|
2878
|
-
if (isLoading) return /* @__PURE__ */ (0,
|
|
3348
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2879
3349
|
className: "panel p-5",
|
|
2880
|
-
children: /* @__PURE__ */ (0,
|
|
3350
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2881
3351
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
2882
|
-
children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ (0,
|
|
3352
|
+
children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2883
3353
|
className: "rounded-lg bg-sand-50 px-4 py-3 animate-pulse",
|
|
2884
|
-
children: [/* @__PURE__ */ (0,
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
3354
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-3 w-16 bg-sand-200 rounded mb-3" }, void 0, false, {
|
|
3355
|
+
fileName: _jsxFileName$1,
|
|
3356
|
+
lineNumber: 861,
|
|
3357
|
+
columnNumber: 15
|
|
3358
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-2 w-full bg-sand-200 rounded-full" }, void 0, false, {
|
|
3359
|
+
fileName: _jsxFileName$1,
|
|
3360
|
+
lineNumber: 862,
|
|
3361
|
+
columnNumber: 15
|
|
3362
|
+
}, this)]
|
|
3363
|
+
}, `skel-${i}`, true, {
|
|
3364
|
+
fileName: _jsxFileName$1,
|
|
3365
|
+
lineNumber: 860,
|
|
3366
|
+
columnNumber: 13
|
|
3367
|
+
}, this))
|
|
3368
|
+
}, void 0, false, {
|
|
3369
|
+
fileName: _jsxFileName$1,
|
|
3370
|
+
lineNumber: 858,
|
|
3371
|
+
columnNumber: 9
|
|
3372
|
+
}, this)
|
|
3373
|
+
}, void 0, false, {
|
|
3374
|
+
fileName: _jsxFileName$1,
|
|
3375
|
+
lineNumber: 857,
|
|
3376
|
+
columnNumber: 7
|
|
3377
|
+
}, this);
|
|
3378
|
+
if (localTokens.length === 0) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2889
3379
|
className: "panel px-5 py-10",
|
|
2890
|
-
children: /* @__PURE__ */ (0,
|
|
3380
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
|
|
2891
3381
|
className: "text-sand-400 text-[13px] text-center",
|
|
2892
3382
|
children: "No tokens registered"
|
|
2893
|
-
}
|
|
2894
|
-
|
|
3383
|
+
}, void 0, false, {
|
|
3384
|
+
fileName: _jsxFileName$1,
|
|
3385
|
+
lineNumber: 873,
|
|
3386
|
+
columnNumber: 9
|
|
3387
|
+
}, this)
|
|
3388
|
+
}, void 0, false, {
|
|
3389
|
+
fileName: _jsxFileName$1,
|
|
3390
|
+
lineNumber: 872,
|
|
3391
|
+
columnNumber: 7
|
|
3392
|
+
}, this);
|
|
2895
3393
|
const filteredTokens = providerFilter === "all" ? localTokens : localTokens.filter((t) => t.provider === providerFilter);
|
|
2896
|
-
return /* @__PURE__ */ (0,
|
|
3394
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2897
3395
|
className: "panel overflow-hidden",
|
|
2898
|
-
children: [/* @__PURE__ */ (0,
|
|
3396
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2899
3397
|
className: "panel-header flex items-center justify-between px-5 py-2.5",
|
|
2900
|
-
children: [/* @__PURE__ */ (0,
|
|
3398
|
+
children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
|
|
2901
3399
|
className: "text-[13px] font-medium text-sand-700",
|
|
2902
3400
|
children: "Token Usage"
|
|
2903
|
-
}
|
|
3401
|
+
}, void 0, false, {
|
|
3402
|
+
fileName: _jsxFileName$1,
|
|
3403
|
+
lineNumber: 886,
|
|
3404
|
+
columnNumber: 9
|
|
3405
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2904
3406
|
className: "segmented-control flex gap-0.5",
|
|
2905
|
-
children: PROVIDERS.map((p) => /* @__PURE__ */ (0,
|
|
3407
|
+
children: PROVIDERS.map((p) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
|
|
2906
3408
|
type: "button",
|
|
2907
3409
|
"data-active": providerFilter === p,
|
|
2908
3410
|
className: `px-2.5 py-[3px] text-[11px] font-medium rounded-[6px] transition-all duration-150 ${providerFilter === p ? "text-sand-800" : "text-sand-500 hover:text-sand-700"}`,
|
|
2909
3411
|
onClick: () => setProviderFilter(p),
|
|
2910
|
-
children: p
|
|
2911
|
-
}, p
|
|
2912
|
-
|
|
2913
|
-
|
|
3412
|
+
children: PROVIDER_FILTER_LABELS[p]
|
|
3413
|
+
}, p, false, {
|
|
3414
|
+
fileName: _jsxFileName$1,
|
|
3415
|
+
lineNumber: 889,
|
|
3416
|
+
columnNumber: 13
|
|
3417
|
+
}, this))
|
|
3418
|
+
}, void 0, false, {
|
|
3419
|
+
fileName: _jsxFileName$1,
|
|
3420
|
+
lineNumber: 887,
|
|
3421
|
+
columnNumber: 9
|
|
3422
|
+
}, this)]
|
|
3423
|
+
}, void 0, true, {
|
|
3424
|
+
fileName: _jsxFileName$1,
|
|
3425
|
+
lineNumber: 885,
|
|
3426
|
+
columnNumber: 7
|
|
3427
|
+
}, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2914
3428
|
className: "p-4",
|
|
2915
|
-
children: /* @__PURE__ */ (0,
|
|
3429
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(DndContext, {
|
|
2916
3430
|
sensors,
|
|
2917
3431
|
collisionDetection: closestCenter,
|
|
2918
3432
|
onDragEnd: handleDragEnd,
|
|
2919
|
-
children: /* @__PURE__ */ (0,
|
|
3433
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(SortableContext, {
|
|
2920
3434
|
items: filteredTokens.map((t) => String(t.id)),
|
|
2921
3435
|
strategy: rectSortingStrategy,
|
|
2922
|
-
children: /* @__PURE__ */ (0,
|
|
3436
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2923
3437
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
2924
|
-
children: filteredTokens.map((token) => /* @__PURE__ */ (0,
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
3438
|
+
children: filteredTokens.map((token) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(SortableTokenCard, { token }, token.id, false, {
|
|
3439
|
+
fileName: _jsxFileName$1,
|
|
3440
|
+
lineNumber: 912,
|
|
3441
|
+
columnNumber: 17
|
|
3442
|
+
}, this))
|
|
3443
|
+
}, void 0, false, {
|
|
3444
|
+
fileName: _jsxFileName$1,
|
|
3445
|
+
lineNumber: 910,
|
|
3446
|
+
columnNumber: 13
|
|
3447
|
+
}, this)
|
|
3448
|
+
}, void 0, false, {
|
|
3449
|
+
fileName: _jsxFileName$1,
|
|
3450
|
+
lineNumber: 906,
|
|
3451
|
+
columnNumber: 11
|
|
3452
|
+
}, this)
|
|
3453
|
+
}, void 0, false, {
|
|
3454
|
+
fileName: _jsxFileName$1,
|
|
3455
|
+
lineNumber: 905,
|
|
3456
|
+
columnNumber: 9
|
|
3457
|
+
}, this)
|
|
3458
|
+
}, void 0, false, {
|
|
3459
|
+
fileName: _jsxFileName$1,
|
|
3460
|
+
lineNumber: 904,
|
|
3461
|
+
columnNumber: 7
|
|
3462
|
+
}, this)]
|
|
3463
|
+
}, void 0, true, {
|
|
3464
|
+
fileName: _jsxFileName$1,
|
|
3465
|
+
lineNumber: 884,
|
|
3466
|
+
columnNumber: 5
|
|
3467
|
+
}, this);
|
|
2930
3468
|
}
|
|
2931
3469
|
//#endregion
|
|
2932
3470
|
//#region src/routes/index.tsx?tsr-split=component
|
|
3471
|
+
var _jsxFileName = "/home/runner/work/qgrid/qgrid/packages/web/src/routes/index.tsx?tsr-split=component";
|
|
2933
3472
|
function Dashboard() {
|
|
2934
|
-
return /* @__PURE__ */ (0,
|
|
3473
|
+
return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
|
|
2935
3474
|
className: "max-w-6xl mx-auto",
|
|
2936
|
-
children: /* @__PURE__ */ (0,
|
|
2937
|
-
|
|
3475
|
+
children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(UsageCard, {}, void 0, false, {
|
|
3476
|
+
fileName: _jsxFileName,
|
|
3477
|
+
lineNumber: 4,
|
|
3478
|
+
columnNumber: 7
|
|
3479
|
+
}, this)
|
|
3480
|
+
}, void 0, false, {
|
|
3481
|
+
fileName: _jsxFileName,
|
|
3482
|
+
lineNumber: 3,
|
|
3483
|
+
columnNumber: 10
|
|
3484
|
+
}, this);
|
|
2938
3485
|
}
|
|
2939
3486
|
//#endregion
|
|
2940
3487
|
export { Dashboard as component };
|