logs.phtml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php /** @var FreshRSS_View $this */ ?>
  2. <main class="post content">
  3. <div class="link-back-wrapper">
  4. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  5. </div>
  6. <h1><?= _t('index.log') ?></h1>
  7. <form method="post" action="<?= _url('index', 'logs') ?>"><p>
  8. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  9. <input type="hidden" name="clearLogs" />
  10. <button type="submit" class="btn"><?= _t('index.log.clear') ?></button>
  11. </p></form>
  12. <?php
  13. /** @var array<FreshRSS_Log> $items */
  14. $items = $this->logsPaginator->items();
  15. ?>
  16. <?php if (!empty($items)) { ?>
  17. <div class="loglist">
  18. <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
  19. <?php foreach ($items as $log) { ?>
  20. <div class="log <?= $log->level() ?>"><span class="date">
  21. <?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?>
  22. </span><?= htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8') ?></div>
  23. <?php } ?>
  24. <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?>
  25. </div>
  26. <?php } else { ?>
  27. <p class="alert alert-warn"><?= _t('index.log.empty') ?></p>
  28. <?php } ?>
  29. </main>