Skip to content

Commit 7645718

Browse files
committed
Fix the websocket IP is not accessible from external network so in webUI use document.location.hostname
the embedded page won't be updated as it is supposed to be used locally
1 parent 66ea092 commit 7645718

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

dist/grbl/debug/index.html.gz

9 Bytes
Binary file not shown.

dist/grbl/languages/fr.json.gz

0 Bytes
Binary file not shown.

dist/grbl/languages/zh_cn.json.gz

0 Bytes
Binary file not shown.

dist/grbl/production/index.html.gz

8 Bytes
Binary file not shown.

dist/printer/debug/index.html.gz

10 Bytes
Binary file not shown.

dist/printer/languages/fr.json.gz

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.

src/components/settings/webui.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ function loadConfigSuccess(responseText) {
439439
if (data.WebSocketIP && data.WebCommunication && data.WebSocketport) {
440440
setupWebSocket(
441441
data.WebCommunication,
442-
data.WebSocketIP,
442+
document.location.hostname,
443443
data.WebSocketport
444444
)
445445
}
@@ -464,7 +464,7 @@ function loadConfigError(errorCode, responseText) {
464464
function loadImportFile() {
465465
let importFile = document.getElementById("importPControl").files
466466
let reader = new FileReader()
467-
reader.onload = function(e) {
467+
reader.onload = function (e) {
468468
var contents = e.target.result
469469
console.log(contents)
470470
try {
@@ -683,7 +683,7 @@ function exportSettings() {
683683
a.download = filename
684684
document.body.appendChild(a)
685685
a.click()
686-
setTimeout(function() {
686+
setTimeout(function () {
687687
document.body.removeChild(a)
688688
window.URL.revokeObjectURL(url)
689689
}, 0)
@@ -908,7 +908,7 @@ function updateState(entry, index = null, target = "macro") {
908908
* Check box control
909909
*/
910910
const CheckboxControl = ({ entry, title, label }) => {
911-
const toggleCheckbox = e => {
911+
const toggleCheckbox = (e) => {
912912
prefs[entry] = e.target.checked
913913
showDialog({ displayDialog: false, refreshPage: true })
914914
}
@@ -934,7 +934,7 @@ const CheckboxControl = ({ entry, title, label }) => {
934934
*/
935935
const LanguageSelection = () => {
936936
let optionList = []
937-
const onChange = e => {
937+
const onChange = (e) => {
938938
prefs.language = e.target.value
939939
loadLanguage(prefs.language)
940940
}
@@ -1070,7 +1070,7 @@ function addPanel() {
10701070
* Icon Macro for selection
10711071
*/
10721072
const IconUIEntry = ({ index, name, target }) => {
1073-
const selectControlIcon = e => {
1073+
const selectControlIcon = (e) => {
10741074
if (target == "panel") {
10751075
prefs.extrapanels[index].icon = name
10761076
} else {
@@ -1089,16 +1089,16 @@ const IconUIEntry = ({ index, name, target }) => {
10891089
* MacroUISelectTarget
10901090
*/
10911091
const MacroUISelectTarget = ({ index, id, label }) => {
1092-
const onChange = e => {
1092+
const onChange = (e) => {
10931093
macros[index][id] = e.target.value
10941094
updateState(id, index)
10951095
}
1096-
const onFocus = e => {
1096+
const onFocus = (e) => {
10971097
document
10981098
.getElementById(id + "_" + index + "-UI-label")
10991099
.classList.remove("d-none")
11001100
}
1101-
const onFocusOut = e => {
1101+
const onFocusOut = (e) => {
11021102
document
11031103
.getElementById(id + "_" + index + "-UI-label")
11041104
.classList.add("d-none")
@@ -1178,7 +1178,7 @@ const MacroUISelectTarget = ({ index, id, label }) => {
11781178
* PanelUISelectControl
11791179
*/
11801180
const PanelUISelectControl = ({ index, id, label, options }) => {
1181-
const onChange = e => {
1181+
const onChange = (e) => {
11821182
prefs.extrapanels[index][id] = e.target.value
11831183
if (id == "type" && e.target.value == "camera") {
11841184
if (!prefs.extrapanels[index]["source"].startsWith("/snap")) {
@@ -1190,12 +1190,12 @@ const PanelUISelectControl = ({ index, id, label, options }) => {
11901190
}
11911191
updateState(id, index, "panel")
11921192
}
1193-
const onFocus = e => {
1193+
const onFocus = (e) => {
11941194
document
11951195
.getElementById("panel_" + id + "_" + index + "-UI-label")
11961196
.classList.remove("d-none")
11971197
}
1198-
const onFocusOut = e => {
1198+
const onFocusOut = (e) => {
11991199
document
12001200
.getElementById("panel_" + id + "_" + index + "-UI-label")
12011201
.classList.add("d-none")
@@ -1240,21 +1240,21 @@ const PanelUISelectControl = ({ index, id, label, options }) => {
12401240
* MacroUIEntry
12411241
*/
12421242
const MacroUIEntry = ({ index, id, label }) => {
1243-
const onInput = e => {
1243+
const onInput = (e) => {
12441244
macros[index][id] = e.target.value
12451245
updateState(id, index)
12461246
}
1247-
const onFocus = e => {
1247+
const onFocus = (e) => {
12481248
document
12491249
.getElementById(id + "_" + index + "-UI-label")
12501250
.classList.remove("d-none")
12511251
}
1252-
const onFocusOut = e => {
1252+
const onFocusOut = (e) => {
12531253
document
12541254
.getElementById(id + "_" + index + "-UI-label")
12551255
.classList.add("d-none")
12561256
}
1257-
const showListIcons = e => {
1257+
const showListIcons = (e) => {
12581258
let list = []
12591259
let message = []
12601260
let allkey = Object.keys(iconsList)
@@ -1361,21 +1361,21 @@ const MacroUIEntry = ({ index, id, label }) => {
13611361
* PanelUIEntry
13621362
*/
13631363
const PanelUIEntry = ({ index, id, label }) => {
1364-
const onInput = e => {
1364+
const onInput = (e) => {
13651365
prefs.extrapanels[index][id] = e.target.value
13661366
updateState(id, index, "panel")
13671367
}
1368-
const onFocus = e => {
1368+
const onFocus = (e) => {
13691369
document
13701370
.getElementById("panel_" + id + "_" + index + "-UI-label")
13711371
.classList.remove("d-none")
13721372
}
1373-
const onFocusOut = e => {
1373+
const onFocusOut = (e) => {
13741374
document
13751375
.getElementById("panel_" + id + "_" + index + "-UI-label")
13761376
.classList.add("d-none")
13771377
}
1378-
const showListIcons = e => {
1378+
const showListIcons = (e) => {
13791379
let list = []
13801380
let message = []
13811381
let allkey = Object.keys(iconsList)
@@ -1496,7 +1496,7 @@ const PanelUIEntry = ({ index, id, label }) => {
14961496
*/
14971497
const ControlListLine = ({ data, index, target }) => {
14981498
let border_bottom = ""
1499-
const deleteControlLine = e => {
1499+
const deleteControlLine = (e) => {
15001500
let newlinetmp = []
15011501
let listsize
15021502
if (target == "panel") {
@@ -1520,7 +1520,7 @@ const ControlListLine = ({ data, index, target }) => {
15201520
}
15211521
showDialog({ displayDialog: false, refreshPage: true })
15221522
}
1523-
const upControlLine = e => {
1523+
const upControlLine = (e) => {
15241524
let newlinetmp = []
15251525
let listsize
15261526
if (target == "panel") {
@@ -1552,7 +1552,7 @@ const ControlListLine = ({ data, index, target }) => {
15521552
}
15531553
showDialog({ displayDialog: false, refreshPage: true })
15541554
}
1555-
const downControlLine = e => {
1555+
const downControlLine = (e) => {
15561556
let newlinetmp = []
15571557
let listsize
15581558
if (target == "panel") {

src/components/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
*/
2020
import { h } from "preact"
2121

22-
export const Esp3dVersion = () => <span>3.0.0.85</span>
22+
export const Esp3dVersion = () => <span>3.0.0.86</span>

0 commit comments

Comments
 (0)