Skip to content

Commit

Permalink
Fix the websocket IP is not accessible from external network so in we…
Browse files Browse the repository at this point in the history
…bUI use document.location.hostname

the embedded page won't be updated as it is supposed to be used locally
  • Loading branch information
luc-github committed Aug 26, 2021
1 parent 66ea092 commit 7645718
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
Binary file modified dist/grbl/debug/index.html.gz
Binary file not shown.
Binary file modified dist/grbl/languages/fr.json.gz
Binary file not shown.
Binary file modified dist/grbl/languages/zh_cn.json.gz
Binary file not shown.
Binary file modified dist/grbl/production/index.html.gz
Binary file not shown.
Binary file modified dist/printer/debug/index.html.gz
Binary file not shown.
Binary file modified dist/printer/languages/fr.json.gz
Binary file not shown.
Binary file modified dist/printer/languages/zh_cn.json.gz
Binary file not shown.
Binary file modified dist/printer/production/index.html.gz
Binary file not shown.
46 changes: 23 additions & 23 deletions src/components/settings/webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ function loadConfigSuccess(responseText) {
if (data.WebSocketIP && data.WebCommunication && data.WebSocketport) {
setupWebSocket(
data.WebCommunication,
data.WebSocketIP,
document.location.hostname,
data.WebSocketport
)
}
Expand All @@ -464,7 +464,7 @@ function loadConfigError(errorCode, responseText) {
function loadImportFile() {
let importFile = document.getElementById("importPControl").files
let reader = new FileReader()
reader.onload = function(e) {
reader.onload = function (e) {
var contents = e.target.result
console.log(contents)
try {
Expand Down Expand Up @@ -683,7 +683,7 @@ function exportSettings() {
a.download = filename
document.body.appendChild(a)
a.click()
setTimeout(function() {
setTimeout(function () {
document.body.removeChild(a)
window.URL.revokeObjectURL(url)
}, 0)
Expand Down Expand Up @@ -908,7 +908,7 @@ function updateState(entry, index = null, target = "macro") {
* Check box control
*/
const CheckboxControl = ({ entry, title, label }) => {
const toggleCheckbox = e => {
const toggleCheckbox = (e) => {
prefs[entry] = e.target.checked
showDialog({ displayDialog: false, refreshPage: true })
}
Expand All @@ -934,7 +934,7 @@ const CheckboxControl = ({ entry, title, label }) => {
*/
const LanguageSelection = () => {
let optionList = []
const onChange = e => {
const onChange = (e) => {
prefs.language = e.target.value
loadLanguage(prefs.language)
}
Expand Down Expand Up @@ -1070,7 +1070,7 @@ function addPanel() {
* Icon Macro for selection
*/
const IconUIEntry = ({ index, name, target }) => {
const selectControlIcon = e => {
const selectControlIcon = (e) => {
if (target == "panel") {
prefs.extrapanels[index].icon = name
} else {
Expand All @@ -1089,16 +1089,16 @@ const IconUIEntry = ({ index, name, target }) => {
* MacroUISelectTarget
*/
const MacroUISelectTarget = ({ index, id, label }) => {
const onChange = e => {
const onChange = (e) => {
macros[index][id] = e.target.value
updateState(id, index)
}
const onFocus = e => {
const onFocus = (e) => {
document
.getElementById(id + "_" + index + "-UI-label")
.classList.remove("d-none")
}
const onFocusOut = e => {
const onFocusOut = (e) => {
document
.getElementById(id + "_" + index + "-UI-label")
.classList.add("d-none")
Expand Down Expand Up @@ -1178,7 +1178,7 @@ const MacroUISelectTarget = ({ index, id, label }) => {
* PanelUISelectControl
*/
const PanelUISelectControl = ({ index, id, label, options }) => {
const onChange = e => {
const onChange = (e) => {
prefs.extrapanels[index][id] = e.target.value
if (id == "type" && e.target.value == "camera") {
if (!prefs.extrapanels[index]["source"].startsWith("/snap")) {
Expand All @@ -1190,12 +1190,12 @@ const PanelUISelectControl = ({ index, id, label, options }) => {
}
updateState(id, index, "panel")
}
const onFocus = e => {
const onFocus = (e) => {
document
.getElementById("panel_" + id + "_" + index + "-UI-label")
.classList.remove("d-none")
}
const onFocusOut = e => {
const onFocusOut = (e) => {
document
.getElementById("panel_" + id + "_" + index + "-UI-label")
.classList.add("d-none")
Expand Down Expand Up @@ -1240,21 +1240,21 @@ const PanelUISelectControl = ({ index, id, label, options }) => {
* MacroUIEntry
*/
const MacroUIEntry = ({ index, id, label }) => {
const onInput = e => {
const onInput = (e) => {
macros[index][id] = e.target.value
updateState(id, index)
}
const onFocus = e => {
const onFocus = (e) => {
document
.getElementById(id + "_" + index + "-UI-label")
.classList.remove("d-none")
}
const onFocusOut = e => {
const onFocusOut = (e) => {
document
.getElementById(id + "_" + index + "-UI-label")
.classList.add("d-none")
}
const showListIcons = e => {
const showListIcons = (e) => {
let list = []
let message = []
let allkey = Object.keys(iconsList)
Expand Down Expand Up @@ -1361,21 +1361,21 @@ const MacroUIEntry = ({ index, id, label }) => {
* PanelUIEntry
*/
const PanelUIEntry = ({ index, id, label }) => {
const onInput = e => {
const onInput = (e) => {
prefs.extrapanels[index][id] = e.target.value
updateState(id, index, "panel")
}
const onFocus = e => {
const onFocus = (e) => {
document
.getElementById("panel_" + id + "_" + index + "-UI-label")
.classList.remove("d-none")
}
const onFocusOut = e => {
const onFocusOut = (e) => {
document
.getElementById("panel_" + id + "_" + index + "-UI-label")
.classList.add("d-none")
}
const showListIcons = e => {
const showListIcons = (e) => {
let list = []
let message = []
let allkey = Object.keys(iconsList)
Expand Down Expand Up @@ -1496,7 +1496,7 @@ const PanelUIEntry = ({ index, id, label }) => {
*/
const ControlListLine = ({ data, index, target }) => {
let border_bottom = ""
const deleteControlLine = e => {
const deleteControlLine = (e) => {
let newlinetmp = []
let listsize
if (target == "panel") {
Expand All @@ -1520,7 +1520,7 @@ const ControlListLine = ({ data, index, target }) => {
}
showDialog({ displayDialog: false, refreshPage: true })
}
const upControlLine = e => {
const upControlLine = (e) => {
let newlinetmp = []
let listsize
if (target == "panel") {
Expand Down Expand Up @@ -1552,7 +1552,7 @@ const ControlListLine = ({ data, index, target }) => {
}
showDialog({ displayDialog: false, refreshPage: true })
}
const downControlLine = e => {
const downControlLine = (e) => {
let newlinetmp = []
let listsize
if (target == "panel") {
Expand Down
2 changes: 1 addition & 1 deletion src/components/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
*/
import { h } from "preact"

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

0 comments on commit 7645718

Please sign in to comment.