@@ -35,8 +35,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
3535 />
3636 </div >
3737
38- <div class =" flex justify-content-center" >
39- <img src =" @/assets/mm-logo.svg" />
38+ <div class =" logo flex justify-content-center" >
39+ <img
40+ class =" logo-image"
41+ :src =" logoUrl"
42+ @error =" onCustomLogoError"
43+ alt =" Not Found"
44+ />
4045 </div >
4146
4247 <div
@@ -79,16 +84,32 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
7984</template >
8085
8186<script setup lang="ts">
82- import { computed } from ' vue'
87+ import { ref , computed } from ' vue'
8388import { useRoute } from ' vue-router'
8489
8590import { SideBarItemModel } from ' ../types'
8691
92+ import defaultLogoUrl from ' @/assets/mm-logo.svg'
8793import { DashboardRouteName , useUserStore } from ' @/main'
94+ import { useInstanceStore } from ' @/modules/instance/store'
8895import SideBarItem from ' @/modules/layout/components/SideBarItem.vue'
8996import { useLayoutStore } from ' @/modules/layout/store'
9097import { ProjectRouteName } from ' @/modules/project'
9198
99+ const customLogoLoadFailed = ref (false )
100+ function onCustomLogoError(): void {
101+ customLogoLoadFailed .value = true
102+ }
103+ const instanceStore = useInstanceStore ()
104+ const brandingLogoUrl = computed (
105+ () => instanceStore .configData ?.[' dashboard_logo_url' ] as string
106+ )
107+ const logoUrl = computed (() =>
108+ brandingLogoUrl .value && ! customLogoLoadFailed .value
109+ ? brandingLogoUrl .value
110+ : defaultLogoUrl
111+ )
112+
92113const route = useRoute ()
93114const layoutStore = useLayoutStore ()
94115const userStore = useUserStore ()
@@ -142,6 +163,18 @@ const onCloseClick = () => {
142163 );
143164 }
144165}
166+ .logo {
167+ max-width : 100% ;
168+
169+ & -image {
170+ display : block ;
171+ width : auto ;
172+ height : 24px ;
173+ max-width : 129px ;
174+ max-height : 24px ;
175+ object-fit : contain ;
176+ }
177+ }
145178
146179@media screen and (max-width : $xl ) {
147180 .sidebar {
0 commit comments