Compare commits

...

2 Commits

Author SHA1 Message Date
GitHub Action
356968a11a [automated] Apply ESLint and Oxfmt fixes 2026-05-14 03:29:48 +00:00
bymyself
505d6eca1c refactor: localize system stats headers and fix PyTorch casing
- Add 11 i18n keys for system stats column headers (g.systemStats*)
- Update SystemStatsPanel.vue to use headerKey with $t()
- Fix 'Pytorch' → 'PyTorch' casing in column header

Closes #11870

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-13 20:26:24 -07:00
2 changed files with 42 additions and 15 deletions

View File

@@ -13,7 +13,7 @@
<div class="grid grid-cols-2 gap-2">
<template v-for="col in systemColumns" :key="col.field">
<div :class="cn('font-medium', isOutdated(col) && 'text-danger-100')">
{{ col.header }}
{{ $t(col.headerKey) }}
</div>
<div :class="cn(isOutdated(col) && 'text-danger-100')">
{{ getDisplayValue(col) }}
@@ -58,8 +58,10 @@ import { isCloud } from '@/platform/distribution/types'
import type { SystemStats } from '@/schemas/apiSchema'
import { formatCommitHash, formatSize } from '@/utils/formatUtil'
import { cn } from '@comfyorg/tailwind-utils'
import { useI18n } from 'vue-i18n'
const frontendCommit = __COMFYUI_FRONTEND_COMMIT__
const { t } = useI18n()
const props = defineProps<{
stats: SystemStats
@@ -78,7 +80,7 @@ type SystemInfoKey = keyof SystemStats['system']
type ColumnDef = {
field: SystemInfoKey
header: string
headerKey: string
getValue?: () => string
format?: (value: string) => string
formatNumber?: (value: number) => string
@@ -86,31 +88,45 @@ type ColumnDef = {
/** Columns for local distribution */
const localColumns: ColumnDef[] = [
{ field: 'os', header: 'OS' },
{ field: 'python_version', header: 'Python Version' },
{ field: 'embedded_python', header: 'Embedded Python' },
{ field: 'pytorch_version', header: 'Pytorch Version' },
{ field: 'argv', header: 'Arguments' },
{ field: 'ram_total', header: 'RAM Total', formatNumber: formatSize },
{ field: 'ram_free', header: 'RAM Free', formatNumber: formatSize },
{ field: 'installed_templates_version', header: 'Templates Version' }
{ field: 'os', headerKey: 'g.systemStatsOS' },
{ field: 'python_version', headerKey: 'g.systemStatsPythonVersion' },
{ field: 'embedded_python', headerKey: 'g.systemStatsEmbeddedPython' },
{ field: 'pytorch_version', headerKey: 'g.systemStatsPyTorchVersion' },
{ field: 'argv', headerKey: 'g.systemStatsArguments' },
{
field: 'ram_total',
headerKey: 'g.systemStatsRAMTotal',
formatNumber: formatSize
},
{
field: 'ram_free',
headerKey: 'g.systemStatsRAMFree',
formatNumber: formatSize
},
{
field: 'installed_templates_version',
headerKey: 'g.systemStatsTemplatesVersion'
}
]
/** Columns for cloud distribution */
const cloudColumns: ColumnDef[] = [
{ field: 'cloud_version', header: 'Cloud Version' },
{ field: 'cloud_version', headerKey: 'g.systemStatsCloudVersion' },
{
field: 'comfyui_version',
header: 'ComfyUI Version',
headerKey: 'g.systemStatsComfyUIVersion',
format: formatCommitHash
},
{
field: 'comfyui_frontend_version',
header: 'Frontend Version',
headerKey: 'g.systemStatsFrontendVersion',
getValue: () => frontendCommit,
format: formatCommitHash
},
{ field: 'workflow_templates_version', header: 'Templates Version' }
{
field: 'workflow_templates_version',
headerKey: 'g.systemStatsTemplatesVersion'
}
]
const systemColumns = computed(() => (isCloud ? cloudColumns : localColumns))
@@ -141,7 +157,7 @@ function formatSystemInfoText(): string {
for (const col of systemColumns.value) {
const display = getDisplayValue(col)
if (display !== undefined && display !== '') {
lines.push(`${col.header}: ${display}`)
lines.push(`${t(col.headerKey)}: ${display}`)
}
}

View File

@@ -64,6 +64,17 @@
"insert": "Insert",
"systemInfo": "System Info",
"devices": "Devices",
"systemStatsOS": "OS",
"systemStatsPythonVersion": "Python Version",
"systemStatsEmbeddedPython": "Embedded Python",
"systemStatsPyTorchVersion": "PyTorch Version",
"systemStatsArguments": "Arguments",
"systemStatsRAMTotal": "RAM Total",
"systemStatsRAMFree": "RAM Free",
"systemStatsTemplatesVersion": "Templates Version",
"systemStatsCloudVersion": "Cloud Version",
"systemStatsComfyUIVersion": "ComfyUI Version",
"systemStatsFrontendVersion": "Frontend Version",
"about": "About",
"add": "Add",
"confirm": "Confirm",