2018-02-28 05:54:09 +00:00
|
|
|
<template lang='pug'>
|
2018-09-30 03:30:20 +00:00
|
|
|
v-container(fluid, grid-list-lg)
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex(xs12)
|
|
|
|
.admin-header
|
2019-03-17 17:39:58 +00:00
|
|
|
img.animated.fadeInUp(src='/svg/icon-browse-page.svg', alt='Dashboard', style='width: 80px;')
|
2018-09-30 03:30:20 +00:00
|
|
|
.admin-header-title
|
2019-03-17 17:39:58 +00:00
|
|
|
.headline.primary--text.animated.fadeInLeft {{ $t('admin:dashboard.title') }}
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1.grey--text.animated.fadeInLeft.wait-p2s {{ $t('admin:dashboard.subtitle') }}
|
2018-09-30 03:30:20 +00:00
|
|
|
v-flex(xs12 md6 lg4 xl3 d-flex)
|
2019-03-17 17:39:58 +00:00
|
|
|
v-card.primary.dashboard-card.animated.fadeInUp(dark)
|
2019-01-01 06:40:31 +00:00
|
|
|
v-card-text
|
2019-07-29 04:50:03 +00:00
|
|
|
v-icon.dashboard-icon mdi-file-document-outline
|
|
|
|
.overline {{$t('admin:dashboard.pages')}}
|
2019-01-01 06:40:31 +00:00
|
|
|
animated-number.display-1(
|
|
|
|
:value='info.pagesTotal'
|
|
|
|
:duration='2000'
|
|
|
|
:formatValue='round'
|
|
|
|
easing='easeOutQuint'
|
|
|
|
)
|
2018-09-30 03:30:20 +00:00
|
|
|
v-flex(xs12 md6 lg4 xl3 d-flex)
|
2019-12-19 04:45:19 +00:00
|
|
|
v-card.blue.darken-3.dashboard-card.animated.fadeInUp.wait-p2s(dark)
|
2019-01-01 06:40:31 +00:00
|
|
|
v-card-text
|
2019-07-29 04:50:03 +00:00
|
|
|
v-icon.dashboard-icon mdi-account
|
|
|
|
.overline {{$t('admin:dashboard.users')}}
|
2019-01-01 06:40:31 +00:00
|
|
|
animated-number.display-1(
|
|
|
|
:value='info.usersTotal'
|
|
|
|
:duration='2000'
|
|
|
|
:formatValue='round'
|
|
|
|
easing='easeOutQuint'
|
|
|
|
)
|
2018-09-30 03:30:20 +00:00
|
|
|
v-flex(xs12 md6 lg4 xl3 d-flex)
|
2019-12-19 04:45:19 +00:00
|
|
|
v-card.blue.darken-4.dashboard-card.animated.fadeInUp.wait-p4s(dark)
|
2019-01-01 06:40:31 +00:00
|
|
|
v-card-text
|
2019-07-29 04:50:03 +00:00
|
|
|
v-icon.dashboard-icon mdi-account-group
|
|
|
|
.overline {{$t('admin:dashboard.groups')}}
|
2019-01-01 06:40:31 +00:00
|
|
|
animated-number.display-1(
|
|
|
|
:value='info.groupsTotal'
|
|
|
|
:duration='2000'
|
|
|
|
:formatValue='round'
|
|
|
|
easing='easeOutQuint'
|
|
|
|
)
|
2018-09-30 03:30:20 +00:00
|
|
|
v-flex(xs12 md6 lg12 xl3 d-flex)
|
2019-03-17 17:39:58 +00:00
|
|
|
v-card.dashboard-card.animated.fadeInUp.wait-p6s(
|
2019-12-19 04:45:19 +00:00
|
|
|
:class='isLatestVersion ? "green" : "red lighten-2"'
|
2018-09-30 03:30:20 +00:00
|
|
|
dark
|
|
|
|
)
|
2019-08-10 16:18:14 +00:00
|
|
|
v-btn.btn-animate-wrench(fab, absolute, :right='!$vuetify.rtl', :left='$vuetify.rtl', top, small, light, to='system', v-if='hasPermission(`manage:system`)')
|
2019-12-19 04:45:19 +00:00
|
|
|
v-icon(:color='isLatestVersion ? `green` : `red darken-4`', small) mdi-wrench
|
2018-09-30 03:30:20 +00:00
|
|
|
v-card-text
|
2019-07-29 04:50:03 +00:00
|
|
|
v-icon.dashboard-icon mdi-blur
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 Wiki.js {{info.currentVersion}}
|
2019-06-10 03:39:37 +00:00
|
|
|
.body-2(v-if='isLatestVersion') {{$t('admin:dashboard.versionLatest')}}
|
|
|
|
.body-2(v-else) {{$t('admin:dashboard.versionNew', { version: info.latestVersion })}}
|
2019-07-20 04:16:29 +00:00
|
|
|
v-flex(xs12, xl6)
|
2019-07-21 02:44:41 +00:00
|
|
|
v-card.radius-7.animated.fadeInUp.wait-p2s
|
2019-08-31 19:00:31 +00:00
|
|
|
v-toolbar(:color='$vuetify.theme.dark ? `grey darken-2` : `grey lighten-5`', dense, flat)
|
|
|
|
v-spacer
|
2019-09-01 02:10:58 +00:00
|
|
|
.overline {{$t('admin:dashboard.recentPages')}}
|
2019-08-31 19:00:31 +00:00
|
|
|
v-spacer
|
2018-09-30 03:30:20 +00:00
|
|
|
v-data-table.pb-2(
|
|
|
|
:items='recentPages'
|
2019-08-31 19:00:31 +00:00
|
|
|
:headers='headers'
|
|
|
|
:loading='recentPagesLoading'
|
2019-07-29 04:50:03 +00:00
|
|
|
hide-default-footer
|
|
|
|
hide-default-header
|
2018-09-30 03:30:20 +00:00
|
|
|
)
|
2019-08-31 19:00:31 +00:00
|
|
|
template(slot='item', slot-scope='props')
|
|
|
|
tr.is-clickable(:active='props.selected', @click='$router.push(`/pages/` + props.item.id)')
|
|
|
|
td
|
|
|
|
.body-2: strong {{ props.item.title }}
|
|
|
|
td.admin-pages-path
|
|
|
|
v-chip(label, small, :color='$vuetify.theme.dark ? `grey darken-4` : `grey lighten-4`') {{ props.item.locale }}
|
|
|
|
span.ml-2.grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-2`') / {{ props.item.path }}
|
2019-09-01 02:10:58 +00:00
|
|
|
td.text-right.caption(width='250') {{ props.item.updatedAt | moment('calendar') }}
|
2019-07-20 04:16:29 +00:00
|
|
|
v-flex(xs12, xl6)
|
2019-07-21 02:44:41 +00:00
|
|
|
v-card.radius-7.animated.fadeInUp.wait-p4s
|
2019-08-31 19:00:31 +00:00
|
|
|
v-toolbar(:color='$vuetify.theme.dark ? `grey darken-2` : `grey lighten-5`', dense, flat)
|
|
|
|
v-spacer
|
2019-09-01 02:10:58 +00:00
|
|
|
.overline {{$t('admin:dashboard.mostPopularPages')}}
|
2019-08-31 19:00:31 +00:00
|
|
|
v-spacer
|
2018-09-30 03:30:20 +00:00
|
|
|
v-data-table.pb-2(
|
|
|
|
:items='popularPages'
|
2019-09-01 02:10:58 +00:00
|
|
|
:headers='headers'
|
|
|
|
:loading='popularPagesLoading'
|
2019-07-29 04:50:03 +00:00
|
|
|
hide-default-footer
|
|
|
|
hide-default-header
|
2018-09-30 03:30:20 +00:00
|
|
|
)
|
2019-09-01 02:10:58 +00:00
|
|
|
template(slot='item', slot-scope='props')
|
|
|
|
tr.is-clickable(:active='props.selected', @click='$router.push(`/pages/` + props.item.id)')
|
|
|
|
td
|
|
|
|
.body-2: strong {{ props.item.title }}
|
|
|
|
td.admin-pages-path
|
|
|
|
v-chip(label, small, :color='$vuetify.theme.dark ? `grey darken-4` : `grey lighten-4`') {{ props.item.locale }}
|
|
|
|
span.ml-2.grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-2`') / {{ props.item.path }}
|
|
|
|
td.text-right.caption(width='250') {{ props.item.updatedAt | moment('calendar') }}
|
2018-09-03 04:27:48 +00:00
|
|
|
|
2018-12-30 03:12:52 +00:00
|
|
|
v-flex(xs12)
|
2019-07-21 02:44:41 +00:00
|
|
|
v-card.dashboard-contribute.animated.fadeInUp.wait-p4s
|
2018-12-30 03:12:52 +00:00
|
|
|
v-card-text
|
|
|
|
img(src='/svg/icon-heart-health.svg', alt='Contribute', style='height: 80px;')
|
2019-07-29 04:50:03 +00:00
|
|
|
.pl-5
|
|
|
|
.subtitle-1 {{$t('admin:contribute.title')}}
|
|
|
|
.body-2.mt-3: strong {{$t('admin:dashboard.contributeSubtitle')}}
|
|
|
|
.body-2 {{$t('admin:dashboard.contributeHelp')}}
|
2019-08-10 16:18:14 +00:00
|
|
|
v-btn.mx-0.mt-4(:color='$vuetify.theme.dark ? `indigo lighten-3` : `indigo`', outlined, small, to='/contribute')
|
2019-07-29 04:50:03 +00:00
|
|
|
.caption: strong {{$t('admin:dashboard.contributeLearnMore')}}
|
2018-12-30 03:12:52 +00:00
|
|
|
|
2018-02-28 05:54:09 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-01-12 23:33:30 +00:00
|
|
|
import _ from 'lodash'
|
2018-09-03 04:27:48 +00:00
|
|
|
import AnimatedNumber from 'animated-number-vue'
|
2018-12-15 22:15:13 +00:00
|
|
|
import { get } from 'vuex-pathify'
|
2018-09-04 00:58:54 +00:00
|
|
|
|
2019-08-31 19:00:31 +00:00
|
|
|
import recentPagesQuery from 'gql/admin/dashboard/dashboard-query-recentpages.gql'
|
|
|
|
|
2018-02-28 05:54:09 +00:00
|
|
|
export default {
|
2018-09-03 04:27:48 +00:00
|
|
|
components: {
|
|
|
|
AnimatedNumber
|
|
|
|
},
|
2018-02-28 05:54:09 +00:00
|
|
|
data() {
|
2018-09-04 00:58:54 +00:00
|
|
|
return {
|
|
|
|
recentPages: [],
|
2019-08-31 19:00:31 +00:00
|
|
|
recentPagesLoading: false,
|
|
|
|
popularPages: [],
|
2019-09-01 02:10:58 +00:00
|
|
|
popularPagesLoading: false,
|
2019-08-31 19:00:31 +00:00
|
|
|
headers: [
|
|
|
|
{ text: 'ID', value: 'id', width: 80 },
|
|
|
|
{ text: 'Title', value: 'title' },
|
|
|
|
{ text: 'Path', value: 'path' },
|
|
|
|
{ text: 'Last Updated', value: 'updatedAt', width: 250 }
|
|
|
|
]
|
2018-09-04 00:58:54 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isLatestVersion() {
|
|
|
|
return this.info.currentVersion === this.info.latestVersion
|
2018-12-15 22:15:13 +00:00
|
|
|
},
|
2019-01-12 23:33:30 +00:00
|
|
|
info: get('admin/info'),
|
|
|
|
permissions: get('user/permissions')
|
2018-09-03 04:27:48 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2019-01-12 23:33:30 +00:00
|
|
|
round(val) { return Math.round(val) },
|
|
|
|
hasPermission(prm) {
|
|
|
|
if (_.isArray(prm)) {
|
|
|
|
return _.some(prm, p => {
|
|
|
|
return _.includes(this.permissions, p)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
return _.includes(this.permissions, prm)
|
|
|
|
}
|
|
|
|
}
|
2019-08-31 19:00:31 +00:00
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
recentPages: {
|
|
|
|
query: recentPagesQuery,
|
|
|
|
update: (data) => data.pages.list,
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.recentPagesLoading = isLoading
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-dashboard-recentpages')
|
|
|
|
}
|
|
|
|
}
|
2018-02-28 05:54:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
2018-09-04 00:58:54 +00:00
|
|
|
.dashboard-card {
|
|
|
|
display: flex;
|
2019-07-29 04:50:03 +00:00
|
|
|
width: 100%;
|
2018-12-30 03:12:52 +00:00
|
|
|
border-radius: 7px;
|
2018-09-04 00:58:54 +00:00
|
|
|
|
|
|
|
.v-card__text {
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-30 03:12:52 +00:00
|
|
|
.dashboard-contribute {
|
|
|
|
background-color: #FFF;
|
|
|
|
background-image: linear-gradient(to bottom, #FFF 0%, lighten(mc('indigo', '50'), 3%) 100%);
|
|
|
|
border-radius: 7px;
|
|
|
|
|
|
|
|
@at-root .theme--dark & {
|
|
|
|
background-color: mc('grey', '800');
|
|
|
|
background-image: linear-gradient(to bottom, mc('grey', '800') 0%, darken(mc('grey', '800'), 6%) 100%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.v-card__text {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-07-29 04:50:03 +00:00
|
|
|
color: mc('indigo', '500') !important;
|
2018-12-30 03:12:52 +00:00
|
|
|
|
|
|
|
@at-root .theme--dark & {
|
2019-07-29 04:50:03 +00:00
|
|
|
color: mc('grey', '300') !important;
|
2018-12-30 03:12:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-23 17:49:34 +00:00
|
|
|
.v-icon.dashboard-icon {
|
2018-09-03 04:27:48 +00:00
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
top: 12px;
|
2019-08-04 17:54:23 +00:00
|
|
|
font-size: 100px !important;
|
2018-09-03 04:27:48 +00:00
|
|
|
opacity: .25;
|
2019-08-11 04:12:07 +00:00
|
|
|
|
|
|
|
@at-root .v-application--is-rtl & {
|
|
|
|
left: 0;
|
|
|
|
right: initial;
|
|
|
|
}
|
2018-09-03 04:27:48 +00:00
|
|
|
}
|
|
|
|
|
2018-02-28 05:54:09 +00:00
|
|
|
</style>
|