Update: xpython板卡工具栏添加烧录额外固件选项

This commit is contained in:
王立帮
2024-10-06 23:27:42 +08:00
parent 9fe0abb852
commit 56204fe160
9 changed files with 179 additions and 73 deletions

View File

@@ -507,6 +507,22 @@ class App extends Component {
weight: 1
});
this.#nav_.register({
icon: 'icon-upload-1',
id: ['setting', 'firmware'],
displayText: Msg.Lang['nav.btn.setting.firmware'],
preconditionFn: () => {
if (goog.isElectron) {
return !!BOARD?.burn?.special;
} else {
return !!BOARD?.web?.burn?.special;
}
},
callback: () => BU.burnWithSpecialBin(),
scopeType: Nav.Scope.RIGHT,
weight: 2
});
this.#nav_.register({
icon: 'icon-comment-1',
id: ['setting', 'feedback'],
@@ -519,7 +535,7 @@ class App extends Component {
Url.open(href);
},
scopeType: Nav.Scope.RIGHT,
weight: 2
weight: 3
});
}

View File

@@ -31,6 +31,7 @@ LayerExt.DEFAULT_CONFIG = {
resize: true,
shade: LayerExt.SHADE_ALL,
success: null,
beforeEnd: null,
end: null,
cancel: null,
resizing: null,
@@ -122,6 +123,12 @@ LayerExt.open = (toolConfig) => {
if (typeof success === 'function')
success(layero, index);
},
beforeEnd: function (layero, index, that) {
const { beforeEnd } = toolConfig;
if (typeof beforeEnd === 'function') {
beforeEnd(layero, index, that);
}
},
end: function () {
const { end } = toolConfig;
if (typeof end === 'function') {