mirror of
https://github.com/luc-github/ESP3D-WEBUI.git
synced 2025-10-31 11:56:46 -07:00
Fix random crash when updating monitor and monitor is not visible
due to continuous data coming from printer Apply astyle Add sanity check in dialog
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1 +1,7 @@
|
||||
node_modules
|
||||
dist/images/jogdial.svg
|
||||
dist/images/jogdial1.svg
|
||||
dist/images/jogdial2.svg
|
||||
dist/images/printer.tpl.htm
|
||||
dist/images/repetier.htm
|
||||
dist/index.html
|
||||
|
||||
BIN
dist/grbl/index.html.gz
vendored
BIN
dist/grbl/index.html.gz
vendored
Binary file not shown.
BIN
dist/printer/index.html.gz
vendored
BIN
dist/printer/index.html.gz
vendored
Binary file not shown.
16
package-lock.json
generated
16
package-lock.json
generated
@@ -11032,7 +11032,8 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@@ -11329,7 +11330,8 @@
|
||||
"npm-normalize-package-bin": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"npm-packlist": {
|
||||
"version": "1.4.8",
|
||||
@@ -11448,7 +11450,8 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@@ -11504,6 +11507,7 @@
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@@ -11547,12 +11551,14 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ import { SendCommand } from "../http"
|
||||
import { useStoreon } from "storeon/preact"
|
||||
const { isVerboseData } = require(`../${process.env.TARGET_ENV}`)
|
||||
import { showDialog } from "../dialog"
|
||||
import { preferences } from "../app"
|
||||
import { Page, preferences } from "../app"
|
||||
|
||||
/*
|
||||
* Local variables
|
||||
@@ -98,7 +98,10 @@ function updateContentType() {
|
||||
const { dispatch } = useStoreon()
|
||||
if (verboseOutput) currentOutput = monitorDataVerbose
|
||||
else currentOutput = monitorDataQuiet
|
||||
dispatch("monitor/set", currentOutput)
|
||||
const { showTerminal } = useStoreon("showTerminal")
|
||||
const { activePage } = useStoreon("activePage")
|
||||
if (showTerminal && activePage == Page.dashboard)
|
||||
dispatch("monitor/set", currentOutput)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -104,6 +104,7 @@ function hideDialog() {
|
||||
const DialogPage = () => {
|
||||
const { showDialog } = useStoreon("showDialog")
|
||||
const { dialogData } = useStoreon("dialogData")
|
||||
if (!dialogData) return
|
||||
//console.log(dialogData)
|
||||
if (!showDialog) {
|
||||
disableNode(document.getElementById("mainwindow"), false)
|
||||
|
||||
@@ -219,20 +219,26 @@ function processCommands() {
|
||||
pausePing(true)
|
||||
currentHttpCommand = new XMLHttpRequest()
|
||||
let isdownload = false
|
||||
if (typeof httpCommandList[0].id !="undefined"){
|
||||
if (httpCommandList[0].id=="download")isdownload=true
|
||||
if (typeof httpCommandList[0].id != "undefined") {
|
||||
if (httpCommandList[0].id == "download") isdownload = true
|
||||
}
|
||||
if (isdownload) currentHttpCommand.responseType="blob"
|
||||
if (isdownload) currentHttpCommand.responseType = "blob"
|
||||
currentHttpCommand.onreadystatechange = function() {
|
||||
if (currentHttpCommand.readyState == 4) {
|
||||
if (currentHttpCommand.status == 200) {
|
||||
defaultHttpResultFn(isdownload?currentHttpCommand.response:currentHttpCommand.responseText)
|
||||
defaultHttpResultFn(
|
||||
isdownload
|
||||
? currentHttpCommand.response
|
||||
: currentHttpCommand.responseText
|
||||
)
|
||||
} else {
|
||||
if (currentHttpCommand.status == 401)
|
||||
requestAuthentication()
|
||||
defaultHttpErrorFn(
|
||||
currentHttpCommand.status,
|
||||
isdownload?currentHttpCommand.response:currentHttpCommand.responseText
|
||||
isdownload
|
||||
? currentHttpCommand.response
|
||||
: currentHttpCommand.responseText
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -802,7 +802,13 @@ const FilesControls = () => {
|
||||
<span class="hide-low text-button">{T("S50")}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class={(fileSystemLoaded[currentFilesType] && canUpload()) ? "p-1" : "d-none"}>
|
||||
<div
|
||||
class={
|
||||
fileSystemLoaded[currentFilesType] && canUpload()
|
||||
? "p-1"
|
||||
: "d-none"
|
||||
}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
title={T("S89")}
|
||||
@@ -829,7 +835,12 @@ const FilesControls = () => {
|
||||
<button
|
||||
type="button"
|
||||
title={T("S90")}
|
||||
class={(fileSystemLoaded[currentFilesType] && canCreateDirectory()) ? "btn btn-info" : "d-none"}
|
||||
class={
|
||||
fileSystemLoaded[currentFilesType] &&
|
||||
canCreateDirectory()
|
||||
? "btn btn-info"
|
||||
: "d-none"
|
||||
}
|
||||
onClick={clickCreateDirectory}
|
||||
>
|
||||
<FolderPlus />
|
||||
@@ -863,8 +874,10 @@ const FilesPanel = () => {
|
||||
if (!showFiles) return null
|
||||
const { filesStatus } = useStoreon("filesStatus")
|
||||
const { filesList } = useStoreon("filesList")
|
||||
if (typeof fileSystemLoaded[currentFilesType] == "undefined")fileSystemLoaded[currentFilesType] = false
|
||||
if (fileSystemLoaded[currentFilesType] == false && prefs.autoload) refreshFilesList()
|
||||
if (typeof fileSystemLoaded[currentFilesType] == "undefined")
|
||||
fileSystemLoaded[currentFilesType] = false
|
||||
if (fileSystemLoaded[currentFilesType] == false && prefs.autoload)
|
||||
refreshFilesList()
|
||||
return (
|
||||
<div class="w-100 panelCard">
|
||||
<div class="p-2 ">
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
*/
|
||||
import { h } from "preact"
|
||||
|
||||
export const Esp3dVersion = () => <span>3.0.0.27</span>
|
||||
export const Esp3dVersion = () => <span>3.0.0.28</span>
|
||||
|
||||
Reference in New Issue
Block a user