mirror of
https://github.com/luc-github/ESP3D-WEBUI.git
synced 2026-02-20 01:11:21 +01:00
Fix click2go not displaying toast when saving settings due to typo
rename repository of clicktogo as click2go as the extension name remove click2go console.log now is finalized bump click2go version to 1.0.1 and build package Remove auto toast messages in extensions API because it is extensions to handle toast on failure / success Bump webui version and build packages
This commit is contained in:
BIN
dist/CNC/GRBL/index.html.gz
vendored
BIN
dist/CNC/GRBL/index.html.gz
vendored
Binary file not shown.
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
Binary file not shown.
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
Binary file not shown.
BIN
dist/SandTable/GRBL/index.html.gz
vendored
BIN
dist/SandTable/GRBL/index.html.gz
vendored
Binary file not shown.
BIN
extensions/click2go/dist/click2go.html.gz
vendored
Normal file
BIN
extensions/click2go/dist/click2go.html.gz
vendored
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
<script type="text/javascript">
|
||||
const click2go_version = "1.0.0";
|
||||
const click2go_version = "1.0.1";
|
||||
let margin = 40; // Définir la taille de la marge
|
||||
let xPos = 0;
|
||||
let yPos = 0;
|
||||
@@ -216,7 +216,6 @@
|
||||
|
||||
//Save settings
|
||||
function onSave(settings) {
|
||||
console.log("Settings saved:", settings);
|
||||
currentSettings.gotoxmin = parseFloat(settings.gotoxmin);
|
||||
currentSettings.gotoxmax = parseFloat(settings.gotoxmax);
|
||||
currentSettings.gotoymin = parseFloat(settings.gotoymin);
|
||||
@@ -230,7 +229,6 @@
|
||||
drawCanvas();
|
||||
//Todo: Save settings to preferences.json
|
||||
save_settings_msg.content = currentSettings;
|
||||
console.log("Save settings:", save_settings_msg);
|
||||
sendMessage(save_settings_msg);
|
||||
}
|
||||
|
||||
@@ -246,12 +244,10 @@
|
||||
|
||||
//Command function
|
||||
function commandFn() {
|
||||
console.log("Last click position:", lastClickPosition);
|
||||
let command = currentSettings.gotocommand
|
||||
.replace("{X}", lastClickPosition.x.toFixed(currentSettings.gotoprecision))
|
||||
.replace("{Y}", lastClickPosition.y.toFixed(currentSettings.gotoprecision))
|
||||
.replace("{F}", currentSettings.gotofeedrate);
|
||||
console.log("Command:", command);
|
||||
command_msg.args.cmd = command;
|
||||
|
||||
sendMessage(command_msg);
|
||||
@@ -264,7 +260,6 @@
|
||||
|
||||
//Process message from WebUI
|
||||
function processMessage(eventMsg) {
|
||||
console.log("Got:", eventMsg.data);
|
||||
//Check if icons are loaded
|
||||
if (!iconsLoaded) {
|
||||
if (eventMsg.data.type && eventMsg.data.id && iconsToLoad.includes(eventMsg.data.id)) {
|
||||
@@ -282,7 +277,6 @@
|
||||
//Check if message is a response to a modal for settings
|
||||
if (eventMsg.data.type === "capabilities" && eventMsg.data.id === "extensions") {
|
||||
if (eventMsg.data.content.initiator.name === "click2go") {
|
||||
console.log("Got:", eventMsg.data);
|
||||
applySettings(eventMsg.data.content.response)
|
||||
}
|
||||
|
||||
@@ -291,13 +285,11 @@
|
||||
eventMsg.data.type &&
|
||||
(!eventMsg.data.id || eventMsg.data.id.startsWith("click2go"))) {
|
||||
if (eventMsg.data.type === "modal" && eventMsg.data.id === "click2go_settings") {
|
||||
console.log("Got:", eventMsg.data);
|
||||
if (eventMsg.data.content.response === "update") {
|
||||
onSave(eventMsg.data.content.inputData)
|
||||
}
|
||||
} else // Check if message is a response to a extensionsData for saving settings
|
||||
if (eventMsg.data.type === "extensionsData" && eventMsg.data.id === "click2go") {
|
||||
console.log("Got:", eventMsg.data);
|
||||
processSavingSettings(eventMsg.data.content.response)
|
||||
}
|
||||
}
|
||||
@@ -306,11 +298,12 @@
|
||||
}
|
||||
|
||||
function processSavingSettings(response) {
|
||||
if (response === "success") {
|
||||
//Displaying result
|
||||
if (response.status == "success") {
|
||||
toast_msg.content.text = "Settings saved successfully";
|
||||
toast_msg.content.type = "success";
|
||||
sendMessage(toast_msg);
|
||||
} else if (response === "error") {
|
||||
} else if (response.status == "error") {
|
||||
toast_msg.content.text = "Error saving settings";
|
||||
toast_msg.content.type = "error";
|
||||
sendMessage(toast_msg);
|
||||
@@ -329,10 +322,8 @@
|
||||
}
|
||||
|
||||
function applySettings(settings) {
|
||||
console.log("Settings loaded:", settings);
|
||||
settingsLoaded = true;
|
||||
if (settings != null && (Object.keys(settings).length > 2)){
|
||||
console.log("Apply Settings:", settings, Object.keys(settings).length);
|
||||
if (!isNaN(parseFloat(settings.gotoxmin)))currentSettings.gotoxmin = parseFloat(settings.gotoxmin);
|
||||
if (!isNaN(parseFloat(settings.gotoxmax)))currentSettings.gotoxmax = parseFloat(settings.gotoxmax);
|
||||
if (!isNaN(parseFloat(settings.gotoymin)))currentSettings.gotoymin = parseFloat(settings.gotoymin);
|
||||
@@ -664,7 +655,6 @@
|
||||
|
||||
// Onload add listener to collect messages from WebUI and init extension
|
||||
window.onload = (event) => {
|
||||
console.log("Extension chargée");
|
||||
window.addEventListener("message", processMessage, false);
|
||||
loadIcons();
|
||||
loadSettings();
|
||||
BIN
extensions/clicktogo/dist/click2go.html.gz
vendored
BIN
extensions/clicktogo/dist/click2go.html.gz
vendored
Binary file not shown.
@@ -108,10 +108,6 @@ const ContentContainer = () => {
|
||||
)
|
||||
},
|
||||
onFail: (error) => {
|
||||
toasts.addToast({
|
||||
content: error,
|
||||
type: "error",
|
||||
})
|
||||
console.log(error)
|
||||
if (!eventMsg.data.noDispatch)
|
||||
dispatchToExtensions(
|
||||
@@ -151,10 +147,6 @@ const ContentContainer = () => {
|
||||
)
|
||||
},
|
||||
onFail: (error) => {
|
||||
toasts.addToast({
|
||||
content: error,
|
||||
type: "error",
|
||||
})
|
||||
console.log(error)
|
||||
if (!eventMsg.data.noDispatch)
|
||||
dispatchToExtensions(
|
||||
@@ -215,10 +207,6 @@ const ContentContainer = () => {
|
||||
)
|
||||
},
|
||||
onFail: (error) => {
|
||||
toasts.addToast({
|
||||
content: error,
|
||||
type: "error",
|
||||
})
|
||||
if (!eventMsg.data.noDispatch)
|
||||
dispatchToExtensions(
|
||||
"upload",
|
||||
@@ -263,10 +251,6 @@ const ContentContainer = () => {
|
||||
)
|
||||
},
|
||||
onFail: (error) => {
|
||||
toasts.addToast({
|
||||
content: error,
|
||||
type: "error",
|
||||
})
|
||||
if (!eventMsg.data.noDispatch)
|
||||
dispatchToExtensions(
|
||||
"download",
|
||||
@@ -720,10 +704,6 @@ const ContentContainer = () => {
|
||||
},
|
||||
{
|
||||
onSuccess: (result) => {
|
||||
toasts.addToast({
|
||||
content: T("S62"),
|
||||
type: "success",
|
||||
})
|
||||
dispatchToExtensions(
|
||||
"extensionsData",
|
||||
{
|
||||
@@ -734,10 +714,6 @@ const ContentContainer = () => {
|
||||
)
|
||||
},
|
||||
onFail: (error) => {
|
||||
toasts.addToast({
|
||||
content: T("S44"),
|
||||
type: "Error",
|
||||
})
|
||||
dispatchToExtensions(
|
||||
"extensionsData",
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
import { h } from "preact"
|
||||
import { webUIbuild } from "../../targets"
|
||||
export const webUIversion = "3.0.0-a66"
|
||||
export const webUIversion = "3.0.0-a67"
|
||||
export const Esp3dVersion = () => (
|
||||
<span>
|
||||
{webUIversion}.{webUIbuild}
|
||||
|
||||
Reference in New Issue
Block a user