feat(usage): 订阅套餐计价修正 + 识图能力可编辑 + 单套餐用量显示修复

- 订阅套餐零价条目按官方付费模型计价(zhipuai-coding-plan/glm-5.2 → zhipuai/glm-5.2 牌价)
- -highspeed / -free 派生变体自动回退到基础模型价格;Kimi For Coding 无牌价时按旗舰 kimi-k3 估算
- 设置页:image_in 识图能力可手动编辑,原生多模态模型不再提示 kimi-eyes 插件
- 修复仅单个套餐档位时用量卡片不显示的问题
- kimi usages 响应异常时透出原始返回(仅用量数字),便于对照接口排查
- models.dev 价格快照同步
This commit is contained in:
KimiSwitch Dev committed 2026-08-02 17:17:06 +08:00
1 parent 2f75929fda
commit 69f9b8d603
8 files changed
+550 -52

No files matched your search

+16 -7
View File
@@ -699,6 +699,7 @@ function ModelMapping({
<td className="px-4 py-2">
<CapabilitiesCell
capabilities={m.capabilities || []}
nativeImage={getModelRef(m.model)?.image === true}
onChange={(next) =>
onModelChange({ ...m, capabilities: next })
}
@@ -822,9 +823,13 @@ function JsonPreview({
function CapabilitiesCell({
capabilities,
onChange,
nativeImage,
}: {
capabilities: string[];
onChange: (next: string[]) => void;
/** 模型本身是否原生支持图像输入(models.dev `image` 能力)。原生多模态
* 模型无需 kimi-eyes 插件,提示不展示。 */
nativeImage?: boolean;
}) {
const { t } = useTranslation();
@@ -838,13 +843,12 @@ function CapabilitiesCell({
return (
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5">
{/* Only `thinking` is user-editable. The other capabilities
(always_thinking / image_in / video_in / tool_use) are still
auto-derived from models.dev via `capabilitiesFromRef` and saved
to config.toml — they just aren't exposed for manual editing.
To restore the full editor, drop the `.filter(...)` below and
re-add the custom-capabilities input (see git history). */}
{KNOWN_CAPABILITIES.filter((cap) => cap === "thinking").map((cap) => (
{/* `thinking` 与 `image_in`(识图)可手动编辑;其余能力
(always_thinking / video_in / tool_use) 仍由 models.dev 自动派生,
保存时照常写入 config.toml。 */}
{KNOWN_CAPABILITIES.filter(
(cap) => cap === "thinking" || cap === "image_in",
).map((cap) => (
<label
key={cap}
className="flex items-center gap-1 text-xs text-content-muted cursor-pointer"
@@ -858,6 +862,11 @@ function CapabilitiesCell({
{t(CAPABILITY_LABELS[cap])}
</label>
))}
{capabilities.includes("image_in") && !nativeImage && (
<span className="w-full text-[11px] text-content-muted">
{t("capImageInHint")}
</span>
)}
</div>
);
}
+3 -1
View File
@@ -357,7 +357,9 @@ export function UsageFooter({
// success, or error/loading with last-good data (ghost).
// Compact header already shows the primary entry; detail only adds value
// when there are multiple tiers (e.g. 5h + weekly) or on error ghost.
if (data.length <= 1 && status === "success") return null;
// NOTE: single-tier plans (e.g. only five_hour) must still render — hiding
// them made kimi-for-coding look like it had no plan quota at all.
if (data.length === 0 && status === "success") return null;
const ghost = status !== "success";
return (
<div