wikijs-fork/client/components/admin.vue

169 lines
6.6 KiB
Vue
Raw Normal View History

2018-02-28 05:54:09 +00:00
<template lang='pug'>
2018-06-10 00:11:00 +00:00
v-app(:dark='darkMode').admin
nav-header
v-navigation-drawer.pb-0.admin-sidebar(v-model='adminDrawerShown', app, fixed, clipped, left, permanent)
2018-02-28 05:54:09 +00:00
v-list(dense)
v-list-tile.pt-2(to='/dashboard')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon dashboard
v-list-tile-title {{ $t('admin:dashboard.title') }}
2018-02-28 05:54:09 +00:00
v-divider.my-2
v-subheader.pl-4 {{ $t('admin:nav.site') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/general')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon widgets
v-list-tile-title {{ $t('admin:general.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/locale')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon language
v-list-tile-title {{ $t('admin:locale.title') }}
2018-09-23 04:14:01 +00:00
v-list-tile(to='/navigation')
v-list-tile-avatar: v-icon near_me
v-list-tile-title {{ $t('admin:navigation.title') }}
v-list-tile(to='/pages')
v-list-tile-avatar: v-icon insert_drive_file
v-list-tile-title {{ $t('admin:pages.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/theme')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon palette
v-list-tile-title {{ $t('admin:theme.title') }}
2018-02-28 05:54:09 +00:00
v-divider.my-2
v-subheader.pl-4 {{ $t('admin:nav.users') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/groups')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon people
v-list-tile-title {{ $t('admin:groups.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/users')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon perm_identity
v-list-tile-title {{ $t('admin:users.title') }}
2018-06-10 00:11:00 +00:00
v-list-tile-action
.justify-end
v-chip(small, disabled, color='grey lighten-4')
.caption.grey--text 1
2018-02-28 05:54:09 +00:00
v-divider.my-2
v-subheader.pl-4 {{ $t('admin:nav.modules') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/auth')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon lock_outline
v-list-tile-title {{ $t('admin:auth.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/editor')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon transform
v-list-tile-title {{ $t('admin:editor.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/logging')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon graphic_eq
v-list-tile-title {{ $t('admin:logging.title') }}
2018-06-11 03:23:09 +00:00
v-list-tile(to='/rendering')
v-list-tile-avatar: v-icon system_update_alt
v-list-tile-title {{ $t('admin:rendering.title') }}
v-list-tile(to='/search')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon search
v-list-tile-title {{ $t('admin:search.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/storage')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon storage
v-list-tile-title {{ $t('admin:storage.title') }}
2018-02-28 05:54:09 +00:00
v-divider.my-2
v-subheader.pl-4 {{ $t('admin:nav.system') }}
v-list-tile(to='/api')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon call_split
v-list-tile-title {{ $t('admin:api.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/system')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon tune
v-list-tile-title {{ $t('admin:system.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/utilities')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon build
v-list-tile-title {{ $t('admin:utilities.title') }}
2018-02-28 05:54:09 +00:00
v-list-tile(to='/dev')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon weekend
v-list-tile-title {{ $t('admin:dev.title') }}
2018-04-14 19:22:45 +00:00
v-divider.my-2
v-list-tile(to='/contribute')
2018-06-10 00:11:00 +00:00
v-list-tile-avatar: v-icon favorite
v-list-tile-title {{ $t('admin:contribute.title') }}
2018-02-28 05:54:09 +00:00
v-content(:class='darkMode ? "grey darken-4" : ""')
transition(name='admin-router')
router-view
2018-02-28 05:54:09 +00:00
nav-footer
2018-02-28 05:54:09 +00:00
</template>
<script>
import VueRouter from 'vue-router'
import { get } from 'vuex-pathify'
2018-06-10 00:11:00 +00:00
2018-02-28 05:54:09 +00:00
const router = new VueRouter({
mode: 'history',
base: '/a',
routes: [
{ path: '/', redirect: '/dashboard' },
2018-03-28 04:02:32 +00:00
{ path: '/dashboard', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-dashboard.vue') },
{ path: '/general', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-general.vue') },
{ path: '/locale', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-locale.vue') },
2018-09-23 04:14:01 +00:00
{ path: '/navigation', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-navigation.vue') },
{ path: '/pages', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-pages.vue') },
2018-03-28 04:02:32 +00:00
{ path: '/theme', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-theme.vue') },
{ path: '/groups', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-groups.vue') },
{ path: '/groups/:id', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-groups-edit.vue') },
{ path: '/users', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-users.vue') },
{ path: '/auth', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-auth.vue') },
{ path: '/rendering', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-rendering.vue') },
{ path: '/editor', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-editor.vue') },
{ path: '/logging', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-logging.vue') },
{ path: '/search', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-search.vue') },
{ path: '/storage', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-storage.vue') },
{ path: '/api', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-api.vue') },
{ path: '/system', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-system.vue') },
{ path: '/utilities', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-utilities.vue') },
2018-04-14 19:22:45 +00:00
{ path: '/dev', component: () => import(/* webpackChunkName: "admin-dev" */ './admin/admin-dev.vue') },
2018-06-10 00:11:00 +00:00
{ path: '/contribute', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-contribute.vue') }
2018-02-28 05:54:09 +00:00
]
})
export default {
i18nOptions: { namespaces: 'admin' },
2018-02-28 05:54:09 +00:00
data() {
return {
adminDrawerShown: true
}
},
computed: {
darkMode: get('site/dark')
},
2018-08-04 21:27:55 +00:00
router
2018-02-28 05:54:09 +00:00
}
</script>
<style lang='scss'>
.admin-router {
&-enter-active, &-leave-active {
transition: opacity .25s ease;
opacity: 1;
}
&-enter-active {
transition-delay: .25s;
}
&-enter, &-leave-to {
opacity: 0;
}
}
.admin-sidebar {
.v-list__tile--active {
background-color: rgba(mc('theme', 'primary'), .1);
.v-icon {
color: mc('theme', 'primary')
}
}
}
.theme--dark {
.admin-sidebar .v-list__tile--active {
background-color: rgba(0,0,0, .2);
}
}
.admin-header-icon {
position: absolute;
top: 1rem;
right: 1rem;
}
2018-02-28 05:54:09 +00:00
</style>