🚀 feat(pricing): clarify “auto” group routing chain and exclude it from price table

Detailed changes
Backend
• `controller/pricing.go` now includes `auto_groups` in `/api/pricing` response, sourced from `setting.AutoGroups`.

Frontend
• `useModelPricingData.js`
  – Parses `auto_groups` and exposes `autoGroups` state.
• `PricingPage.jsx` → `ModelDetailSideSheet.jsx` → `ModelPricingTable.jsx`
  – Thread `autoGroups` through component tree.
• `ModelPricingTable.jsx`
  – Removes deprecated `getGroupDescription` / `Tooltip`.
  – Filters out `auto` when building price table rows.
  – Renders a descriptive banner: “auto 分组调用链路 → auto → group1 → …”, clarifying fallback order without showing prices.
• Minor i18n tweak: adds `auto分组调用链路` key for the banner text.

Why
Users were confused by the “auto” tag appearing alongside regular groups with no price.
This change:
1. Makes the routing chain explicit.
2. Keeps the pricing table focused on billable groups.

No breaking API changes; existing clients can ignore the new `auto_groups` field.
This commit is contained in:
t0ng7u
2025-08-08 14:49:55 +08:00
parent 29ec328f46
commit 1690b05629
5 changed files with 35 additions and 32 deletions

View File

@@ -49,6 +49,7 @@ export const useModelPricingData = () => {
const [groupRatio, setGroupRatio] = useState({});
const [usableGroup, setUsableGroup] = useState({});
const [endpointMap, setEndpointMap] = useState({});
const [autoGroups, setAutoGroups] = useState([]);
const [statusState] = useContext(StatusContext);
const [userState] = useContext(UserContext);
@@ -160,7 +161,7 @@ export const useModelPricingData = () => {
setLoading(true);
let url = '/api/pricing';
const res = await API.get(url);
const { success, message, data, vendors, group_ratio, usable_group, supported_endpoint } = res.data;
const { success, message, data, vendors, group_ratio, usable_group, supported_endpoint, auto_groups } = res.data;
if (success) {
setGroupRatio(group_ratio);
setUsableGroup(usable_group);
@@ -174,6 +175,7 @@ export const useModelPricingData = () => {
}
setVendorsMap(vendorMap);
setEndpointMap(supported_endpoint || {});
setAutoGroups(auto_groups || []);
setModelsFormat(data, group_ratio, vendorMap);
} else {
showError(message);
@@ -282,6 +284,7 @@ export const useModelPricingData = () => {
groupRatio,
usableGroup,
endpointMap,
autoGroups,
// 计算属性
priceRate,