Skip to content

Commit 1d2d1c6

Browse files
committed
feat: admin dark mode
1 parent 5efbfc7 commit 1d2d1c6

20 files changed

+259
-217
lines changed

client/app.js

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Vue.component('login', () => import(/* webpackMode: "eager" */ './components/log
8080
Vue.component('nav-header', () => import(/* webpackMode: "eager" */ './components/nav-header.vue'))
8181
Vue.component('profile', () => import(/* webpackChunkName: "profile" */ './components/profile.vue'))
8282
Vue.component('setup', () => import(/* webpackChunkName: "setup" */ './components/setup.vue'))
83+
Vue.component('v-card-chin', () => import(/* webpackMode: "eager" */ './components/common/v-card-chin.vue'))
8384

8485
let bootstrap = () => {
8586
// ====================================

client/components/admin.vue

+35-22
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,81 @@
11
<template lang='pug'>
2-
v-app.admin
2+
v-app(:dark='darkMode').admin
33
nav-header
44
v-navigation-drawer.pb-0(v-model='adminDrawerShown', app, fixed, clipped, left, permanent)
55
v-list(dense)
66
v-list-tile.pt-2(to='/dashboard')
7-
v-list-tile-action: v-icon dashboard
7+
v-list-tile-avatar: v-icon dashboard
88
v-list-tile-title Dashboard
99
v-divider.my-2
1010
v-subheader Site
1111
v-list-tile(to='/general')
12-
v-list-tile-action: v-icon widgets
12+
v-list-tile-avatar: v-icon widgets
1313
v-list-tile-title General
1414
v-list-tile(to='/locale')
15-
v-list-tile-action: v-icon language
15+
v-list-tile-avatar: v-icon language
1616
v-list-tile-title Locale
1717
v-list-tile(to='/stats')
18-
v-list-tile-action: v-icon show_chart
18+
v-list-tile-avatar: v-icon show_chart
1919
v-list-tile-title Statistics
2020
v-list-tile(to='/theme')
21-
v-list-tile-action: v-icon palette
21+
v-list-tile-avatar: v-icon palette
2222
v-list-tile-title Theme
2323
v-divider.my-2
2424
v-subheader Users
2525
v-list-tile(to='/groups')
26-
v-list-tile-action: v-icon people
26+
v-list-tile-avatar: v-icon people
2727
v-list-tile-title Groups
2828
v-list-tile(to='/users')
29-
v-list-tile-action: v-icon perm_identity
29+
v-list-tile-avatar: v-icon perm_identity
3030
v-list-tile-title Users
31+
v-list-tile-action
32+
.justify-end
33+
v-chip(small, disabled, color='grey lighten-4')
34+
.caption.grey--text 1
3135
v-divider.my-2
3236
v-subheader Modules
3337
v-list-tile(to='/auth')
34-
v-list-tile-action: v-icon lock_outline
38+
v-list-tile-avatar: v-icon lock_outline
3539
v-list-tile-title Authentication
3640
v-list-tile(to='/rendering')
37-
v-list-tile-action: v-icon system_update_alt
41+
v-list-tile-avatar: v-icon system_update_alt
3842
v-list-tile-title Content Rendering
3943
v-list-tile(to='/editor')
40-
v-list-tile-action: v-icon transform
44+
v-list-tile-avatar: v-icon transform
4145
v-list-tile-title Editor
4246
v-list-tile(to='/logging')
43-
v-list-tile-action: v-icon graphic_eq
47+
v-list-tile-avatar: v-icon graphic_eq
4448
v-list-tile-title Logging
4549
v-list-tile(to='/search')
46-
v-list-tile-action: v-icon search
50+
v-list-tile-avatar: v-icon search
4751
v-list-tile-title Search Engine
4852
v-list-tile(to='/storage')
49-
v-list-tile-action: v-icon storage
53+
v-list-tile-avatar: v-icon storage
5054
v-list-tile-title Storage
5155
v-divider.my-2
5256
v-subheader System
5357
v-list-tile(to='/api')
54-
v-list-tile-action: v-icon call_split
58+
v-list-tile-avatar: v-icon call_split
5559
v-list-tile-title API Access
5660
v-list-tile(to='/system')
57-
v-list-tile-action: v-icon tune
61+
v-list-tile-avatar: v-icon tune
5862
v-list-tile-title System Info
5963
v-list-tile(to='/utilities')
60-
v-list-tile-action: v-icon build
64+
v-list-tile-avatar: v-icon build
6165
v-list-tile-title Utilities
6266
v-list-tile(to='/dev')
63-
v-list-tile-action: v-icon weekend
67+
v-list-tile-avatar: v-icon weekend
6468
v-list-tile-title Developer Tools
6569
v-divider.my-2
6670
v-list-tile(to='/contribute')
67-
v-list-tile-action: v-icon favorite
71+
v-list-tile-avatar: v-icon favorite
6872
v-list-tile-title Contribute to Wiki.js
6973

7074
v-content
7175
transition(name='admin-router')
7276
router-view
7377

74-
v-footer.py-2.justify-center(app, absolute, color='grey lighten-3', inset, height='auto')
78+
v-footer.py-2.justify-center(app, absolute, :color='darkMode ? "" : "grey lighten-3"', inset, height='auto')
7579
.caption.grey--text.text--darken-1 Powered by Wiki.js
7680

7781
v-snackbar(
@@ -90,6 +94,12 @@
9094
import VueRouter from 'vue-router'
9195
import { mapState } from 'vuex'
9296

97+
import adminStore from '@/store/admin'
98+
99+
/* global WIKI */
100+
101+
WIKI.$store.registerModule('admin', adminStore)
102+
93103
const router = new VueRouter({
94104
mode: 'history',
95105
base: '/a',
@@ -113,7 +123,7 @@ const router = new VueRouter({
113123
{ path: '/system', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-system.vue') },
114124
{ path: '/utilities', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-utilities.vue') },
115125
{ path: '/dev', component: () => import(/* webpackChunkName: "admin-dev" */ './admin/admin-dev.vue') },
116-
{ path: '/contribute', component: () => import(/* webpackChunkName: "admin-dev" */ './admin/admin-contribute.vue') }
126+
{ path: '/contribute', component: () => import(/* webpackChunkName: "admin" */ './admin/admin-contribute.vue') }
117127
]
118128
})
119129

@@ -124,7 +134,10 @@ export default {
124134
}
125135
},
126136
computed: {
127-
...mapState(['notification']),
137+
...mapState({
138+
notification: state => state.notification,
139+
darkMode: state => state.admin.theme.dark
140+
}),
128141
notificationState: {
129142
get() { return this.notification.isActive },
130143
set(newState) { this.$store.commit('updateNotificationState', newState) }

client/components/admin/admin-api.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template lang='pug'>
22
v-card(flat)
3-
v-card(flat, color='grey lighten-5').pa-3.pt-4
3+
v-card(flat, tile, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
44
.headline.blue--text.text--darken-2 API
55
.subheading.grey--text Manage keys to access the API
66
v-card

client/components/admin/admin-auth.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template lang='pug'>
2-
v-card(tile, color='grey lighten-5')
2+
v-card(tile, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"')
33
.pa-3.pt-4
44
.headline.primary--text Authentication
55
.subheading.grey--text Configure the authentication settings of your wiki
6-
v-tabs(color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
6+
v-tabs(:color='$vuetify.dark ? "primary" : "grey lighten-4"', fixed-tabs, :slider-color='$vuetify.dark ? "white" : "primary"', show-arrows)
77
v-tab(key='settings'): v-icon settings
88
v-tab(v-for='strategy in activeStrategies', :key='strategy.key') {{ strategy.title }}
99

@@ -41,8 +41,7 @@
4141
v-text-field.ml-3(label='Limit to specific email domains', prepend-icon='mail_outline')
4242
v-text-field.ml-3(label='Assign to group', prepend-icon='people')
4343

44-
v-divider.my-0
45-
v-card-actions.grey.lighten-4
44+
v-card-chin
4645
v-btn(color='primary')
4746
v-icon(left) chevron_right
4847
span Save

client/components/admin/admin-contribute.vue

+26-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
<template lang='pug'>
22
v-card(flat)
3-
v-card(color='grey lighten-5')
4-
.pa-3.pt-4
5-
.headline.primary--text Contribute
6-
.subheading.grey--text Help support Wiki.js development and operations
7-
8-
v-card.pa-3
9-
.body-1.pl-3 Wiki.js is a #[strong free and open-source software] brought to you with #[v-icon(color='red') favorite] by #[a(href='https://requarks.io', target='_blank') requarks.io] and #[a(href='https://github.com/Requarks/wiki/graphs/contributors', target='_blank') contributors].
10-
.body-1.pt-3.pl-3 We need your help to keep improving the software and run the various associated services (e.g. hosting and networking).
11-
v-divider
12-
v-subheader Fund our work
13-
.body-1.pl-3 Wiki.js is part of the Open Collective initiative. You can contribute financially by making a monthly or one-time donation:
14-
v-card-actions.mt-3.ml-2
15-
v-btn(depressed, color='primary', href='https://opencollective.com/wikijs')
16-
v-icon(left) local_atm
17-
| Make a donation
18-
v-divider
19-
v-subheader Contribute
20-
.body-1.pl-3
21-
ul
22-
li Submit an idea or vote on a proposed one on the #[a(href='https://requests.requarks.io/wiki', target='_blank') feature requests board].
23-
li Found a bug? Submit an issue on #[a(href='https://github.com/Requarks/wiki/issues', target='_blank') Github].
24-
li Help translate Wiki.js in your language. Let us know on #[a(href='https://gitter.im/Requarks/wiki', target='_blank') Gitter].
25-
v-divider
26-
v-subheader Spread the word
27-
.body-1.pl-3
28-
ul
29-
li Talk to your friends and colleagues about how awesome Wiki.js is!
30-
li Follow us on #[a(href='https://twitter.com/requarks', target='_blank') Twitter].
3+
v-card(flat, tile, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
4+
.headline.primary--text Contribute
5+
.subheading.grey--text Help support Wiki.js development and operations
6+
v-card.pa-3
7+
.body-1.pl-3 Wiki.js is a #[strong free and open-source software] brought to you with #[v-icon(color='red') favorite] by #[a(href='https://requarks.io', target='_blank') requarks.io] and #[a(href='https://github.com/Requarks/wiki/graphs/contributors', target='_blank') contributors].
8+
.body-1.pt-3.pl-3 We need your help to keep improving the software and run the various associated services (e.g. hosting and networking).
9+
v-divider
10+
v-subheader Fund our work
11+
.body-1.pl-3 Wiki.js is part of the Open Collective initiative. You can contribute financially by making a monthly or one-time donation:
12+
v-card-actions.mt-3.ml-2
13+
v-btn(depressed, color='primary', href='https://opencollective.com/wikijs')
14+
v-icon(left) local_atm
15+
| Make a donation
16+
v-divider
17+
v-subheader Contribute
18+
.body-1.pl-3
19+
ul
20+
li Submit an idea or vote on a proposed one on the #[a(href='https://requests.requarks.io/wiki', target='_blank') feature requests board].
21+
li Found a bug? Submit an issue on #[a(href='https://github.com/Requarks/wiki/issues', target='_blank') Github].
22+
li Help translate Wiki.js in your language. Let us know on #[a(href='https://gitter.im/Requarks/wiki', target='_blank') Gitter].
23+
v-divider
24+
v-subheader Spread the word
25+
.body-1.pl-3
26+
ul
27+
li Talk to your friends and colleagues about how awesome Wiki.js is!
28+
li Follow us on #[a(href='https://twitter.com/requarks', target='_blank') Twitter].
3129

3230
</template>
3331

client/components/admin/admin-dev.vue

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
<template lang='pug'>
2-
v-card(flat)
3-
v-card(color='grey lighten-5')
4-
.pa-3.pt-4
5-
.headline.primary--text Developer Tools
6-
.subheading.grey--text ¯\_(ツ)_/¯
7-
v-tabs(v-model='selectedTab', color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows, @input='tabChanged')
8-
v-tab(key='0') Graph API Playground
9-
v-tab(key='1') Graph API Map
10-
v-tabs-items(v-model='selectedTab')
11-
v-tab-item(key='0', :transition='false', :reverse-transition='false')
12-
#graphiql
2+
div
3+
v-card(flat, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
4+
.headline.primary--text Developer Tools
5+
.subheading.grey--text ¯\_(ツ)_/¯
6+
v-tabs(
7+
v-model='selectedTab'
8+
:color='$vuetify.dark ? "primary" : "grey lighten-4"'
9+
fixed-tabs
10+
:slider-color='$vuetify.dark ? "white" : "primary"'
11+
show-arrows
12+
@input='tabChanged'
13+
)
14+
v-tab(key='0') Graph API Playground
15+
v-tab(key='1') Graph API Map
16+
v-tabs-items(v-model='selectedTab')
17+
v-tab-item(key='0', :transition='false', :reverse-transition='false')
18+
#graphiql
1319

14-
v-tab-item(key='1', :transition='false', :reverse-transition='false')
15-
#voyager
20+
v-tab-item(key='1', :transition='false', :reverse-transition='false')
21+
#voyager
1622

1723
</template>
1824

client/components/admin/admin-editor.vue

+22-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
<template lang='pug'>
22
v-card(flat)
3-
v-card(color='grey lighten-5')
4-
.pa-3.pt-4
5-
.headline.primary--text Editor
6-
.subheading.grey--text Configure the content editor
7-
v-tabs(color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
8-
v-tab(key='settings'): v-icon settings
9-
v-tab(key='code') Markdown
3+
v-card(flat, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
4+
.headline.primary--text Editor
5+
.subheading.grey--text Configure the content editor
6+
v-tabs(:color='$vuetify.dark ? "primary" : "grey lighten-4"', fixed-tabs, :slider-color='$vuetify.dark ? "white" : "primary"', show-arrows)
7+
v-tab(key='settings'): v-icon settings
8+
v-tab(key='code') Markdown
109

11-
v-tab-item(key='settings', :transition='false', :reverse-transition='false')
12-
v-card.pa-3
13-
v-form
14-
v-radio-group(v-model='selectedEditor')
15-
v-radio(v-for='(editor, n) in editors', :key='n', :label='editor.text', :value='editor.value', color='primary')
16-
v-divider
17-
v-btn(color='primary')
18-
v-icon(left) chevron_right
19-
| Set Editor
20-
v-btn(icon)
21-
v-icon.grey--text refresh
22-
v-tab-item(key='code', :transition='false', :reverse-transition='false')
23-
v-card.pa-3
24-
v-form
25-
v-subheader Editor Configuration
26-
.body-1 This editor has no configuration options you can modify.
10+
v-tab-item(key='settings', :transition='false', :reverse-transition='false')
11+
v-card.pa-3
12+
v-form
13+
v-radio-group(v-model='selectedEditor')
14+
v-radio(v-for='(editor, n) in editors', :key='n', :label='editor.text', :value='editor.value', color='primary')
15+
v-divider
16+
v-btn(color='primary')
17+
v-icon(left) chevron_right
18+
| Set Editor
19+
v-btn(icon)
20+
v-icon.grey--text refresh
21+
v-tab-item(key='code', :transition='false', :reverse-transition='false')
22+
v-card.pa-3
23+
v-form
24+
v-subheader Editor Configuration
25+
.body-1 This editor has no configuration options you can modify.
2726

2827
</template>
2928

client/components/admin/admin-general.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
v-text-field(label='Site Description', :counter='255', prepend-icon='public')
2222
v-text-field(label='Site Keywords', :counter='255', prepend-icon='public')
2323
v-select(label='Meta Robots', chips, tags, :items='metaRobots', v-model='metaRobotsSelection', prepend-icon='public')
24-
v-divider.my-0
25-
v-card-actions.grey.lighten-4
24+
v-card-chin
2625
v-spacer
2726
v-btn(color='primary')
2827
v-icon(left) chevron_right

client/components/admin/admin-groups-edit.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template lang='pug'>
22
v-card
3-
v-card(flat, color='grey lighten-5').pa-3.pt-4
3+
v-card(flat, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
44
.headline.blue--text.text--darken-2 Edit Group
55
.subheading.grey--text {{name}}
66
v-btn(color='primary', fab, absolute, bottom, right, small, to='/groups'): v-icon arrow_upward
7-
v-tabs(v-model='tab', color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
7+
v-tabs(v-model='tab', :color='$vuetify.dark ? "primary" : "grey lighten-4"', fixed-tabs, :slider-color='$vuetify.dark ? "white" : "primary"', show-arrows)
88
v-tab(key='properties') Properties
99
v-tab(key='rights') Permissions
1010
v-tab(key='users') Users

client/components/admin/admin-groups.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template lang='pug'>
22
v-card(flat)
3-
v-card(flat, color='grey lighten-5').pa-3.pt-4
3+
v-card(flat, tile, :color='$vuetify.dark ? "grey darken-4" : "grey lighten-5"').pa-3.pt-4
44
.headline.blue--text.text--darken-2 Groups
55
.subheading.grey--text Manage groups and their permissions
66
v-card

client/components/admin/admin-locale.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
persistent-hint
4040
:hint='namespacing ? "Automatically download updates to all namespaced locales enabled below." : "Automatically download updates to this locale as they become available."'
4141
)
42-
v-divider.my-0
43-
v-card-actions.grey.lighten-4
42+
v-card-chin
4443
v-spacer
4544
v-btn(color='primary', :loading='loading', @click='save')
4645
v-icon(left) chevron_right
@@ -92,8 +91,7 @@
9291
v-list-tile-sub-title(v-html='data.item.nativeName')
9392
v-list-tile-action
9493
v-checkbox(:input-value='data.tile.props.value', color='primary', value)
95-
v-divider.my-0
96-
v-card-actions.grey.lighten-4
94+
v-card-chin
9795
v-spacer
9896
v-btn(color='primary', :loading='loading', @click='save')
9997
v-icon(left) chevron_right

0 commit comments

Comments
 (0)