fix: address audit findings across websearch, notify, and channel pricing
Backend fixes: - Fix balance notify ignoring percentage threshold type (was treating percentage value as fixed USD amount) - Remove dead code parseJSONStringArray - Add ImageOutputTokens to tryModelFilePricing calculation - Unify zero-value check: cost == 0 → cost <= 0 in calculateTokenStatsCost - Use MarshalNotifyEmails instead of json.Marshal for consistency - Rename quotaDim.oldUsed → currentUsed for clarity - Extract HTML email templates to const variables (function ≤30 lines) Test fixes: - Rewrite account_websearch_test.go for GetWebSearchEmulationMode tri-state - Add 6 tryModelFilePricing test cases Frontend fixes: - Replace hardcoded '未命名' with i18n key - Extract getBillingModeLabel/getBillingModeBadgeClass to shared utils - Replace inline type with imported NotifyEmailEntry - Pass platform to AccountStats pricing rules via inferRulePlatform() - Add billing mode constants (BILLING_MODE_TOKEN/PER_REQUEST/IMAGE)
This commit is contained in:
@@ -1889,7 +1889,8 @@ export default {
|
||||
searchAccountPlaceholder: 'Search accounts...',
|
||||
ruleAccountsHint: 'Leave empty to match all accounts',
|
||||
ruleModelPricing: 'Model Pricing',
|
||||
noGroupsInChannel: 'No groups selected in platform tabs above'
|
||||
noGroupsInChannel: 'No groups selected in platform tabs above',
|
||||
unnamed: 'Unnamed'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1968,7 +1968,8 @@ export default {
|
||||
searchAccountPlaceholder: '搜索账号...',
|
||||
ruleAccountsHint: '留空表示匹配所有账号',
|
||||
ruleModelPricing: '模型定价',
|
||||
noGroupsInChannel: '上方平台标签页中未选择分组'
|
||||
noGroupsInChannel: '上方平台标签页中未选择分组',
|
||||
unnamed: '未命名'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user