index.phtml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $this->partial('aside_subscription');
  4. ?>
  5. <main class="post">
  6. <div class="link-back-wrapper">
  7. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  8. </div>
  9. <h1><?= _t('admin.stats.main') ?></h1>
  10. <div class="stat-grid">
  11. <div class="stat half">
  12. <h2><?= _t('admin.stats.entry_repartition') ?></h2>
  13. <table>
  14. <thead>
  15. <tr>
  16. <th> </th>
  17. <th><?= _t('admin.stats.main_stream') ?></th>
  18. <th><?= _t('admin.stats.all_feeds') ?></th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. <tr>
  23. <th><?= _t('admin.stats.status_total') ?></th>
  24. <td class="numeric"><?= format_number($this->repartition['main_stream']['total']) ?></td>
  25. <td class="numeric"><?= format_number($this->repartition['all_feeds']['total']) ?></td>
  26. </tr>
  27. <tr>
  28. <th><?= _t('admin.stats.status_read') ?></th>
  29. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_reads']) ?></td>
  30. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_reads']) ?></td>
  31. </tr>
  32. <tr>
  33. <th><?= _t('admin.stats.status_unread') ?></th>
  34. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_unreads']) ?></td>
  35. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_unreads']) ?></td>
  36. </tr>
  37. <tr>
  38. <th><?= _t('admin.stats.status_favorites') ?></th>
  39. <td class="numeric"><?= format_number($this->repartition['main_stream']['count_favorites']) ?></td>
  40. <td class="numeric"><?= format_number($this->repartition['all_feeds']['count_favorites']) ?></td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div><!--
  45. --><div class="stat half">
  46. <h2><?= _t('admin.stats.top_feed') ?></h2>
  47. <table>
  48. <thead>
  49. <tr>
  50. <th><?= _t('admin.stats.feed') ?></th>
  51. <th><?= _t('admin.stats.category') ?></th>
  52. <th><?= _t('admin.stats.entry_count') ?></th>
  53. <th><?= _t('admin.stats.percent_of_total') ?></th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. <?php foreach ($this->topFeed as $feed) { ?>
  58. <tr>
  59. <td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td>
  60. <td><?= $feed['category'] ?></td>
  61. <td class="numeric"><?= format_number($feed['count']) ?></td>
  62. <td class="numeric"><?= format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1) ?></td>
  63. </tr>
  64. <?php } ?>
  65. </tbody>
  66. </table>
  67. </div>
  68. <div class="stat">
  69. <h2><?= _t('admin.stats.entry_per_day') ?></h2>
  70. <div>
  71. <canvas id="statsEntriesPerDay"></canvas>
  72. <script class="jsonData-stats" type="application/json">
  73. <?php
  74. echo json_encode(array(
  75. 'canvasID' => 'statsEntriesPerDay',
  76. 'charttype' => 'barWithAverage',
  77. 'labelBarChart' => _t('admin.stats.entry_count'),
  78. 'dataBarChart' => $this->entryCount,
  79. 'labelAverage' => 'Average ('.$this->average.')',
  80. 'dataAverage' => $this->average,
  81. 'xAxisLabels' => $this->last30DaysLabels,
  82. ), JSON_UNESCAPED_UNICODE);
  83. ?></script>
  84. </div>
  85. </div>
  86. <div class="stat half">
  87. <h2><?= _t('admin.stats.feed_per_category') ?></h2>
  88. <div>
  89. <canvas id="statsFeedsPerCategory"></canvas>
  90. <script class="jsonData-stats" type="application/json">
  91. <?php
  92. echo json_encode(array(
  93. 'canvasID' => 'statsFeedsPerCategory',
  94. 'charttype' => 'doughnut',
  95. 'data' => $this->feedByCategory['data'],
  96. 'labels' => $this->feedByCategory['label'],
  97. ), JSON_UNESCAPED_UNICODE);
  98. ?></script>
  99. </div>
  100. </div>
  101. <div class="stat half">
  102. <h2><?= _t('admin.stats.entry_per_category') ?></h2>
  103. <div>
  104. <canvas id="statsEntriesPerCategory"></canvas>
  105. <script class="jsonData-stats" type="application/json">
  106. <?php
  107. echo json_encode(array(
  108. 'canvasID' => 'statsEntriesPerCategory',
  109. 'charttype' => 'doughnut',
  110. 'data' => $this->entryByCategory['data'],
  111. 'labels' => $this->entryByCategory['label'],
  112. ), JSON_UNESCAPED_UNICODE);
  113. ?></script>
  114. </div>
  115. </div>
  116. </div>
  117. </main>
  118. <script src="../scripts/statsWithChartjs.js?<?= @filemtime(PUBLIC_PATH . '/scripts/statsWithChartjs.js') ?>"></script>