Skip to content

Commit

Permalink
Fixed base path references for assets due to running application behi…
Browse files Browse the repository at this point in the history
…nd proxy servers.
  • Loading branch information
anilnatha committed Jul 29, 2024
1 parent 21dff01 commit 996f45c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GENERAL
VITE_UNITY_UI_VERSION=${npm_package_version}
VITE_ADMIN_EMAIL=ENV_UNITY_UI_ADMIN_EMAIL
VITE_UNITY_UI_BASE_URL=ENV_UNITY_UI_BASE_URL

# Auth
VITE_AUTH_OAUTH_CLIENT_ID=ENV_UNITY_UI_AUTH_OAUTH_CLIENT_ID
Expand Down
1 change: 1 addition & 0 deletions .env/.env.docker.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# GENERAL
ENV_UNITY_UI_ADMIN_EMAIL=REPLACE_WITH_ADMIN_EMAIL
ENV_UNITY_UI_BASE_URL=REPLACE_WITH_BASE_URL

# Auth
ENV_UNITY_UI_AUTH_OAUTH_CLIENT_ID=REPLACE_WITH_COGNITO_USER_POOL_CLIENT_ID
Expand Down
1 change: 1 addition & 0 deletions src/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Config = {

['general']: {
version: import.meta.env.VITE_UNITY_UI_VERSION,
base_path: import.meta.env.VITE_UNITY_UI_BASE_URL
},

['getGlobalConfig']: {
Expand Down
5 changes: 3 additions & 2 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function Navbar() {
const loggedInUsername = GetUsername();
const userInitials = loggedInUsername.substring(0,1).toUpperCase();
const uiVersion = Config['general']['version'];
const basePath = Config['general']['base_path'];

const healthState = useAppSelector((state) => {
return state.health;
Expand Down Expand Up @@ -64,7 +65,7 @@ export default function Navbar() {
<NavbarBreakpoint min={1100}>
<NavbarBrand
link="/"
logo={<img src={UnityLogo} alt="Unity Logo" style={{ height: '24px', width: '24px' }}/>}
logo={<img src={basePath + UnityLogo} alt="Unity Logo" style={{ height: '24px', width: '24px' }}/>}
title="Unity"
version={uiVersion}
/>
Expand Down Expand Up @@ -136,7 +137,7 @@ export default function Navbar() {
>
<NavbarBrand
link="/"
logo={<img src={UnityLogo} alt="Unity Logo" style={{ height: '24px', width: '24px' }}/>}
logo={<img src={basePath + UnityLogo} alt="Unity Logo" style={{ height: '24px', width: '24px' }}/>}
title="Unity"
version={uiVersion}
/>
Expand Down

0 comments on commit 996f45c

Please sign in to comment.