Skip to content

Commit

Permalink
fix: adds support for public base path (#1207)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Oct 10, 2023
1 parent 07e1f7c commit 7f0886d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="fluidd" />
<link rel="apple-touch-icon" sizes="180x180" href="/img/icons/apple-touch-icon-180x180.png" />
<link rel="mask-icon" href="img/icons/safari-pinned-tab.svg" color="#000000" />
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#000000" />
<meta name="msapplication-TileImage" content="/img/icons/mstile-150x150.png" />
<meta name="msapplication-TileColor" content="#000000" />

Expand Down
24 changes: 12 additions & 12 deletions public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"color": "#2196F3",
"isDark": true,
"logo": {
"src": "/logo_fluidd.svg",
"src": "logo_fluidd.svg",
"dynamic": true
}
},
Expand All @@ -21,7 +21,7 @@
"color": "#96CC4A",
"isDark": true,
"logo": {
"src": "/logo_annex.svg",
"src": "logo_annex.svg",
"dynamic": true
}
},
Expand All @@ -30,7 +30,7 @@
"color": "#475A91",
"isDark": true,
"logo": {
"src": "/logo_btt.svg",
"src": "logo_btt.svg",
"dynamic": true
}
},
Expand All @@ -39,7 +39,7 @@
"color": "#76FB00",
"isDark": true,
"logo": {
"src": "/logo_eva.svg",
"src": "logo_eva.svg",
"dark": "#232323",
"light": "#ffffff",
"dynamic": false
Expand All @@ -50,7 +50,7 @@
"color": "#dfff3e",
"isDark": true,
"logo": {
"src": "/logo_hevort.svg",
"src": "logo_hevort.svg",
"dynamic": true
}
},
Expand All @@ -59,7 +59,7 @@
"color": "#DA7A2C",
"isDark": true,
"logo": {
"src": "/logo_kingroon.svg",
"src": "logo_kingroon.svg",
"dynamic": false
}
},
Expand All @@ -68,7 +68,7 @@
"color": "#B12F36",
"isDark": true,
"logo": {
"src": "/logo_klipper.svg",
"src": "logo_klipper.svg",
"dynamic": false
}
},
Expand All @@ -77,7 +77,7 @@
"color": "#76FB00",
"isDark": true,
"logo": {
"src": "/logo_ratrig.svg",
"src": "logo_ratrig.svg",
"dark": "#232323",
"light": "#ffffff",
"dynamic": false
Expand All @@ -88,7 +88,7 @@
"color": "#FF2300",
"isDark": true,
"logo": {
"src": "/logo_voron.svg",
"src": "logo_voron.svg",
"dynamic": true
}
},
Expand All @@ -97,7 +97,7 @@
"color": "#FF2300",
"isDark": true,
"logo": {
"src": "/logo_vzbot.svg",
"src": "logo_vzbot.svg",
"dynamic": false
}
},
Expand All @@ -106,7 +106,7 @@
"color": "#e34234",
"isDark": true,
"logo": {
"src": "/logo_zerog.svg",
"src": "logo_zerog.svg",
"dynamic": true
}
},
Expand All @@ -115,7 +115,7 @@
"color": "#4bc3ca",
"isDark": true,
"logo": {
"src": "/logo_snakeoil.svg",
"src": "logo_snakeoil.svg",
"dynamic": false
}
}
Expand Down
22 changes: 11 additions & 11 deletions server/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"color": "#2196F3",
"isDark": true,
"logo": {
"src": "/logo_fluidd.svg",
"src": "logo_fluidd.svg",
"dynamic": true
}
},
Expand All @@ -21,7 +21,7 @@
"color": "#96CC4A",
"isDark": true,
"logo": {
"src": "/logo_annex.svg",
"src": "logo_annex.svg",
"dynamic": true
}
},
Expand All @@ -30,7 +30,7 @@
"color": "#475A91",
"isDark": true,
"logo": {
"src": "/logo_btt.svg",
"src": "logo_btt.svg",
"dynamic": true
}
},
Expand All @@ -39,7 +39,7 @@
"color": "#76FB00",
"isDark": true,
"logo": {
"src": "/logo_eva.svg",
"src": "logo_eva.svg",
"dark": "#232323",
"light": "#ffffff",
"dynamic": false
Expand All @@ -50,7 +50,7 @@
"color": "#dfff3e",
"isDark": true,
"logo": {
"src": "/logo_hevort.svg",
"src": "logo_hevort.svg",
"dynamic": true
}
},
Expand All @@ -59,7 +59,7 @@
"color": "#DA7A2C",
"isDark": true,
"logo": {
"src": "/logo_kingroon.svg",
"src": "logo_kingroon.svg",
"dynamic": false
}
},
Expand All @@ -68,7 +68,7 @@
"color": "#B12F36",
"isDark": true,
"logo": {
"src": "/logo_klipper.svg",
"src": "logo_klipper.svg",
"dynamic": false
}
},
Expand All @@ -77,7 +77,7 @@
"color": "#76FB00",
"isDark": true,
"logo": {
"src": "/logo_ratrig.svg",
"src": "logo_ratrig.svg",
"dark": "#232323",
"light": "#ffffff",
"dynamic": false
Expand All @@ -88,7 +88,7 @@
"color": "#FF2300",
"isDark": true,
"logo": {
"src": "/logo_voron.svg",
"src": "logo_voron.svg",
"dynamic": true
}
},
Expand All @@ -97,7 +97,7 @@
"color": "#FF2300",
"isDark": true,
"logo": {
"src": "/logo_vzbot.svg",
"src": "logo_vzbot.svg",
"dynamic": false
}
},
Expand All @@ -106,7 +106,7 @@
"color": "#e34234",
"isDark": true,
"logo": {
"src": "/logo_zerog.svg",
"src": "logo_zerog.svg",
"dynamic": true
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/ui/AppIcon.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="logo-wrapper">
<inline-svg
:src="theme.logo.src"
:src="logoSrc"
@loaded="handleLogoLoad"
/>
</div>
Expand All @@ -22,6 +22,10 @@ export default class AppIcon extends Vue {
return this.$store.getters['config/getTheme']
}
get logoSrc () {
return `${import.meta.env.BASE_URL}${this.theme.logo.src}`
}
handleLogoLoad () {
this.setData()
}
Expand Down
2 changes: 1 addition & 1 deletion src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import webSocketWrapper from '@/util/web-socket-wrapper'
*/

const getHostConfig = async () => {
const hostConfigResponse = await httpClientActions.get<HostConfig>(`/config.json?date=${Date.now()}`)
const hostConfigResponse = await httpClientActions.get<HostConfig>(`${import.meta.env.BASE_URL}config.json?date=${Date.now()}`)
if (hostConfigResponse && hostConfigResponse.data) {
consola.debug('Loaded web host configuration', hostConfigResponse.data)
return hostConfigResponse.data
Expand Down
2 changes: 1 addition & 1 deletion src/store/config/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const getters: GetterTree<ConfigState, RootState> = {
return {
name: 'Fluidd',
logo: {
src: '/logo_fluidd.svg',
src: 'logo_fluidd.svg',
changeWithTheme: true
},
color: '#2196F3'
Expand Down
2 changes: 1 addition & 1 deletion src/store/config/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const defaultState = (): ConfigState => {
theme: {
isDark: true,
logo: {
src: '/logo_fluidd.svg',
src: 'logo_fluidd.svg',
dynamic: true
},
currentTheme: {
Expand Down

0 comments on commit 7f0886d

Please sign in to comment.