diff --git a/src/components/SyncLogTable.jsx b/src/components/SyncLogTable.jsx index 942c988..c62a825 100644 --- a/src/components/SyncLogTable.jsx +++ b/src/components/SyncLogTable.jsx @@ -1,10 +1,17 @@ +import { useMemo } from 'react' import { EmptyState } from './EmptyState' import { formatSyncSummaryLine } from '../lib/inventory-health' +import { accountSelectLabel } from '../lib/account-select-label' -export function SyncLogTable({ syncLog = [], providerAccounts = [] }) { - const getAccountName = (accountId) => { +export function SyncLogTable({ syncLog = [], providerAccounts = [], providers = [] }) { + const providerById = useMemo( + () => new Map((providers || []).map((p) => [p.id, p])), + [providers], + ) + const labelForAccountId = (accountId) => { const account = providerAccounts.find((a) => a.id === accountId) - return account?.name || accountId + if (!account) return accountId + return accountSelectLabel(account, providerById, '') } const formatDate = (dateStr) => { @@ -33,7 +40,7 @@ export function SyncLogTable({ syncLog = [], providerAccounts = [] }) {
| Аккаунт | +Хостер / аккаунт | Начало | Окончание | Статус | @@ -46,7 +53,7 @@ export function SyncLogTable({ syncLog = [], providerAccounts = [] }) {||
|---|---|---|---|---|---|---|
| {getAccountName(row.accountId)} | +{labelForAccountId(row.accountId)} | {formatDate(row.startedAt)} | {formatDate(row.finishedAt)} |
diff --git a/src/pages/AccountsPage.jsx b/src/pages/AccountsPage.jsx
index 576c3a8..e6d9c98 100644
--- a/src/pages/AccountsPage.jsx
+++ b/src/pages/AccountsPage.jsx
@@ -449,7 +449,11 @@ export function AccountsPage({ db, actions, settings, ratesData }) {
-
diff --git a/src/pages/BalancePage.jsx b/src/pages/BalancePage.jsx
index 2c03978..590fe1d 100644
--- a/src/pages/BalancePage.jsx
+++ b/src/pages/BalancePage.jsx
@@ -152,11 +152,7 @@ export function BalancePage({ db, actions, settings, ratesData }) {
|
-
- {account
- ? accountSelectLabel(account, providerById, '')
- : '-'}
-
+ {account?.name || '-'}
{vps?.dns || vps?.ip || '-'}
|