add a setting to config.json that allows users to set theme (#5584)

This commit is contained in:
Hoang Nguyen 2022-01-17 13:00:56 +07:00 committed by GitHub
parent 59a615cf21
commit a42ed1fb89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -57,5 +57,6 @@
"plugins": [], "plugins": [],
"basicZoneEnabled": true, "basicZoneEnabled": true,
"multipleServer": false, "multipleServer": false,
"allowSettingTheme": true,
"docHelpMappings": {} "docHelpMappings": {}
} }

View File

@ -65,7 +65,7 @@
</a-drawer> </a-drawer>
</template> </template>
<template v-if="isDevelopmentMode"> <template v-if="isDevelopmentMode || allowSettingTheme">
<drawer :visible="showSetting" placement="right"> <drawer :visible="showSetting" placement="right">
<div slot="handler"> <div slot="handler">
<a-button type="primary" size="large"> <a-button type="primary" size="large">
@ -146,6 +146,9 @@ export default {
isDevelopmentMode () { isDevelopmentMode () {
return process.env.NODE_ENV === 'development' return process.env.NODE_ENV === 'development'
}, },
allowSettingTheme () {
return this.$config.allowSettingTheme
},
contentPaddingLeft () { contentPaddingLeft () {
if (!this.fixSidebar || this.isMobile()) { if (!this.fixSidebar || this.isMobile()) {
return '0' return '0'