mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 20:58:28 +00:00
Start for ticket 230 - Get Dashboard URL
This commit is contained in:
parent
620b9a5188
commit
09a395fa34
@ -17,6 +17,7 @@ API_TOKEN = environ.get('API_TOKEN', default = 'af95596f327c9ecc007b60414fc84b61
|
|||||||
NAME = "CR Connect Workflow"
|
NAME = "CR Connect Workflow"
|
||||||
DEFAULT_PORT = "5000"
|
DEFAULT_PORT = "5000"
|
||||||
FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default=DEFAULT_PORT)
|
FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default=DEFAULT_PORT)
|
||||||
|
FRONTEND = "localhost:4200"
|
||||||
CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002"))
|
CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002"))
|
||||||
TESTING = environ.get('TESTING', default="false") == "true"
|
TESTING = environ.get('TESTING', default="false") == "true"
|
||||||
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true")
|
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true")
|
||||||
|
16
crc/scripts/get_dashboard_url.py
Normal file
16
crc/scripts/get_dashboard_url.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from crc.scripts.script import Script
|
||||||
|
from crc import app
|
||||||
|
|
||||||
|
|
||||||
|
class GetDashboardURL(Script):
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
"""Get the URL for the main dashboard. This should be system instance aware.
|
||||||
|
I.e., dev, testing, production, etc."""
|
||||||
|
|
||||||
|
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
||||||
|
self.do_task(task, study_id, workflow_id, *args, **kwargs)
|
||||||
|
|
||||||
|
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
||||||
|
frontend = app.config['FRONTEND']
|
||||||
|
return f'http://{frontend}'
|
7
tests/test_get_dashboard_url_script.py
Normal file
7
tests/test_get_dashboard_url_script.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
from tests.base_test import BaseTest
|
||||||
|
|
||||||
|
|
||||||
|
class TestGetDashboardURL(BaseTest):
|
||||||
|
|
||||||
|
def test_get_dashboard_url(self):
|
||||||
|
pass
|
Loading…
x
Reference in New Issue
Block a user