mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Use custom logo also in frontend
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
"OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o",
|
||||
"OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD",
|
||||
"OAUTH_REDIRECT_URI": "/login/logged",
|
||||
"OAUTH_POST_REDIRECT_URI": "/"
|
||||
"OAUTH_POST_REDIRECT_URI": "/",
|
||||
"MENU_LOGO_PATH": "src/assets/Modoboa_RVB-BLANC-SANS.png"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
>
|
||||
<div class="d-flex align-center">
|
||||
<v-img
|
||||
src="@/assets/Modoboa_RVB-BLANC-SANS.png"
|
||||
:src="globalConfig.MENU_LOGO_PATH"
|
||||
max-width="190"
|
||||
class="logo"
|
||||
@click="router.push(props.logoRoute)"
|
||||
@@ -93,6 +93,7 @@
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useGlobalConfig } from '@/main'
|
||||
import { useGlobalStore, useAuthStore, useLayoutStore } from '@/stores'
|
||||
import constants from '@/constants.json'
|
||||
|
||||
@@ -116,6 +117,7 @@ const globalStore = useGlobalStore()
|
||||
const authStore = useAuthStore()
|
||||
const layoutStore = useLayoutStore()
|
||||
const router = useRouter()
|
||||
const globalConfig = useGlobalConfig()
|
||||
|
||||
const rail = ref(false)
|
||||
const drawer = ref(true)
|
||||
|
||||
@@ -150,6 +150,10 @@ class Command(BaseCommand):
|
||||
os.path.dirname(__file__), "../../../frontend_dist/"
|
||||
)
|
||||
frontend_target_dir = f"{settings.BASE_DIR}/frontend"
|
||||
if settings.MODOBOA_CUSTOM_LOGO:
|
||||
logo_path = settings.MODOBOA_CUSTOM_LOGO
|
||||
else:
|
||||
logo_path = f"{frontend_target_dir}/assets/Modoboa_RVB-BLANC-SANS.png"
|
||||
if os.path.isdir(base_frontend_dir):
|
||||
shutil.rmtree(frontend_target_dir, ignore_errors=True)
|
||||
os.makedirs(frontend_target_dir, exist_ok=True)
|
||||
@@ -164,10 +168,12 @@ class Command(BaseCommand):
|
||||
fp.write(
|
||||
f"""{{
|
||||
"API_BASE_URL": "{base_uri}/api/v2",
|
||||
"API_DOC_URL": "{base_uri}/api/schema-v2/swagger/",
|
||||
"OAUTH_AUTHORITY_URL": "{base_uri}/api/o",
|
||||
"OAUTH_CLIENT_ID": "{client_id}",
|
||||
"OAUTH_REDIRECT_URI": "{redirect_uri}",
|
||||
"OAUTH_POST_REDIRECT_URI": "{base_uri}"
|
||||
"OAUTH_POST_REDIRECT_URI": "{base_uri}",
|
||||
"MENU_LOGO_PATH": {logo_path}
|
||||
}}
|
||||
"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user