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: []