-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Vuetify Themes #898
Use Vuetify Themes #898
Conversation
Added Secret Background SVG Component
# Conflicts: # frontend/src/utils/index.js # frontend/src/views/Members.vue
Make all infrastructure icons colorizable svg components
Added switch to enable dark mode dark mode support for snotify
# Conflicts: # frontend/src/components/ShootListRow.vue # frontend/src/views/ShootList.vue Changed hard coded color values to theme colors
<v-icon class="mr-3">mdi-account-circle</v-icon> | ||
My Account | ||
</v-btn> | ||
</v-card-actions> | ||
<v-divider></v-divider> | ||
<v-card-actions class="px-3"> | ||
<v-icon color="primary" class="ml-2 mr-3">mdi-brightness-6</v-icon> | ||
<v-switch v-model="darkModeValue" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<v-switch v-model="darkModeValue" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch> | |
<v-switch v-model="darkMode" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch> |
'setError', | ||
'setDarkMode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'setError', | |
'setDarkMode' | |
'setError' |
'cfg', | ||
'darkMode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'cfg', | |
'darkMode' | |
'cfg' |
darkModeValue: { | ||
get () { | ||
return this.darkMode | ||
}, | ||
set (value) { | ||
this.setDarkMode(value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darkModeValue: { | |
get () { | |
return this.darkMode | |
}, | |
set (value) { | |
this.setDarkMode(value) | |
} | |
darkMode: { | |
get () { | |
return this.$store.state.darkMode | |
}, | |
set (value) { | |
this.$store.commit('SET_DARK_MODE', value) | |
} |
@@ -122,7 +127,8 @@ const state = { | |||
shortName: 'SC', | |||
description: 'Indicates whether all system components in the kube-system namespace are up and running. Gardener manages these system components and should automatically take care that the components become healthy again.' | |||
} | |||
} | |||
}, | |||
darkMode: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darkMode: false | |
darkMode: (Vuetify.framework.theme.dark = localStorage.getItem('global/dark-mode') === 'true') |
frontend/src/store/index.js
Outdated
}, | ||
setDarkMode ({ commit }, darkMode) { | ||
commit('SET_DARK_MODE', darkMode) | ||
return state.darkMode | ||
}, | ||
initStore ({ commit }) { | ||
const darkMode = localStorage.getItem('global/dark-mode') || false | ||
commit('SET_DARK_MODE', darkMode) | ||
return state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | |
setDarkMode ({ commit }, darkMode) { | |
commit('SET_DARK_MODE', darkMode) | |
return state.darkMode | |
}, | |
initStore ({ commit }) { | |
const darkMode = localStorage.getItem('global/dark-mode') || false | |
commit('SET_DARK_MODE', darkMode) | |
return state |
frontend/src/app.js
Outdated
@@ -20,22 +20,23 @@ const App = Vue.extend({ | |||
this.$bus.$emit('esc-pressed') | |||
} | |||
}) | |||
|
|||
const darkMode = Vue.localStorage.getItem('global/dark-mode') === 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const darkMode = Vue.localStorage.getItem('global/dark-mode') === 'true' | |
const darkMode = this.$localStorage.getItem('global/dark-mode') === 'true' |
frontend/src/store/index.js
Outdated
}, | ||
getDarkMode (state) { | ||
return state.darkMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | |
getDarkMode (state) { | |
return state.darkMode |
get () { | ||
return this.darkMode | ||
return this.getDarkMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.getDarkMode | |
return this.$store.state.darkMode |
]), | ||
...mapGetters([ | ||
'username', | ||
'displayName', | ||
'avatarUrl', | ||
'isAdmin' | ||
'isAdmin', | ||
'getDarkMode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'getDarkMode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Dark mode looks awesome!!!!! Can't wait to enable it! |
Is this synced automatically based on the system settings on MacOS? :) |
Currently not. Maybe we can think about something like this when we introduce user settings. |
Yeah, thanks @grolu, would be great! |
What this PR does / why we need it:
This PR is a big step to make the dashboard customizable. By using vuetify themes it is possible to centrally configure the colors used by the dashboard. This also allows us to introduce dark mode.
Which issue(s) this PR fixes:
Fixes #873 Fixes #714
Special notes for your reviewer:
Release note: