AdminDashboard.vue 2.5 KB

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