home.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. @extends('admin.partial.template-full')
  2. @section('section')
  3. </div>
  4. <div class="header bg-primary pb-3 mt-n4">
  5. <div class="container-fluid">
  6. <div class="header-body">
  7. <div class="row align-items-center py-4">
  8. <div class="col-lg-6 col-7">
  9. <p class="display-1 text-white d-inline-block mb-0">Stories</p>
  10. </div>
  11. </div>
  12. <div class="row">
  13. <div class="col-xl-3 col-md-6">
  14. <div class="card card-stats">
  15. <div class="card-body">
  16. <div class="row">
  17. <div class="col">
  18. <h5 class="card-title text-uppercase text-muted mb-0">Active Stories</h5>
  19. <span class="h2 font-weight-bold mb-0">{{$stats['active']['today']}}</span>
  20. </div>
  21. <div class="col-auto">
  22. <div class="icon icon-shape bg-gradient-primary text-white rounded-circle shadow">
  23. <i class="ni ni-image"></i>
  24. </div>
  25. </div>
  26. </div>
  27. <p class="mt-3 mb-0 text-sm">
  28. <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> {{$stats['active']['month']}}</span>
  29. <span class="text-nowrap">in last 30 days</span>
  30. </p>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="col-xl-3 col-md-6">
  35. <div class="card card-stats">
  36. <div class="card-body">
  37. <div class="row">
  38. <div class="col">
  39. <h5 class="card-title text-uppercase text-muted mb-0">Remote Stories</h5>
  40. <span class="h2 font-weight-bold mb-0">{{$stats['remote']['month']}}</span>
  41. </div>
  42. <div class="col-auto">
  43. <div class="icon icon-shape bg-gradient-primary text-white rounded-circle shadow">
  44. <i class="ni ni-circle-08"></i>
  45. </div>
  46. </div>
  47. </div>
  48. <p class="mt-3 mb-0 text-sm">
  49. <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> {{$stats['remote']['month']}}</span>
  50. <span class="text-nowrap">in last 30 days</span>
  51. </p>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="col-xl-2 col-md-6">
  56. <div class="mb-3">
  57. <h5 class="text-light text-uppercase mb-0">Total Stories</h5>
  58. <span class="text-white h2 font-weight-bold mb-0">{{$stats['total']}}</span>
  59. </div>
  60. <div class="">
  61. <h5 class="text-light text-uppercase mb-0">Stories Per User</h5>
  62. <span class="text-white h2 font-weight-bold mb-0">{{$stats['avg_spu']}}</span>
  63. </div>
  64. </div>
  65. <div class="col-xl-2 col-md-6">
  66. <div class="mb-3">
  67. <h5 class="text-light text-uppercase mb-0">Storage Used</h5>
  68. <span class="text-white h2 font-weight-bold mb-0 human-size">{{$stats['storage']['sum']}}</span>
  69. </div>
  70. <div class="">
  71. <h5 class="text-light text-uppercase mb-0">Average Media Size</h5>
  72. <span class="text-white h2 font-weight-bold mb-0 human-size">{{$stats['storage']['average']}}</span>
  73. </div>
  74. </div>
  75. <div class="col-xl-2 col-md-6">
  76. <div class="mb-3">
  77. <h5 class="text-light text-uppercase mb-0">Average Duration</h5>
  78. <span class="text-white h2 font-weight-bold mb-0">{{$stats['avg_duration']}}s</span>
  79. </div>
  80. <div class="">
  81. <h5 class="text-light text-uppercase mb-0">Average Type</h5>
  82. <span class="text-white h2 font-weight-bold mb-0">{{$stats['avg_type']}}</span>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="container-fluid mt-4">
  90. <div class="table-responsive">
  91. <table class="table table-dark">
  92. <thead class="thead-dark">
  93. <tr>
  94. <th scope="col" class="">#</th>
  95. <th scope="col" class="">Username</th>
  96. <th scope="col" class="">Type</th>
  97. <th scope="col" class="">View Count</th>
  98. <th scope="col" class="">Created</th>
  99. <th scope="col" class="">Expires</th>
  100. <th scope="col"></th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. @foreach($stories as $story)
  105. <tr>
  106. <th scope="row">
  107. <a href="{{$story->url()}}" class="text-monospace">
  108. {{$story->id}}
  109. </a>
  110. </th>
  111. <td class="font-weight-bold">{{$story->profile->username}}</td>
  112. <td class="font-weight-bold">{{$story->type}}</td>
  113. <td class="font-weight-bold">{{$story->view_count ?? 0}}</td>
  114. <td class="font-weight-bold">{{$story->created_at->diffForHumans(null, true, true, true)}}</td>
  115. <td class="font-weight-bold">{{optional($story->expires_at)->diffForHumans(null, true, true, true)}}</td>
  116. <td class="text-right">
  117. <div class="dropdown">
  118. <a class="btn btn-sm btn-icon-only text-light" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  119. <i class="fas fa-ellipsis-v"></i>
  120. </a>
  121. <div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
  122. <a class="dropdown-item" href="{{$story->mediaUrl()}}">Preview</a>
  123. <a class="dropdown-item" href="#">Delete</a>
  124. </div>
  125. </div>
  126. </td>
  127. </tr>
  128. @endforeach
  129. </tbody>
  130. </table>
  131. </div>
  132. <div class="d-flex justify-content-center mt-5 small">
  133. {{$stories->links()}}
  134. </div>
  135. </div>
  136. @endsection
  137. @push('scripts')
  138. <script type="text/javascript">
  139. $(document).ready(function() {
  140. $('.human-size').each(function(d,a) {
  141. a.innerText = filesize(a.innerText, {round: 0});
  142. });
  143. });
  144. </script>
  145. @endpush