From 6da293b49465d18a4bc70a79045bb071d45a465d Mon Sep 17 00:00:00 2001 From: meteyou Date: Wed, 18 Nov 2020 21:21:43 +0100 Subject: [PATCH] feature: debug .env.development.local.example for moonraker connection Signed-off-by: meteyou --- .env.development.local.example | 8 ++++++++ .gitignore | 1 + public/config.json | 8 ++------ src/store/socket/index.js | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 .env.development.local.example diff --git a/.env.development.local.example b/.env.development.local.example new file mode 100644 index 00000000..5db5cc66 --- /dev/null +++ b/.env.development.local.example @@ -0,0 +1,8 @@ +# hostname or ip from the moonraker instance +VUE_APP_HOSTNAME=printer.local + +# port from the moonraker instance +VUE_APP_PORT=7125 + +# reconnect interval in ms +VUE_APP_RECONNECT_INTERVAL=5000 \ No newline at end of file diff --git a/.gitignore b/.gitignore index e32d92f4..58d00568 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ temp .versions .changelog package-lock.json +*.local \ No newline at end of file diff --git a/public/config.json b/public/config.json index b6b4dc18..0db3279e 100644 --- a/public/config.json +++ b/public/config.json @@ -1,7 +1,3 @@ { - "socket": { - "hostname": "voron250.local", - "port": 80, - "metadataRequestDelay": 2000 - } -} \ No newline at end of file + +} diff --git a/src/store/socket/index.js b/src/store/socket/index.js index 7eb64984..09ca0b87 100644 --- a/src/store/socket/index.js +++ b/src/store/socket/index.js @@ -4,9 +4,9 @@ import getters from './getters' const getDefaultState = () => { return { - hostname: window.location.hostname, - port: window.location.port, - reconnectInterval: 5000, + hostname: process.env.VUE_APP_HOSTNAME || window.location.hostname, + port: process.env.VUE_APP_PORT || window.location.port, + reconnectInterval: process.env.VUE_APP_RECONNECT_INTERVAL || 5000, isConnected: false, loadings: []