AdminDashboard.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class='admin_dashboard'>
  3. <div class='admin_dashboard__row'>
  4. <div class='admin_dashboard__card admin_dashboard__card--3'>
  5. <line-chart background='#f39c12' point='rgb(255, 237, 127)' tooltip='page view'></line-chart>
  6. <div class='admin_dashboard__card__title'>Page views over the past week</div>
  7. </div>
  8. <div class='admin_dashboard__card admin_dashboard__card--2'>
  9. <new-posts></new-posts>
  10. <div class='admin_dashboard__card__title'>New posts in the last 24 hours</div>
  11. </div>
  12. <div class='admin_dashboard__card admin_dashboard__card--2'>
  13. <categories-chart></categories-chart>
  14. <div class='admin_dashboard__card__title'>Number of threads by category</div>
  15. </div>
  16. </div>
  17. <div class='admin_dashboard__row'>
  18. <div class='admin_dashboard__card admin_dashboard__card--2'>
  19. <top-posts></top-posts>
  20. <div class='admin_dashboard__card__title'>Top threads by page views today</div>
  21. </div>
  22. <div class='admin_dashboard__card admin_dashboard__card--3'>
  23. <line-chart background='#84dec0' point='#1da8ce' tooltip='new user'></line-chart>
  24. <div class='admin_dashboard__card__title'>New users over the past week</div>
  25. </div>
  26. <div class='admin_dashboard__card admin_dashboard__card--2 admin_dashboard__card--hidden'></div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import NewPosts from '../widgets/NewPosts'
  32. import LineChart from '../widgets/LineChart'
  33. import CategoriesChart from '../widgets/CategoriesChart'
  34. import TopPosts from '../widgets/TopPosts'
  35. export default {
  36. name: 'AdminDashboard',
  37. components: {
  38. NewPosts,
  39. LineChart,
  40. CategoriesChart,
  41. TopPosts
  42. },
  43. mounted () {
  44. this.$store.dispatch('setTitle', 'admin | dashboard')
  45. }
  46. }
  47. </script>
  48. <style lang='scss' scoped>
  49. @import '../../assets/scss/variables.scss';
  50. .admin_dashboard {
  51. padding: 1rem;
  52. @at-root #{&}__row {
  53. display: flex;
  54. }
  55. @at-root #{&}__card {
  56. margin: 1rem;
  57. height: 12rem;
  58. background-color: #fff;
  59. border-radius: 0.25rem;
  60. flex: 1;
  61. display: flex;
  62. flex-direction: column;
  63. @extend .shadow_border;
  64. @for $i from 1 through 5 {
  65. @at-root #{&}--#{$i} {
  66. flex: $i;
  67. }
  68. }
  69. @at-root #{&}--hidden {
  70. visibility: hidden;
  71. }
  72. @at-root #{&}__title {
  73. background-color: $color__gray--primary;
  74. width: 100%;
  75. padding: 0.25rem 0.35rem;
  76. box-shadow: 0 0.1rem 0.075rem rgba(175, 175, 175, 0.25);
  77. border-radius: 0 0 0.25rem 0.25rem;
  78. cursor: default;
  79. font-size: 0.9rem;
  80. }
  81. }
  82. }
  83. </style>