feat(admin): silent-drop counter line in dashboard widget
This commit is contained in:
@@ -30,6 +30,8 @@ final class Dashboard_Widget
|
||||
$pending = Queue::count_by_status(Queue::STATUS_PENDING);
|
||||
$sent_24h = Queue::count_sent_last_24h();
|
||||
$configured = Settings::is_configured();
|
||||
$dry_run_on = Settings::is_dry_run_drop();
|
||||
$drop_counters = Settings::get_drop_counters();
|
||||
$settings_url = admin_url('options-general.php?page=cf7stg-settings');
|
||||
include CF7STG_PLUGIN_DIR . 'admin/views/dashboard-widget.php';
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
/** @var int $sent_24h */
|
||||
/** @var bool $configured */
|
||||
/** @var string $settings_url */
|
||||
/** @var bool $dry_run_on */
|
||||
/** @var array $drop_counters */
|
||||
?>
|
||||
<?php if (!$configured): ?>
|
||||
<p>⚙️ Плагин не настроен — укажите <b>Bot Token</b> и <b>Chat ID</b> в настройках.</p>
|
||||
@@ -20,6 +22,14 @@
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php if ($dry_run_on): ?>
|
||||
Dry-run: за сегодня было бы дропнуто <b><?php echo (int)$drop_counters['dry_today']; ?></b>, всего <b><?php echo (int)$drop_counters['total']; ?></b>.
|
||||
<?php else: ?>
|
||||
Дропнуто сегодня: <b><?php echo (int)$drop_counters['real_today']; ?></b> (вчера <?php echo (int)$drop_counters['real_yesterday']; ?>, всего <?php echo (int)$drop_counters['total']; ?>).
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php if ($failed_count > 0): ?>
|
||||
<p style="margin-top:10px">Последние ошибки доставки (TG-API):</p>
|
||||
<ul style="margin:0 0 8px 18px;list-style:disc">
|
||||
|
||||
Reference in New Issue
Block a user