feat: add channel sensitive info toggle

This commit is contained in:
CaIon
2026-06-19 20:09:18 +08:00
parent 4206d7fd58
commit 9100e15e4e
6 changed files with 141 additions and 49 deletions
@@ -139,6 +139,8 @@ type CodexUsageDialogProps = {
onOpenChange: (open: boolean) => void
channelName?: string
channelId?: number
channelDisplayName?: string
channelDisplayId?: string
response: CodexUsageDialogData | null
onRefresh?: () => void | Promise<void>
isRefreshing?: boolean
@@ -885,6 +887,8 @@ export function CodexUsageDialog({
onOpenChange,
channelName,
channelId,
channelDisplayName,
channelDisplayId,
response,
onRefresh,
isRefreshing,
@@ -931,9 +935,14 @@ export function CodexUsageDialog({
? String(resetCredits)
: '-'
const canResetCodexUsage = Number(resetCredits) > 0
const channelLabel = `${channelName || '-'}${
channelId ? ` (#${channelId})` : ''
}`
const channelLabelName = channelDisplayName ?? channelName ?? '-'
let channelLabelId = ''
if (channelDisplayId != null) {
channelLabelId = ` (#${channelDisplayId})`
} else if (channelId) {
channelLabelId = ` (#${channelId})`
}
const channelLabel = `${channelLabelName}${channelLabelId}`
const { fiveHourWindow, weeklyWindow } = resolveRateLimitWindows(payload)
const errorMessage =