diff --git a/src/main/index.js b/src/main/index.js index 7c9f8f1..82773c0 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1338,6 +1338,8 @@ ipcMain.handle("tasks:status", (_event, id) => { const readiness = { ok: true, reasons: [] }; let restrictedAccounts = []; let totalInvites = 0; + let totalInvitesSuccess = 0; + let totalInvitesAttempts = 0; let taskInviteLimitTotal = 0; let accountDailyLimitTotal = 0; let inviteAccountsCount = 0; @@ -1385,11 +1387,13 @@ ipcMain.handle("tasks:status", (_event, id) => { const account = accountsById.get(row.account_id); return sum + Math.max(0, Number(account && account.daily_limit ? account.daily_limit : 0)); }, 0); - totalInvites = - Number(store.countInvitesByStatus(id, "success") || 0) + totalInvitesSuccess = Number(store.countInvitesByStatus(id, "success") || 0); + totalInvitesAttempts = + totalInvitesSuccess + Number(store.countInvitesByStatus(id, "failed") || 0) + Number(store.countInvitesByStatus(id, "skipped") || 0) + Number(store.countInvitesByStatus(id, "unconfirmed") || 0); + totalInvites = totalInvitesAttempts; const monitorRows = accountRows.filter((row) => row.role_monitor); if (!inviteRows.length) { const fallbackAvailable = accountRows @@ -1510,6 +1514,8 @@ ipcMain.handle("tasks:status", (_event, id) => { queueCount, dailyUsed, totalInvites, + totalInvitesSuccess, + totalInvitesAttempts, unconfirmedCount, dailyLimit: effectiveLimit, taskDailyLimitBase: task ? Number(task.daily_limit || 0) : 0, diff --git a/src/renderer/components/TasksSidebar.jsx b/src/renderer/components/TasksSidebar.jsx index 17670b6..a15c431 100644 --- a/src/renderer/components/TasksSidebar.jsx +++ b/src/renderer/components/TasksSidebar.jsx @@ -87,9 +87,11 @@ export default function TasksSidebar({ const dailyLabel = status ? `Лимит сегодня: ${status.dailyUsed}/${status.dailyLimit}${warmupDelta > 0 ? ` (старт ${warmupStart} +${warmupDelta} прогрев)` : ""}` : "Лимит сегодня: —"; - const totalLabel = status ? `Инвайтов всего: ${status.totalInvites || 0}` : "Инвайтов всего: —"; + const totalSuccessLabel = status ? `Инвайтов всего: ${status.totalInvitesSuccess || 0}` : "Инвайтов всего: —"; + const totalAttemptsLabel = status ? `Попыток всего: ${status.totalInvitesAttempts || 0}` : "Попыток всего: —"; const taskLimitLabel = status ? `Лимит задачи: ${status.dailyLimit || 0}` : "Лимит задачи: —"; - const accountLimitLabel = status ? `Лимит аккаунтов: ${status.accountDailyLimitTotal || 0}` : "Лимит аккаунтов: —"; + const accountCycleLimitLabel = status ? `Лимит аккаунтов (цикл): ${status.taskInviteLimitTotal || 0}` : "Лимит аккаунтов (цикл): —"; + const accountDailyCapLabel = status ? `Потолок аккаунтов (день): ${status.accountDailyLimitTotal || 0}` : "Потолок аккаунтов (день): —"; const cycleLabel = status && status.running ? `Цикл: ${formatCountdown(status.nextRunAt)}` : "Цикл: —"; const lastMessageRaw = status && status.monitorInfo && status.monitorInfo.lastMessageAt ? status.monitorInfo.lastMessageAt @@ -115,9 +117,11 @@ export default function TasksSidebar({ `Статус: ${statusLabel}`, `Очередь: ${status ? status.queueCount : "—"}`, `Лимит сегодня: ${status ? `${status.dailyUsed}/${status.dailyLimit}${warmupDelta > 0 ? ` (старт ${warmupStart} +${warmupDelta} прогрев)` : ""}` : "—"}`, - `Инвайтов всего: ${status ? status.totalInvites || 0 : "—"}`, + `Инвайтов всего (успешных): ${status ? status.totalInvitesSuccess || 0 : "—"}`, + `Попыток всего: ${status ? status.totalInvitesAttempts || 0 : "—"}`, `Лимит задачи: ${status ? status.dailyLimit || 0 : "—"}`, - `Лимит аккаунтов: ${status ? status.accountDailyLimitTotal || 0 : "—"}`, + `Лимит аккаунтов (цикл): ${status ? status.taskInviteLimitTotal || 0 : "—"}`, + `Потолок аккаунтов (день): ${status ? status.accountDailyLimitTotal || 0 : "—"}`, `Мониторинг: ${monitoring ? "активен" : "нет"}`, `Мониторит: ${monitorLabel}`, `Последнее: ${lastMessage}`, @@ -146,11 +150,15 @@ export default function TasksSidebar({