chore: update frontend branding copy

This commit is contained in:
CaIon
2026-06-19 18:14:40 +08:00
parent 29c3dcb927
commit 0467d54014
35 changed files with 174 additions and 116 deletions
+2 -2
View File
@@ -24,10 +24,10 @@ For commercial licensing, please contact support@quantumnous.com
export const CHANNEL_TYPES = {
0: 'Unknown',
1: 'OpenAI',
2: 'Midjourney',
2: 'MjProxy',
3: 'Azure',
4: 'Ollama',
5: 'MidjourneyPlus',
5: 'MjProxyPlus',
// 6: 'OpenAIMax',
7: 'OhMyGPT',
8: 'Custom',
+2 -2
View File
@@ -92,8 +92,8 @@ export function getChannelTypeIcon(type: number): string {
20: 'OpenRouter', // OpenRouter
// Image/Video generation
2: 'Midjourney', // Midjourney
5: 'Midjourney', // MidjourneyPlus
2: 'Midjourney', // MjProxy
5: 'Midjourney', // MjProxyPlus
50: 'Kling', // Kling
51: 'Jimeng', // Jimeng
52: 'Vidu', // Vidu
@@ -87,14 +87,14 @@ export function DrawingSettingsSection({
name: 'DrawingEnabled',
label: t('Enable drawing features'),
description: t(
'Required to expose Midjourney-style image generation to end users.'
'Required to expose MjProxy-style image generation to end users.'
),
},
{
name: 'MjNotifyEnabled',
label: t('Allow upstream callbacks'),
description: t(
'When enabled, Midjourney callbacks are accepted (reveals server IP).'
'When enabled, MjProxy callbacks are accepted (reveals server IP).'
),
},
{
@@ -115,7 +115,7 @@ export function DrawingSettingsSection({
name: 'MjModeClearEnabled',
label: t('Clear mode flags in prompts'),
description: t(
'Removes Midjourney flags such as --fast, --relax, and --turbo from user prompts.'
'Removes MjProxy flags such as --fast, --relax, and --turbo from user prompts.'
),
},
{
@@ -108,7 +108,7 @@ export function SidebarModulesSection({
},
midjourney: {
title: t('Drawing logs'),
description: t('History of Midjourney-style image tasks.'),
description: t('History of MjProxy-style image tasks.'),
},
task: {
title: t('Task logs'),
+1 -1
View File
@@ -91,7 +91,7 @@ export async function getUserInfo(
}
// ============================================================================
// Midjourney (Drawing) Logs API
// MjProxy (Drawing) Logs API
// ============================================================================
export const getAllMidjourneyLogs = (params: GetMidjourneyLogsParams) =>
@@ -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
+7 -7
View File
@@ -115,11 +115,11 @@ export const LOG_TYPE_FILTERS = [
] as const
// ============================================================================
// Drawing Logs (Midjourney) Constants
// Drawing Logs (MjProxy) Constants
// ============================================================================
/**
* Midjourney task types
* MjProxy task types
* Must match backend constants in constant/midjourney.go
*/
export const MJ_TASK_TYPES = {
@@ -144,7 +144,7 @@ export const MJ_TASK_TYPES = {
} as const
/**
* Midjourney task status
* MjProxy task status
*/
export const MJ_TASK_STATUS = {
NOT_START: 'NOT_START', // 未启动
@@ -156,7 +156,7 @@ export const MJ_TASK_STATUS = {
} as const
/**
* Midjourney submit result codes
* MjProxy submit result codes
*/
export const MJ_SUBMIT_RESULT_CODES = {
NOT_SUBMITTED: 0, // 未提交
@@ -223,7 +223,7 @@ export interface StatusMapping {
}
/**
* Midjourney task type mappings
* MjProxy task type mappings
*/
export const MJ_TASK_TYPE_MAPPINGS: Record<string, StatusMapping> = {
[MJ_TASK_TYPES.IMAGINE]: { label: 'Draw', variant: 'blue' },
@@ -246,7 +246,7 @@ export const MJ_TASK_TYPE_MAPPINGS: Record<string, StatusMapping> = {
}
/**
* Midjourney task status mappings
* MjProxy task status mappings
*/
export const MJ_STATUS_MAPPINGS: Record<string, StatusMapping> = {
[MJ_TASK_STATUS.SUCCESS]: { label: 'Success', variant: 'green' },
@@ -258,7 +258,7 @@ export const MJ_STATUS_MAPPINGS: Record<string, StatusMapping> = {
}
/**
* Midjourney submit result mappings
* MjProxy submit result mappings
*/
export const MJ_SUBMIT_RESULT_MAPPINGS: Record<string, StatusMapping> = {
[String(MJ_SUBMIT_RESULT_CODES.SUBMITTED)]: {
+1 -1
View File
@@ -27,7 +27,7 @@ import type { LogCategory } from '../types'
/**
* Get column definitions based on log category
* Returns any[] due to different log types (UsageLog, MidjourneyLog, TaskLog)
* Returns any[] due to different log types (UsageLog, MjProxy log, TaskLog)
*/
export function useColumnsByCategory(
logCategory: LogCategory,
+4 -4
View File
@@ -31,21 +31,21 @@ import {
import { createStatusMapper } from './status'
// ============================================================================
// Midjourney (Drawing) Logs Mappers
// MjProxy (Drawing) Logs Mappers
// ============================================================================
/**
* Midjourney task type mapper
* MjProxy task type mapper
*/
export const mjTaskTypeMapper = createStatusMapper(MJ_TASK_TYPE_MAPPINGS)
/**
* Midjourney task status mapper
* MjProxy task status mapper
*/
export const mjStatusMapper = createStatusMapper(MJ_STATUS_MAPPINGS)
/**
* Midjourney submit result mapper
* MjProxy submit result mapper
*/
export const mjSubmitResultMapper = createStatusMapper(
MJ_SUBMIT_RESULT_MAPPINGS
+1 -1
View File
@@ -221,7 +221,7 @@ export interface LogStatistics {
}
// ============================================================================
// Drawing Logs (Midjourney) Types
// Drawing Logs (MjProxy) Types
// ============================================================================
export interface MidjourneyLog {