diff --git a/boards/default_src/micropython_esp32/origin/build/Generic_ESP32-v1.23.0.bin b/boards/default_src/micropython_esp32/origin/build/Generic_ESP32-v1.23.0.bin
deleted file mode 100644
index 35232a80..00000000
Binary files a/boards/default_src/micropython_esp32/origin/build/Generic_ESP32-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32/origin/build/Generic_ESP32_lib-v1.25.0.bin b/boards/default_src/micropython_esp32/origin/build/Generic_ESP32_lib-v1.25.0.bin
index 839a5daa..dfee2f45 100644
Binary files a/boards/default_src/micropython_esp32/origin/build/Generic_ESP32_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32/origin/build/Generic_ESP32_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32/origin/build/Mixgo-v1.23.0.bin b/boards/default_src/micropython_esp32/origin/build/Mixgo-v1.23.0.bin
deleted file mode 100644
index 4e753c8e..00000000
Binary files a/boards/default_src/micropython_esp32/origin/build/Mixgo-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32/origin/build/Mixgo_PE-v1.23.0.bin b/boards/default_src/micropython_esp32/origin/build/Mixgo_PE-v1.23.0.bin
deleted file mode 100644
index 7a3aff1c..00000000
Binary files a/boards/default_src/micropython_esp32/origin/build/Mixgo_PE-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32/origin/build/Mixgo_PE_lib-v1.25.0.bin b/boards/default_src/micropython_esp32/origin/build/Mixgo_PE_lib-v1.25.0.bin
index 278b1691..0a96c156 100644
Binary files a/boards/default_src/micropython_esp32/origin/build/Mixgo_PE_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32/origin/build/Mixgo_PE_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32/origin/build/Mixgo_lib-v1.25.0.bin b/boards/default_src/micropython_esp32/origin/build/Mixgo_lib-v1.25.0.bin
index 35791c7a..314a85fa 100644
Binary files a/boards/default_src/micropython_esp32/origin/build/Mixgo_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32/origin/build/Mixgo_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32/origin/build/mPython-v1.23.0.bin b/boards/default_src/micropython_esp32/origin/build/mPython-v1.23.0.bin
deleted file mode 100644
index 8604375c..00000000
Binary files a/boards/default_src/micropython_esp32/origin/build/mPython-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32/origin/build/mPython_lib-v1.25.0.bin b/boards/default_src/micropython_esp32/origin/build/mPython_lib-v1.25.0.bin
index b80179f3..6cd07ada 100644
Binary files a/boards/default_src/micropython_esp32/origin/build/mPython_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32/origin/build/mPython_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32c2/origin/build/Generic_C2_lib-v1.25.0.bin b/boards/default_src/micropython_esp32c2/origin/build/Generic_C2_lib-v1.25.0.bin
index 6adbba3b..3ae98fca 100644
Binary files a/boards/default_src/micropython_esp32c2/origin/build/Generic_C2_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32c2/origin/build/Generic_C2_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini-v1.25.0.bin b/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini-v1.25.0.bin
deleted file mode 100644
index 5312b644..00000000
Binary files a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini-v1.25.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_lib-v1.25.0.bin b/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_lib-v1.25.0.bin
index 9facb408..b1b21648 100644
Binary files a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_v2_lib-v1.25.0.bin b/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_v2_lib-v1.25.0.bin
index ec00d4ef..719bd2cc 100644
Binary files a/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_v2_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32c2/origin/build/Mixgo_Mini_v2_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART-v1.23.0.bin
deleted file mode 100644
index 451956c4..00000000
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART_lib-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART_lib-v1.23.0.bin
index a596f333..90606006 100644
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART_lib-v1.23.0.bin and b/boards/default_src/micropython_esp32c3/origin/build/Generic_C3_UART_lib-v1.23.0.bin differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC-v1.23.0.bin
deleted file mode 100644
index 325f27bd..00000000
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC_lib-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC_lib-v1.23.0.bin
index 4a7a0edf..29025470 100644
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC_lib-v1.23.0.bin and b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_CC_lib-v1.23.0.bin differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car-v1.23.0.bin
deleted file mode 100644
index 10037da6..00000000
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car_lib-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car_lib-v1.23.0.bin
index f39137fe..e861a5c9 100644
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car_lib-v1.23.0.bin and b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_Car_lib-v1.23.0.bin differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME-v1.23.0.bin
deleted file mode 100644
index 8dc9a137..00000000
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME_lib-v1.23.0.bin b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME_lib-v1.23.0.bin
index 4a6982a5..3cdf5703 100644
Binary files a/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME_lib-v1.23.0.bin and b/boards/default_src/micropython_esp32c3/origin/build/Mixgo_ME_lib-v1.23.0.bin differ
diff --git a/boards/default_src/micropython_esp32s2/origin/build/Generic_S2-v1.23.0.bin b/boards/default_src/micropython_esp32s2/origin/build/Generic_S2-v1.23.0.bin
deleted file mode 100644
index 6d0e2178..00000000
Binary files a/boards/default_src/micropython_esp32s2/origin/build/Generic_S2-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s2/origin/build/Generic_S2_lib-v1.25.0.bin b/boards/default_src/micropython_esp32s2/origin/build/Generic_S2_lib-v1.25.0.bin
index 603d261d..5acc2bd2 100644
Binary files a/boards/default_src/micropython_esp32s2/origin/build/Generic_S2_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32s2/origin/build/Generic_S2_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE-v1.23.0.bin b/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE-v1.23.0.bin
deleted file mode 100644
index 40a92856..00000000
Binary files a/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE_lib-v1.25.0.bin b/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE_lib-v1.25.0.bin
index e10c04a8..2e80219e 100644
Binary files a/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32s2/origin/build/Mixgo_CE_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Generic_S3-v1.23.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Generic_S3-v1.23.0.bin
deleted file mode 100644
index 43e482d6..00000000
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Generic_S3-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Generic_S3_lib-v1.25.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Generic_S3_lib-v1.25.0.bin
index 6eef250a..97a27adf 100644
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Generic_S3_lib-v1.25.0.bin and b/boards/default_src/micropython_esp32s3/origin/build/Generic_S3_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova-v1.21.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova-v1.21.0.bin
deleted file mode 100644
index 97c4fc04..00000000
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova-v1.21.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova_lib-v1.21.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova_lib-v1.21.0.bin
index a61cb5bd..59d928b2 100644
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova_lib-v1.21.0.bin and b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Nova_lib-v1.21.0.bin differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant-v1.13.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant-v1.13.0.bin
deleted file mode 100644
index 0ad3a801..00000000
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant-v1.13.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant_lib-v1.13.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant_lib-v1.13.0.bin
index 577a4fb3..af4ef2b0 100644
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant_lib-v1.13.0.bin and b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Sant_lib-v1.13.0.bin differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Soar_lib-v1.21.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Soar_lib-v1.21.0.bin
index 06ab3d44..3d415305 100644
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Soar_lib-v1.21.0.bin and b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Soar_lib-v1.21.0.bin differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Zero-v1.21.0.bin b/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Zero-v1.21.0.bin
deleted file mode 100644
index fb25827b..00000000
Binary files a/boards/default_src/micropython_esp32s3/origin/build/Mixgo_Zero-v1.21.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_esp32s3/origin/build/lib/mixgo_soar.py b/boards/default_src/micropython_esp32s3/origin/build/lib/mixgo_soar.py
index e6d92c03..c7b6b561 100644
--- a/boards/default_src/micropython_esp32s3/origin/build/lib/mixgo_soar.py
+++ b/boards/default_src/micropython_esp32s3/origin/build/lib/mixgo_soar.py
@@ -36,7 +36,7 @@ except Exception as e:
'''IMU-Sensor'''
try :
import qmi8658
- onboard_imu = qmi8658.QMI8658(onboard_i2c, 0x6A)
+ onboard_imu = qmi8658.QMI8658(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with QMI8658 (IMU) or",e)
diff --git a/boards/default_src/micropython_robot/origin/build/MixBot-v1.23.0.bin b/boards/default_src/micropython_robot/origin/build/MixBot-v1.23.0.bin
deleted file mode 100644
index 926e19c8..00000000
Binary files a/boards/default_src/micropython_robot/origin/build/MixBot-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_robot/origin/build/MixBot_lib-v1.25.0.bin b/boards/default_src/micropython_robot/origin/build/MixBot_lib-v1.25.0.bin
index 9de1d885..dc6104fb 100644
Binary files a/boards/default_src/micropython_robot/origin/build/MixBot_lib-v1.25.0.bin and b/boards/default_src/micropython_robot/origin/build/MixBot_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi-v1.23.0.bin b/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi-v1.23.0.bin
deleted file mode 100644
index 9b3d9c87..00000000
Binary files a/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi_lib-v1.25.0.bin b/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi_lib-v1.25.0.bin
index 25f16739..b3531cac 100644
Binary files a/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi_lib-v1.25.0.bin and b/boards/default_src/micropython_robot/origin/build/Mixgo_FeiYi_lib-v1.25.0.bin differ
diff --git a/boards/default_src/micropython_robot/origin/build/RM_E1-v1.23.0.bin b/boards/default_src/micropython_robot/origin/build/RM_E1-v1.23.0.bin
deleted file mode 100644
index f63a014e..00000000
Binary files a/boards/default_src/micropython_robot/origin/build/RM_E1-v1.23.0.bin and /dev/null differ
diff --git a/boards/default_src/micropython_robot/origin/build/RM_E1_lib-v1.25.0.bin b/boards/default_src/micropython_robot/origin/build/RM_E1_lib-v1.25.0.bin
index ee2b159d..3413fbc4 100644
Binary files a/boards/default_src/micropython_robot/origin/build/RM_E1_lib-v1.25.0.bin and b/boards/default_src/micropython_robot/origin/build/RM_E1_lib-v1.25.0.bin differ
diff --git a/boards/default_src/python_mixpy/blocks/turtle.js b/boards/default_src/python_mixpy/blocks/turtle.js
index c3cc5675..4766a487 100644
--- a/boards/default_src/python_mixpy/blocks/turtle.js
+++ b/boards/default_src/python_mixpy/blocks/turtle.js
@@ -171,7 +171,6 @@ export const turtle_setxy = {
};
export const turtle_pos_shape = {
-
init: function () {
this.setColour(TURTLE_HUE);
var pos_shape =
@@ -200,6 +199,18 @@ export const turtle_pos_shape = {
}
};
+export const turtle_stamp = {
+ init: function () {
+ this.setColour(TURTLE_HUE);
+ this.appendValueInput('TUR')
+ .setCheck('Turtle')
+ this.appendDummyInput()
+ .appendField(Blockly.Msg.TURTLE_STAMP);
+ this.setInputsInline(true);
+ this.setPreviousStatement(true);
+ this.setNextStatement(true);
+ }
+};
export const turtle_clear = {
init: function () {
@@ -211,8 +222,6 @@ export const turtle_clear = {
this.setColour(TURTLE_HUE);
this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(clear_reset), 'DIR')
-
-
this.setInputsInline(true);
this.setPreviousStatement(true);
this.setNextStatement(true);
diff --git a/boards/default_src/python_mixpy/generators/turtle.js b/boards/default_src/python_mixpy/generators/turtle.js
index c0ba5d4d..80002b68 100644
--- a/boards/default_src/python_mixpy/generators/turtle.js
+++ b/boards/default_src/python_mixpy/generators/turtle.js
@@ -75,6 +75,13 @@ export const turtle_pos_shape = function (_, generator) {
return [code, generator.ORDER_ATOMIC];
}
+export const turtle_stamp = function (_, generator) {
+ generator.definitions_.import_turtle = "import turtle";
+ var varName = generator.valueToCode(this, 'TUR', generator.ORDER_ASSIGNMENT) || '0';
+ var code = varName + '.stamp()\n';
+ return code;
+}
+
export const turtle_clear = function (_, generator) {
generator.definitions_.import_turtle = "import turtle";
var varName = generator.valueToCode(this, 'TUR', generator.ORDER_ASSIGNMENT) || '0';
diff --git a/boards/default_src/python_mixpy/template.xml b/boards/default_src/python_mixpy/template.xml
index 8ba4021a..a70b5b49 100644
--- a/boards/default_src/python_mixpy/template.xml
+++ b/boards/default_src/python_mixpy/template.xml
@@ -1814,6 +1814,13 @@
+
+
+
+ tina
+
+
+
diff --git a/boards/default_src/python_pyodide/template.xml b/boards/default_src/python_pyodide/template.xml
index 1a58a660..896c0083 100644
--- a/boards/default_src/python_pyodide/template.xml
+++ b/boards/default_src/python_pyodide/template.xml
@@ -1777,6 +1777,13 @@
+
+
+
+ tina
+
+
+
diff --git a/boards/default_src/python_skulpt/template.xml b/boards/default_src/python_skulpt/template.xml
index f1bc3176..84404978 100644
--- a/boards/default_src/python_skulpt/template.xml
+++ b/boards/default_src/python_skulpt/template.xml
@@ -1445,6 +1445,13 @@
+
+
+
+ tina
+
+
+
diff --git a/common/msg/blockly/en.js b/common/msg/blockly/en.js
index ce5a62aa..0bbfa84c 100644
--- a/common/msg/blockly/en.js
+++ b/common/msg/blockly/en.js
@@ -1776,6 +1776,7 @@ En.TURTLE_POS_SHAPE = "Get the turtle currently";
En.TURTLE_POS = "Get the current position of the turtle";
En.TURTLE_SHAPE = "shape";
En.TURTLE_HEADING = "Heading";
+En.TURTLE_STAMP = "Stamp";
En.MIXLY_TOOLTIP_TURTEL_POS = 'Get the turtle\'s current position and return a tuple containing the current position x and y coordinates';
En.MIXLY_TOOLTIP_TURTEL_SHAPE = 'Get the turtle\'s current shape and return a string';
En.MIXLY_TOOLTIP_TURTEL_GET_SPEED = "get the turtles current speed and return an integer;";
diff --git a/common/msg/blockly/zh-hans.js b/common/msg/blockly/zh-hans.js
index 0a03b0ed..7c91fcb9 100644
--- a/common/msg/blockly/zh-hans.js
+++ b/common/msg/blockly/zh-hans.js
@@ -1789,6 +1789,7 @@ ZhHans.TURTLE_POS_SHAPE = "获取海龟当前";
ZhHans.TURTLE_POS = "位置";
ZhHans.TURTLE_SHAPE = "形状";
ZhHans.TURTLE_HEADING = "朝向";
+ZhHans.TURTLE_STAMP = "留下印记";
ZhHans.MIXLY_TOOLTIP_TURTEL_POS = '获取海龟当前位置,返回一个包含当前位置x坐标和y坐标的元组';
ZhHans.MIXLY_TOOLTIP_TURTEL_SHAPE = '获取海龟当前形状,返回一个字符串';
ZhHans.MIXLY_TOOLTIP_TURTEL_GET_SPEED = '获取海龟当前速度,返回一个整数';
diff --git a/common/msg/blockly/zh-hant.js b/common/msg/blockly/zh-hant.js
index c634a67d..173f70ac 100644
--- a/common/msg/blockly/zh-hant.js
+++ b/common/msg/blockly/zh-hant.js
@@ -1789,6 +1789,7 @@ ZhHant.TURTLE_POS_SHAPE = "獲取海龜當前";
ZhHant.TURTLE_POS = "位置";
ZhHant.TURTLE_SHAPE = "形狀";
ZhHant.TURTLE_HEADING = "朝向";
+ZhHant.TURTLE_STAMP = "留下印記";
ZhHant.MIXLY_TOOLTIP_TURTEL_POS = '獲取海龜當前位置,返回一個包含當前位置x座標和y座標的元組';
ZhHant.MIXLY_TOOLTIP_TURTEL_SHAPE = '獲取海龜當前形狀,返回一個字符串';
ZhHant.MIXLY_TOOLTIP_TURTEL_GET_SPEED = '獲取海龜當前速度,返回一個整數';
diff --git a/index.html b/index.html
index 00a26bdc..3c048216 100644
--- a/index.html
+++ b/index.html
@@ -8,6 +8,7 @@
+
diff --git a/mixly-sw/mixly-modules/common/config.js b/mixly-sw/mixly-modules/common/config.js
index c09c0857..aaa3bdd6 100644
--- a/mixly-sw/mixly-modules/common/config.js
+++ b/mixly-sw/mixly-modules/common/config.js
@@ -31,7 +31,7 @@ Config.init = () => {
const boardPageConfig = Url.getConfig();
Config.BOARD_PAGE = boardPageConfig ?? {};
console.log('Config.BOARD_PAGE:', Config.BOARD_PAGE);
- document.title = Config.SOFTWARE.version ?? 'Mixly 2.0';
+ document.title = Config.SOFTWARE.version ?? 'Mixly 3.0';
Config.USER = {
...Config.USER,
diff --git a/mixly-sw/mixly-modules/common/setting.js b/mixly-sw/mixly-modules/common/setting.js
index 549b0dfe..dbf877e0 100644
--- a/mixly-sw/mixly-modules/common/setting.js
+++ b/mixly-sw/mixly-modules/common/setting.js
@@ -5,6 +5,7 @@ goog.require('ace.ExtLanguageTools');
goog.require('layui');
goog.require('store');
goog.require('$.select2');
+goog.require('$.fomanticUI');
goog.require('Mixly.XML');
goog.require('Mixly.LayerExt');
goog.require('Mixly.Msg');
@@ -167,13 +168,14 @@ Setting.onclick = () => {
Setting.addOnchangeOptionListener = () => {
element.on('tab(setting-menu-filter)', function(data) {
const { index } = data;
- if (index === 1) {
+ const type = $(data.elem.prevObject).data('type');
+ if (type === 'import-board') {
if (data.index !== Setting.nowIndex) {
goog.isElectron && BoardManager.onclickImportBoards();
} else {
layui.table.resize('cloud-boards-table');
}
- } else if (index === 2) {
+ } else if (type === 'ws-update') {
if (data.index !== Setting.nowIndex) {
$('#setting-menu-update').loading({
background: USER.theme === 'dark' ? '#807b7b' : '#fff',
@@ -189,6 +191,26 @@ Setting.addOnchangeOptionListener = () => {
args: [ SOFTWARE.configUrl ]
});
}
+ } else if (type === 'nw-update') {
+ fetch('/api/check-update', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ })
+ .then((response) => response.json())
+ .then((result) => {
+ const {
+ localVersion,
+ cloudVersion,
+ needsUpdate,
+ cloudFile
+ } = result;
+ Setting.refreshUpdateMenuStatus(localVersion, cloudVersion, needsUpdate, cloudFile);
+ })
+ .catch((error) => {
+ console.log(error)
+ });
}
Setting.nowIndex = index;
});
@@ -229,58 +251,65 @@ Setting.configMenuGetValue = (obj) => {
return config;
}
-Setting.refreshUpdateMenuStatus = (config) => {
- console.log(config);
- const {
- serverVersion
- } = config;
- let $serverDiv = $('#setting-menu-update-server');
- let $btnDiv = $('#setting-menu-update > div:nth-child(2)');
+Setting.refreshUpdateMenuStatus = (localVersion, cloudVersion, needsUpdate, url) => {
+ const $serverDiv = $('#setting-menu-update-server');
+ const $btnDiv = $('#setting-menu-update > div:nth-child(2)');
+ const $button = $btnDiv.children('button');
+ $button.removeClass('layui-btn-disabled');
+ $button.addClass('self-adaption-btn');
+ const $mixlyProgress = $serverDiv.find('.mixly-progress');
$serverDiv.find('span').css('display', 'none');
- let needUpdateServer = false;
- if (serverVersion && serverVersion !== SOFTWARE.serverVersion) {
- $serverDiv.find('span[value="obsolete"]').css('display', 'inline-block');
- needUpdateServer = true;
- $serverDiv.find('text').text(`${SOFTWARE.serverVersion} → ${serverVersion}`);
+ $mixlyProgress.hide();
+ $mixlyProgress.find('.progress').show();
+ $mixlyProgress.removeClass('swinging indeterminate');
+ if (needsUpdate) {
+ $serverDiv.find('span.obsolete').css('display', 'inline-block');
+ $serverDiv.find('text').text(`${localVersion} → ${cloudVersion}`);
+
} else {
- $serverDiv.find('span[value="latest"]').css('display', 'inline-block');
- $serverDiv.find('text').text(SOFTWARE.serverVersion);
+ $serverDiv.find('span.latest').css('display', 'inline-block');
+ $serverDiv.find('text').text(localVersion);
}
- if (needUpdateServer) {
+ if (needsUpdate) {
$btnDiv.css('display', 'flex');
- $btnDiv.children('button').off().click((event) => {
- LayerExt.open({
- title: Msg.getLang('PROGRESS'),
- id: 'setting-menu-update-layer',
- shade: LayerExt.SHADE_ALL,
- area: ['40%', '60%'],
- max: ['800px', '300px'],
- min: ['500px', '100px'],
- success: (layero, index) => {
- $('#setting-menu-update-layer').css('overflow', 'hidden');
- layero.find('.layui-layer-setwin').css('display', 'none');
- Setting.ace = Setting.createAceEditor('setting-menu-update-layer');
- Setting.ace.resize();
- const { Socket } = Mixly.WebSocket;
- Socket.sendCommand({
- obj: 'Socket',
- func: 'updateSW',
- args: []
+ $button.off().one('click', (event) => {
+ $button.addClass('layui-btn-disabled');
+ $button.removeClass('self-adaption-btn');
+ const eventSource = new EventSource(`/api/download?url=${encodeURIComponent(url)}&cloudVersion=${cloudVersion}`);
+ $mixlyProgress.show();
+ eventSource.onmessage = function(event) {
+ const data = JSON.parse(event.data);
+ if (data.type === 'progress') {
+ $mixlyProgress.progress({
+ percent: data.progress
});
- },
- resizing: (layero) => {
- Setting.ace.resize();
- },
- end: () => {
+ } else if (data.type === 'unzip') {
+ $mixlyProgress.addClass('swinging indeterminate');
+ $mixlyProgress.progress({
+ percent: 100
+ });
+ $mixlyProgress.find('.progress').hide();
+ layer.msg('解压中...', { time: 1000 });
+ } else if (data.type === 'complete') {
+ $mixlyProgress.removeClass('swinging indeterminate');
+ layer.msg('更新完成!5秒后自动刷新...', { time: 1000 });
+ eventSource.close();
+ setTimeout(function(){
+ window.location.reload();
+ }, 5000);
}
- });
+ };
+ eventSource.onerror = function(error) {
+ layer.msg('下载失败!5秒后自动刷新...', { time: 1000 });
+ setTimeout(function(){
+ window.location.reload();
+ }, 5000);
+ eventSource.close();
+ };
});
} else {
$btnDiv.css('display', 'none');
}
- setTimeout(() => {
- $('#setting-menu-update').loading('destroy');
- }, 500);
}
Setting.showUpdateMessage = (data) => {
diff --git a/mixly-sw/mixly-modules/common/xml.js b/mixly-sw/mixly-modules/common/xml.js
index cb763206..b8d0a061 100644
--- a/mixly-sw/mixly-modules/common/xml.js
+++ b/mixly-sw/mixly-modules/common/xml.js
@@ -21,6 +21,9 @@ if (Env.hasSocketServer) {
if (env === 'electron' && !goog.isElectron) {
env = 'web';
}
+if (typeof nw === 'object') {
+ env = 'nw';
+}
XML.TEMPLATE_CONFIG = [
{
diff --git a/mixly-sw/mixly-modules/deps.json b/mixly-sw/mixly-modules/deps.json
index 0020e66a..25060855 100644
--- a/mixly-sw/mixly-modules/deps.json
+++ b/mixly-sw/mixly-modules/deps.json
@@ -89,6 +89,7 @@
"layui",
"store",
"$.select2",
+ "$.fomanticUI",
"Mixly.XML",
"Mixly.LayerExt",
"Mixly.Msg",
diff --git a/mixly-sw/templete/setting-div.html b/mixly-sw/templete/setting-div.html
index 6f3582c2..eb78a915 100644
--- a/mixly-sw/templete/setting-div.html
+++ b/mixly-sw/templete/setting-div.html
@@ -167,22 +167,52 @@
#setting-menu-update .layui-panel {
margin: 5px;
}
+
+ #setting-menu-update .latest,
+ #setting-menu-update .obsolete {
+ display: none;
+ }
+
+ #setting-menu-update-server .mixly-progress {
+ display: none;
+ margin-bottom: 0px;
+ }
+
+ #setting-menu-update-server .bar {
+ height: 20px;
+ }
+
+ #setting-menu-update-server .bar > .progress {
+ /*display: none;*/
+ height: 20px;
+ margin-bottom: 10px;
+ overflow: hidden;
+ border-radius: 1px;
+ -webkit-box-shadow: unset;
+ box-shadow: unset;
+ background-color: unset;
+ }