Skip to content

Commit 8545444

Browse files
committed
Use dynamic URL for tdb if no tdb server provided
Previously the local dashboard builds were hard-compiled to use localhost:6363. This creates the problem that if the user chooses a different port, the dashboard will stop working as it still tries to connect to localhost:6363 instead. Therefore I use the window.url.origin to determine where the dashboard is served if the ENV variable is not provided.
1 parent 33f7eef commit 8545444

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

.github/workflows/main_workflow.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ jobs:
8484
cd packages/tdb-dashboard
8585
echo '
8686
CONNECTION_TYPE="LOCAL"
87-
TERMINUSDB_SERVER=http://127.0.0.1:6363/
8887
TERMINUSDB_KEY=root
8988
FEEDBACK_URL="https://cloud.terminusdb.com/"
9089
BASE_URL="dashboard"

packages/tdb-dashboard/localSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const server = localStorage.getItem("terminusdb-server-override") || process.env.TERMINUSDB_SERVER
1+
const server = localStorage.getItem("terminusdb-server-override") || process.env.TERMINUSDB_SERVER || window.location.origin
22

33
//there is no default key
44
//let key= localStorage.getItem("terminusdb-key-override") || process.env.TERMINUSDB_KEY

0 commit comments

Comments
 (0)