admin-dashboard.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template lang='pug'>
  2. v-container(fluid, grid-list-lg)
  3. v-layout(row, wrap)
  4. v-flex(xs12)
  5. .admin-header
  6. img(src='/svg/icon-browse-page.svg', alt='Dashboard', style='width: 80px;')
  7. .admin-header-title
  8. .headline.primary--text {{ $t('admin:dashboard.title') }}
  9. .subheading.grey--text {{ $t('admin:dashboard.subtitle') }}
  10. v-flex(xs12 md6 lg4 xl3 d-flex)
  11. v-card.primary.dashboard-card(dark)
  12. v-card-text
  13. v-icon.dashboard-icon insert_drive_file
  14. .subheading Pages
  15. animated-number.display-1(
  16. :value='info.pagesTotal'
  17. :duration='2000'
  18. :formatValue='round'
  19. easing='easeOutQuint'
  20. )
  21. v-flex(xs12 md6 lg4 xl3 d-flex)
  22. v-card.indigo.lighten-1.dashboard-card(dark)
  23. v-card-text
  24. v-icon.dashboard-icon person
  25. .subheading Users
  26. animated-number.display-1(
  27. :value='info.usersTotal'
  28. :duration='2000'
  29. :formatValue='round'
  30. easing='easeOutQuint'
  31. )
  32. v-flex(xs12 md6 lg4 xl3 d-flex)
  33. v-card.indigo.lighten-2.dashboard-card(dark)
  34. v-card-text
  35. v-icon.dashboard-icon people
  36. .subheading Groups
  37. animated-number.display-1(
  38. :value='info.groupsTotal'
  39. :duration='2000'
  40. :formatValue='round'
  41. easing='easeOutQuint'
  42. )
  43. v-flex(xs12 md6 lg12 xl3 d-flex)
  44. v-card.dashboard-card(
  45. :class='isLatestVersion ? "teal lighten-2" : "red lighten-2"'
  46. dark
  47. )
  48. v-btn(fab, absolute, right, top, small, light, to='system')
  49. v-icon(v-if='isLatestVersion', color='teal') build
  50. v-icon(v-else, color='red darken-4') get_app
  51. v-card-text
  52. v-icon.dashboard-icon blur_on
  53. .subheading Wiki.js {{info.currentVersion}} BETA
  54. .body-2(v-if='isLatestVersion') You are running the latest version.
  55. .body-2(v-else) A new version is available: {{info.latestVersion}}
  56. v-flex(xs12)
  57. v-card.radius-7
  58. v-card-title.subheading(:class='$vuetify.dark ? `grey darken-2` : `grey lighten-5`') Recent Pages
  59. v-data-table.pb-2(
  60. :items='recentPages'
  61. hide-actions
  62. hide-headers
  63. )
  64. template(slot='items' slot-scope='props')
  65. td(width='20', style='padding-right: 0;'): v-icon insert_drive_file
  66. td
  67. .body-2.primary--text {{ props.item.title }}
  68. .caption.grey--text.text--darken-2 {{ props.item.description }}
  69. td.caption /{{ props.item.path }}
  70. td.grey--text.text--darken-2(width='250')
  71. .caption: strong Updated {{ props.item.updatedAt | moment('from') }}
  72. .caption Created {{ props.item.createdAt | moment('calendar') }}
  73. v-flex(xs12)
  74. v-card.radius-7
  75. v-card-title.subheading(:class='$vuetify.dark ? `grey darken-2` : `grey lighten-5`') Most Popular Pages
  76. v-data-table.pb-2(
  77. :items='popularPages'
  78. hide-actions
  79. hide-headers
  80. )
  81. template(slot='items' slot-scope='props')
  82. td(width='20', style='padding-right: 0;'): v-icon insert_drive_file
  83. td
  84. .body-2.primary--text {{ props.item.title }}
  85. .caption.grey--text.text--darken-2 {{ props.item.description }}
  86. td.caption /{{ props.item.path }}
  87. td.grey--text.text--darken-2(width='250')
  88. .caption: strong Updated {{ props.item.updatedAt | moment('from') }}
  89. .caption Created {{ props.item.createdAt | moment('calendar') }}
  90. v-flex(xs12)
  91. v-card.dashboard-contribute
  92. v-card-text
  93. img(src='/svg/icon-heart-health.svg', alt='Contribute', style='height: 80px;')
  94. .pl-3
  95. .subheading Contribute
  96. .body-2.pt-2 Wiki.js is a free and open source project. There are several ways you can contribute to the project.
  97. .body-1 We need your help!
  98. v-btn.mx-0.mt-2(:color='$vuetify.dark ? `indigo lighten-3` : `indigo`', outline, small, to='/contribute') Learn More
  99. </template>
  100. <script>
  101. import AnimatedNumber from 'animated-number-vue'
  102. import { get } from 'vuex-pathify'
  103. export default {
  104. components: {
  105. AnimatedNumber
  106. },
  107. data() {
  108. return {
  109. recentPages: [],
  110. popularPages: []
  111. }
  112. },
  113. computed: {
  114. isLatestVersion() {
  115. return this.info.currentVersion === this.info.latestVersion
  116. },
  117. info: get('admin/info')
  118. },
  119. methods: {
  120. round(val) { return Math.round(val) }
  121. }
  122. }
  123. </script>
  124. <style lang='scss'>
  125. .dashboard-card {
  126. display: flex;
  127. border-radius: 7px;
  128. .v-card__text {
  129. overflow: hidden;
  130. position: relative;
  131. }
  132. }
  133. .dashboard-contribute {
  134. background-color: #FFF;
  135. background-image: linear-gradient(to bottom, #FFF 0%, lighten(mc('indigo', '50'), 3%) 100%);
  136. border-radius: 7px;
  137. @at-root .theme--dark & {
  138. background-color: mc('grey', '800');
  139. background-image: linear-gradient(to bottom, mc('grey', '800') 0%, darken(mc('grey', '800'), 6%) 100%);
  140. }
  141. .v-card__text {
  142. display: flex;
  143. align-items: center;
  144. color: mc('indigo', '500');
  145. @at-root .theme--dark & {
  146. color: mc('grey', '300');
  147. }
  148. }
  149. }
  150. .dashboard-icon {
  151. position: absolute;
  152. right: 0;
  153. top: 12px;
  154. font-size: 120px;
  155. opacity: .25;
  156. }
  157. </style>