From 8408155be66817c6d904dc9a05f2e5a2c6a6f483 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Mon, 23 Mar 2026 23:14:39 +0700 Subject: [PATCH] =?UTF-8?q?feat(accounts):=20=C2=AB=D0=A5=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B5=D1=80=20/=20=D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD?= =?UTF-8?q?=D1=82=C2=BB=20=D0=B2=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8;=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=BB=D0=B0=D0=BD=D1=81=D0=B0=20=E2=80=94?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B8=D0=BC=D1=8F=20?= =?UTF-8?q?=D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- src/components/SyncLogTable.jsx | 17 ++++++++++++----- src/pages/AccountsPage.jsx | 6 +++++- src/pages/BalancePage.jsx | 6 +----- 3 files changed, 18 insertions(+), 11 deletions(-) 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 = [] }) { {syncLog.map((row) => ( - +
АккаунтХостер / аккаунт Начало Окончание Статус
{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 || '-'}