mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-15 12:25:15 +03:00
feat: move firmware to modules
this fixes the disconnect issue
This commit is contained in:
parent
ceea7ef60b
commit
d71a5f7ef3
3 changed files with 18 additions and 13 deletions
|
@ -321,7 +321,9 @@ function startProcess() {
|
|||
);
|
||||
break;
|
||||
case 'firmware_flasher':
|
||||
TABS.firmware_flasher.initialize(content_ready);
|
||||
import("./tabs/firmware_flasher").then(({ firmware_flasher }) =>
|
||||
firmware_flasher.initialize(content_ready)
|
||||
);
|
||||
break;
|
||||
case 'help':
|
||||
import('./tabs/help').then(({ help }) => help.initialize(content_ready));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
import { i18n } from '../localization';
|
||||
|
||||
TABS.firmware_flasher = {
|
||||
const firmware_flasher = {
|
||||
releases: null,
|
||||
releaseChecker: new ReleaseChecker('firmware', 'https://api.github.com/repos/betaflight/betaflight/releases'),
|
||||
jenkinsLoader: new JenkinsLoader('https://ci.betaflight.tech'),
|
||||
|
@ -14,7 +14,7 @@ TABS.firmware_flasher = {
|
|||
developmentFirmwareLoaded: false, // Is the firmware to be flashed from the development branch?
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.initialize = function (callback) {
|
||||
firmware_flasher.initialize = function (callback) {
|
||||
var self = this;
|
||||
|
||||
if (GUI.active_tab != 'firmware_flasher') {
|
||||
|
@ -1224,7 +1224,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
});
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.cleanup = function (callback) {
|
||||
firmware_flasher.cleanup = function (callback) {
|
||||
PortHandler.flush_callbacks();
|
||||
FirmwareCache.unload();
|
||||
|
||||
|
@ -1241,9 +1241,7 @@ TABS.firmware_flasher.cleanup = function (callback) {
|
|||
if (callback) callback();
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.enableFlashing = function (enabled) {
|
||||
var self = this;
|
||||
|
||||
firmware_flasher.enableFlashing = function (enabled) {
|
||||
if (enabled) {
|
||||
$('a.flash_firmware').removeClass('disabled');
|
||||
} else {
|
||||
|
@ -1251,12 +1249,12 @@ TABS.firmware_flasher.enableFlashing = function (enabled) {
|
|||
}
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.FLASH_MESSAGE_TYPES = {NEUTRAL : 'NEUTRAL',
|
||||
firmware_flasher.FLASH_MESSAGE_TYPES = {NEUTRAL : 'NEUTRAL',
|
||||
VALID : 'VALID',
|
||||
INVALID : 'INVALID',
|
||||
ACTION : 'ACTION'};
|
||||
|
||||
TABS.firmware_flasher.flashingMessage = function(message, type) {
|
||||
firmware_flasher.flashingMessage = function(message, type) {
|
||||
let self = this;
|
||||
|
||||
let progressLabel_e = $('span.progressLabel');
|
||||
|
@ -1285,13 +1283,13 @@ TABS.firmware_flasher.flashingMessage = function(message, type) {
|
|||
return self;
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.flashProgress = function(value) {
|
||||
firmware_flasher.flashProgress = function(value) {
|
||||
$('.progress').val(value);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.injectTargetInfo = function (targetConfig, targetName, manufacturerId, commitInfo) {
|
||||
firmware_flasher.injectTargetInfo = function (targetConfig, targetName, manufacturerId, commitInfo) {
|
||||
const targetInfoLineRegex = /^# config: manufacturer_id: .*, board_name: .*, version: .*$, date: .*\n/gm;
|
||||
|
||||
const config = targetConfig.replace(targetInfoLineRegex, '');
|
||||
|
@ -1302,3 +1300,9 @@ TABS.firmware_flasher.injectTargetInfo = function (targetConfig, targetName, man
|
|||
lines.splice(1, 0, targetInfo);
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
TABS.firmware_flasher = firmware_flasher;
|
||||
|
||||
export {
|
||||
firmware_flasher,
|
||||
};
|
||||
|
|
|
@ -128,7 +128,6 @@
|
|||
<script type="module" src="./js/tabs/logging.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/onboard_logging.js"></script>
|
||||
<script type="text/javascript" src="./js/FirmwareCache.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/firmware_flasher.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/failsafe.js"></script>
|
||||
<script type="text/javascript" src="./js/LogoManager.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/osd.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue