Skip to content

feat(ui): three-level provider → plan → model listing form - #30

Merged
argszero merged 1 commit into
mainfrom
feat/ui-listing-provider-plan
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/ui-listing-provider-plan

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Rework the listing (上架) form from "provider → model" to a three-level cascade provider → Plan → model, with a built-in catalog of known domestic plans. Users mostly share their plan subscriptions (Aliyun Token Plan, Kimi Code, …) rather than pay-as-you-go keys, and different plans of the same provider can have different base URLs — so the listing selects the provider's Plan (where "API" means a pay-as-you-go key), then the models that plan supports.

Rant reference

Host instruction (rant 2026-08-17T10:51:24, 上架表单改为"厂商 → Plan → 模型"):

宿主指出:

  1. 用户分享上架时,大部分分享的是自己的 Plan 订阅(如阿里 Token Plan、Kimi Code),而不是直接分享按量计价的 key;
  2. 同一厂商的不同 Plan,Base URL 可能不同(如火山方舟 Coding Plan 与 Agent Plan 端点不同;DeepSeek 无 plan 就是按量 API);
  3. 所以上架时选择的是厂商 Plan,而不是厂商/模型——流程应为:选厂商 → 选 Plan(列表里 "API" 代表按量计价的 key)→ 选该 Plan 支持的模型;
  4. 把国内已知 Plan 都内置进去。

Changes (ui/)

  • ui/js/data.js:
    • new PLANS array — 12 plans across 6 providers (阿里云百炼 / 智谱 / 火山方舟 / Kimi 月之暗面 / MiniMax / DeepSeek), each provider including an api-type "API(按量)" entry; fields id / provider / name / type(api|coding|token) / keyPrefix / note
    • new PROVIDER_LABELS map for display names
    • added an aliyun-bailian model (qwen3-max) so the Aliyun plans have selectable models
    • SHARINGS entries now carry provider + plan
  • ui/index.html: form gains a Plan select (#sf-plan) + hint line (#sf-plan-hint) between provider and model; listing table header → "厂商 · Plan / 模型"
  • ui/js/app.js:
    • form init now cascades provider → plan → model (plans filtered by provider, models filtered by plan's provider)
    • new showPlanHint() — shows key-prefix / endpoint note for the selected plan (e.g. sk-sp-, sk-cp-, /api/coding/v3)
    • submit captures provider + plan; toast shows "厂商 · Plan · 模型"
    • listing table shows "智谱 · GLM Coding Plan" with model underneath; dashboard mini-list also shows the plan
    • auto pricing by model unchanged
  • ui/README.md: synced sharing section

Verification

  • node --check ui/js/app.js / ui/js/data.js pass
  • Cascade check: 6 providers, every provider has ≥1 api plan (PASS), 12 plans total
  • cargo test passes (1 passed)
  • cargo fmt --check passes

Users mostly share their plan subscriptions (e.g. Aliyun Token Plan,
Kimi Code) rather than pay-as-you-go keys, and different plans of the
same provider may have different base URLs. Rework the listing form to
select provider → plan → model, with a built-in catalog of known
domestic plans (each provider has an "API(按量)" pay-as-you-go entry).
Selecting a plan shows key-prefix / endpoint hints. The listing table
now shows "provider · plan / model" (e.g. 智谱 · GLM Coding Plan /
glm-5.2). Auto pricing by model is unchanged. Adds an aliyun-bailian
model (qwen3-max) so the Aliyun plans have selectable models.

Refs: rant 2026-08-17T10:51:24 (上架表单改为"厂商 → Plan → 模型")
@argszero
argszero merged commit d41d40d into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant