-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare dashboard for env variables (#645)
Signed-off-by: lucferbux <[email protected]>
- Loading branch information
Showing
15 changed files
with
52 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
IS_PROJECT_ROOT_DIR=false | ||
PORT=${FRONTEND_PORT} | ||
|
||
########## Change the following three variables to customize the Dashboard ########## | ||
########## Change the following variables to customize the Dashboard ########## | ||
LOGO=logo-light-theme.svg | ||
LOGO_DARK=logo-dark-theme.svg | ||
FAVICON=favicon.ico | ||
PRODUCT_NAME=Model Registry | ||
PRODUCT_NAME="Model Registry" | ||
STYLE_THEME=mui-theme | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useContext } from 'react'; | ||
import { UserSettings } from '~/shared/types'; | ||
import { AppContext } from '~/app/AppContext'; | ||
|
||
const useUser = (): UserSettings => { | ||
const { user } = useContext(AppContext); | ||
return user; | ||
}; | ||
|
||
export default useUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const logout = (): Promise<unknown> => | ||
/* eslint-disable-next-line no-console */ | ||
fetch('/oauth/sign_out').catch((err) => console.error('Error logging out', err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
// TODO: [Env Handling] Fetch the .env variable here. | ||
const POLL_INTERVAL = 30000; | ||
|
||
export enum Theme { | ||
Default = 'default-theme', | ||
MUI = 'mui-theme', | ||
|
@@ -9,9 +6,12 @@ export enum Theme { | |
|
||
export const isMUITheme = (): boolean => STYLE_THEME === Theme.MUI; | ||
|
||
export const STYLE_THEME = process.env.STYLE_THEME || Theme.MUI; | ||
|
||
export const USER_ID = 'kubeflow-userid'; | ||
export const mockedUsername = '[email protected]'; | ||
const STYLE_THEME = process.env.STYLE_THEME || Theme.MUI; | ||
const DEV_MODE = process.env.APP_ENV === 'development'; | ||
const POLL_INTERVAL = process.env.POLL_INTERVAL ? parseInt(process.env.POLL_INTERVAL) : 30000; | ||
const AUTH_HEADER = process.env.AUTH_HEADER || 'kubeflow-userid'; | ||
const USERNAME = process.env.USERNAME || '[email protected]'; | ||
const IMAGE_DIR = process.env.IMAGE_DIR || 'images'; | ||
const LOGO_LIGHT = process.env.LOGO || 'logo-light-theme.svg'; | ||
|
||
export { POLL_INTERVAL }; | ||
export { POLL_INTERVAL, DEV_MODE, AUTH_HEADER, USERNAME, IMAGE_DIR, LOGO_LIGHT }; |