Commit da4ece94 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Georgios D. Tsoukalas
Browse files

cyclades ui: Handle non empty base urls better

BASE_PATH is not slash prefixed causing js to make requests to relative urls.
parent 15354b87
......@@ -44,10 +44,14 @@ ASTAKOS_VIEWS_URL = join_urls(cyclades.ASTAKOS_BASE_URL,
ASTAKOS_ACCOUNTS_URL = join_urls(cyclades.ASTAKOS_BASE_URL,
cyclades.ASTAKOS_ACCOUNTS_PREFIX)
if cyclades.PROXY_USER_SERVICES:
ASTAKOS_ACCOUNTS_URL = join_urls(cyclades.BASE_ASTAKOS_PROXY_PATH,
ASTAKOS_ACCOUNTS_URL = join_urls('/', cyclades.BASE_ASTAKOS_PROXY_PATH,
cyclades.ASTAKOS_ACCOUNTS_PREFIX)
BASE_PATH = cyclades.BASE_PATH
if not BASE_PATH.startswith("/"):
BASE_PATH = "/" + BASE_PATH
ACCOUNTS_URL = getattr(settings, 'CYCLADES_UI_ACCOUNTS_URL',
join_urls(ASTAKOS_ACCOUNTS_URL))
USER_CATALOG_URL = getattr(settings, 'CYCLADES_UI_USER_CATALOG_URL',
......@@ -55,13 +59,12 @@ USER_CATALOG_URL = getattr(settings, 'CYCLADES_UI_USER_CATALOG_URL',
FEEDBACK_URL = getattr(settings, 'CYCLADES_UI_FEEDBACK_URL',
join_urls(ACCOUNTS_URL, 'feedback'))
COMPUTE_URL = getattr(settings, 'CYCLADES_UI_COMPUTE_URL',
join_urls(cyclades.BASE_PATH,
cyclades.COMPUTE_PREFIX,
join_urls(BASE_PATH, cyclades.COMPUTE_PREFIX,
'v1.1'))
GLANCE_URL = getattr(settings, 'CYCLADES_UI_GLANCE_URL',
join_urls(cyclades.BASE_PATH, cyclades.PLANKTON_PREFIX))
join_urls(BASE_PATH, cyclades.PLANKTON_PREFIX))
USERDATA_URL = getattr(settings, 'CYCLADES_UI_USERDATA_URL',
join_urls(cyclades.BASE_PATH, cyclades.USERDATA_PREFIX))
join_urls(BASE_PATH, cyclades.USERDATA_PREFIX))
LOGIN_URL = getattr(settings, 'CYCLADES_UI_LOGIN_URL',
join_urls(cyclades.ASTAKOS_BASE_URL,
cyclades.ASTAKOS_VIEWS_PREFIX, 'login'))
......
......@@ -608,7 +608,6 @@
'ERROR': ['image-error']
};
// TODO: make it dynamic
synnefo.config.api_urls = {
'userdata': '{% url ui_userdata %}',
'compute': {{ compute_api_url|safe }},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment