Просмотр файла resources/views/counters/index.blade.php

Размер файла: 4.24Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.statistics'))
  4.  
  5. @section('breadcrumb')
  6. <nav>
  7. <ol class="breadcrumb">
  8. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  9. <li class="breadcrumb-item active">{{ __('index.statistics') }}</li>
  10. </ol>
  11. </nav>
  12. @stop
  13.  
  14. @section('content')
  15. <div class="row mb-3">
  16. <div class="col-md-6 col-12">
  17. {{ __('counters.users_total') }}: <b>{{ ($online[2]) }}</b><br>
  18. {{ __('counters.authorized_total') }}: <b>{{ $online[0] }}</b><br>
  19. {{ __('counters.guest_total') }}: <b>{{ $online[1] }}</b><br><br>
  20.  
  21. {{ __('counters.hosts_total') }}: <b>{{ $count['allhosts'] }}</b><br>
  22. {{ __('counters.hits_total') }}: <b>{{ $count['allhits'] }}</b><br>
  23. </div>
  24.  
  25. <div class="col-md-6 col-12">
  26. {{ __('counters.hosts_hour') }}: <b>{{ $count['hosts24'] }}</b><br>
  27. {{ __('counters.hits_hour') }}: <b>{{ $count['hits24'] }}</b><br><br>
  28.  
  29. {{ __('counters.hosts_day') }}: <b>{{ $count['dayhosts'] }}</b><br>
  30. {{ __('counters.hits_day') }}: <b>{{ $count['dayhits'] }}</b><br><br>
  31. </div>
  32. </div>
  33.  
  34. <h3>{{ __('counters.dynamics_day') }}</h3>
  35. <span class="badge rounded-pill bg-primary">{{ __('counters.hosts') }}</span>
  36. <span class="badge rounded-pill bg-warning">{{ __('counters.hits') }}</span>
  37.  
  38. <div class="ct-chart24 ct-perfect-fourth"></div>
  39.  
  40. <h3>{{ __('counters.dynamics_month') }}</h3>
  41. <span class="badge rounded-pill bg-primary">{{ __('counters.hosts') }}</span>
  42. <span class="badge rounded-pill bg-warning">{{ __('counters.hits') }}</span>
  43. <div class="ct-chart31 ct-perfect-fourth"></div>
  44. @stop
  45.  
  46. @push('styles')
  47. <link rel="stylesheet" href="/assets/css/chartist.min.css">
  48. <link rel="stylesheet" href="/assets/css/chartist-plugin-tooltip.css">
  49.  
  50. <style>
  51. .ct-series-a .ct-line,
  52. .ct-series-a .ct-point {
  53. stroke: #007bff;
  54. }
  55.  
  56. .ct-series-b .ct-line,
  57. .ct-series-b .ct-point {
  58. stroke: #ffc107;
  59. }
  60.  
  61. .ct-labels .ct-horizontal {
  62. white-space: nowrap;
  63. }
  64. </style>
  65. @endpush
  66.  
  67. @push('scripts')
  68. <script src="/assets/js/chartist.min.js"></script>
  69. <script src="/assets/js/chartist-plugin-tooltip.min.js"></script>
  70. <script>
  71. new Chartist.Line('.ct-chart31', {
  72. onlyInteger: true,
  73. labels: @json($counts31['labels']),
  74. series: [
  75. @json($counts31['hits']),
  76. @json($counts31['hosts'])
  77. ]
  78. }, {
  79. plugins: [
  80. Chartist.plugins.tooltip()
  81. ],
  82. reverseData: true,
  83. fullWidth: true,
  84. chartPadding: {
  85. right: 35
  86. },
  87. axisY: {
  88. onlyInteger: true,
  89. offset: 35,
  90. labelInterpolationFnc: function(value) {
  91. return (value > 1000) ? (value / 1000) + 'k' : value;
  92. }
  93. },
  94. axisX: {
  95. labelInterpolationFnc: function (value, index) {
  96. return index % 5 === 0 ? value : null;
  97. }
  98. }
  99. }, [
  100. ['screen and (min-width: 640px)', {
  101. axisX: {
  102. labelInterpolationFnc: function(value, index) {
  103. return index % 3 === 0 ? value : null;
  104. }
  105. }
  106. }]
  107. ]);
  108.  
  109. new Chartist.Line('.ct-chart24', {
  110. onlyInteger: true,
  111. labels: @json($counts24['labels']),
  112. series: [
  113. @json($counts24['hits']),
  114. @json($counts24['hosts'])
  115. ]
  116. }, {
  117. plugins: [
  118. Chartist.plugins.tooltip()
  119. ],
  120. reverseData: true,
  121. fullWidth: true,
  122. chartPadding: {
  123. right: 35
  124. },
  125. axisY: {
  126. onlyInteger: true,
  127. offset: 35
  128. },
  129. axisX: {
  130. labelInterpolationFnc: function (value, index) {
  131. return index % 3 === 0 ? value : null;
  132. }
  133. }
  134. });
  135. </script>
  136. @endpush