Skip to content

Commit

Permalink
Merge pull request #182 from gyorilab/vue-config
Browse files Browse the repository at this point in the history
Make Vue url configurable
  • Loading branch information
kkaris authored Sep 30, 2024
2 parents cfa831d + 893e25e commit f21a554
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/indra_cogex/apps/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,23 @@
LOCAL_VUE: Union[str, bool] = get_config("LOCAL_VUE") or False

# Set up indralab-vue Vue components, either from local build or from S3
VUE_DEPLOYMENT = get_config("VUE_DEPLOYMENT") or "latest"
VUE_BASE = f"https://bigmech.s3.amazonaws.com/indra-db/indralabvue-{VUE_DEPLOYMENT}/"
VUE_URL_ROOT = (get_config("VUE_URL_ROOT") or "").rstrip("/")
VUE_JS = "IndralabVue.umd.min.js"
VUE_CSS = "IndralabVue.css"
if LOCAL_VUE:
VUE_SRC_JS: Union[bool, str] = False
VUE_SRC_CSS: Union[bool, str] = False
else:
VUE_SRC_JS = f"{VUE_BASE}{VUE_JS}"
VUE_SRC_CSS = f"{VUE_BASE}{VUE_CSS}"
if not VUE_URL_ROOT:
logger.warning(
"VUE_URL_ROOT not set in environment. Statement Vue components will "
"not be available in the web app."
)
VUE_SRC_JS = False
VUE_SRC_CSS = False
else:
VUE_SRC_JS = f"{VUE_URL_ROOT}/{VUE_JS}"
VUE_SRC_CSS = f"{VUE_URL_ROOT}/{VUE_CSS}"

# Pusher parameters
pusher_app_id = get_config("CLARE_PUSHER_APP_ID")
Expand Down

0 comments on commit f21a554

Please sign in to comment.