feat(accounts): «Хостер / аккаунт» в журнале синхронизации; журнал баланса — только имя аккаунта

Made-with: Cursor
This commit is contained in:
Denozordec
2026-03-23 23:14:39 +07:00
parent 24e1b8f4ef
commit 8408155be6
3 changed files with 18 additions and 11 deletions
+12 -5
View File
@@ -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 = [] }) {
<table className="table card-table table-vcenter">
<thead>
<tr>
<th>Аккаунт</th>
<th>Хостер / аккаунт</th>
<th>Начало</th>
<th>Окончание</th>
<th>Статус</th>
@@ -46,7 +53,7 @@ export function SyncLogTable({ syncLog = [], providerAccounts = [] }) {
<tbody>
{syncLog.map((row) => (
<tr key={row.id || `${row.accountId}-${row.startedAt}`}>
<td>{getAccountName(row.accountId)}</td>
<td>{labelForAccountId(row.accountId)}</td>
<td>{formatDate(row.startedAt)}</td>
<td>{formatDate(row.finishedAt)}</td>
<td>
+5 -1
View File
@@ -449,7 +449,11 @@ export function AccountsPage({ db, actions, settings, ratesData }) {
</div>
<div className="col-12 mt-3">
<SyncLogTable syncLog={syncLog} providerAccounts={db.providerAccounts} />
<SyncLogTable
syncLog={syncLog}
providerAccounts={db.providerAccounts}
providers={db.providers}
/>
</div>
</div>
+1 -5
View File
@@ -152,11 +152,7 @@ export function BalancePage({ db, actions, settings, ratesData }) {
</span>
</td>
<td>
<div>
{account
? accountSelectLabel(account, providerById, '')
: '-'}
</div>
<div>{account?.name || '-'}</div>
<div className="text-secondary">{vps?.dns || vps?.ip || '-'}</div>
</td>
<td>