chore: update frontend branding copy
This commit is contained in:
+65
-6
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useState } from 'react'
|
||||
import { type ColumnDef } from '@tanstack/react-table'
|
||||
import { CircleAlert, Sparkles, KeyRound } from 'lucide-react'
|
||||
import { CircleAlert, GitBranch, Sparkles, KeyRound } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { getUserAvatarFallback, getUserAvatarStyle } from '@/lib/avatar'
|
||||
import { formatBillingCurrencyFromUSD } from '@/lib/currency'
|
||||
@@ -29,6 +29,11 @@ import {
|
||||
} from '@/lib/format'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar'
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from '@/components/ui/popover'
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
@@ -318,16 +323,23 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
|
||||
|
||||
const other = parseLogOther(log.other)
|
||||
const affinity = other?.admin_info?.channel_affinity
|
||||
const useChannel = other?.admin_info?.use_channel
|
||||
const rawUseChannel = other?.admin_info?.use_channel ?? []
|
||||
const useChannel = Array.isArray(rawUseChannel)
|
||||
? rawUseChannel.map(String).filter(Boolean)
|
||||
: []
|
||||
const hasRetryChain = useChannel.length > 1
|
||||
const channelChain =
|
||||
useChannel && useChannel.length > 0
|
||||
? useChannel.join(' → ')
|
||||
: undefined
|
||||
hasRetryChain ? useChannel.join(' → ') : undefined
|
||||
const channelDisplay = log.channel_name
|
||||
? `${log.channel_name} #${log.channel}`
|
||||
: `#${log.channel}`
|
||||
const channelIdDisplay = `#${log.channel}`
|
||||
const channelName = sensitiveVisible ? log.channel_name : '••••'
|
||||
const multiKeyIndex = other?.admin_info?.multi_key_index
|
||||
const showMultiKeyIndex =
|
||||
other?.admin_info?.is_multi_key === true &&
|
||||
typeof multiKeyIndex === 'number' &&
|
||||
Number.isFinite(multiKeyIndex)
|
||||
|
||||
return (
|
||||
<TooltipProvider>
|
||||
@@ -337,7 +349,7 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
|
||||
<div className='flex max-w-[160px] flex-col gap-0.5' />
|
||||
}
|
||||
>
|
||||
<div className='relative inline-flex w-fit'>
|
||||
<div className='relative inline-flex w-fit items-center gap-1'>
|
||||
<StatusBadge
|
||||
label={channelIdDisplay}
|
||||
autoColor={String(log.channel)}
|
||||
@@ -346,6 +358,48 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
|
||||
showDot={false}
|
||||
className='font-mono'
|
||||
/>
|
||||
{showMultiKeyIndex && (
|
||||
<StatusBadge
|
||||
label={String(multiKeyIndex)}
|
||||
size='sm'
|
||||
showDot={false}
|
||||
copyable={false}
|
||||
variant='neutral'
|
||||
className='h-5 min-w-5 justify-center rounded-full px-1 font-mono text-xs'
|
||||
aria-label={`${t('Key')} ${multiKeyIndex}`}
|
||||
/>
|
||||
)}
|
||||
{hasRetryChain && (
|
||||
<Popover>
|
||||
<PopoverTrigger
|
||||
render={
|
||||
<button
|
||||
type='button'
|
||||
className='text-muted-foreground hover:text-foreground focus-visible:ring-ring inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:outline-none'
|
||||
aria-label={t('Retry Chain')}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<GitBranch
|
||||
className='size-3.5 text-amber-500'
|
||||
aria-hidden='true'
|
||||
/>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
side='top'
|
||||
align='start'
|
||||
className='w-64 text-xs'
|
||||
>
|
||||
<div className='flex flex-col gap-1'>
|
||||
<p className='font-medium'>{t('Retry Chain')}</p>
|
||||
<p className='text-muted-foreground font-mono break-all'>
|
||||
{channelChain}
|
||||
</p>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
)}
|
||||
{affinity && (
|
||||
<button
|
||||
type='button'
|
||||
@@ -384,6 +438,11 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
|
||||
{t('Chain')}: {channelChain}
|
||||
</p>
|
||||
)}
|
||||
{showMultiKeyIndex && (
|
||||
<p className='text-muted-foreground text-xs'>
|
||||
{t('Key')}: {multiKeyIndex}
|
||||
</p>
|
||||
)}
|
||||
{affinity && (
|
||||
<div className='border-t pt-1 text-xs'>
|
||||
<p className='font-medium'>{t('Channel Affinity')}</p>
|
||||
|
||||
@@ -161,7 +161,7 @@ export function TaskLogsFilterBar<TData>(props: TaskLogsFilterBarProps<TData>) {
|
||||
const filterValue = getFilterValue(filters, props.logCategory)
|
||||
const placeholder =
|
||||
props.logCategory === 'drawing'
|
||||
? t('Filter by Midjourney task ID')
|
||||
? t('Filter by MjProxy task ID')
|
||||
: t('Filter by task ID')
|
||||
const hasAdditionalFilters = !!filterValue || !!filters.channel
|
||||
const dateRangeFilter = (
|
||||
|
||||
@@ -209,7 +209,7 @@ function CommonLogsCard<TData>({
|
||||
<SummaryField
|
||||
label={t('Channel')}
|
||||
cell={cells.get('channel')}
|
||||
primaryOnly
|
||||
valueClassName='[&_.flex-col]:max-w-none'
|
||||
/>
|
||||
<SummaryField label={t('User')} cell={cells.get('user')} primaryOnly />
|
||||
<SummaryField
|
||||
|
||||
Reference in New Issue
Block a user