mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 06:15:13 +03:00
Further work: consider versions for unified targets (#1626)
Further work: consider versions for unified targets
This commit is contained in:
commit
62a0ba51a9
3 changed files with 149 additions and 35 deletions
|
@ -2621,9 +2621,6 @@
|
||||||
"firmwareFlasherReleaseDate": {
|
"firmwareFlasherReleaseDate": {
|
||||||
"message": "Date:"
|
"message": "Date:"
|
||||||
},
|
},
|
||||||
"firmwareFlasherReleaseStatus": {
|
|
||||||
"message": "State:"
|
|
||||||
},
|
|
||||||
"firmwareFlasherReleaseTarget": {
|
"firmwareFlasherReleaseTarget": {
|
||||||
"message": "Target:"
|
"message": "Target:"
|
||||||
},
|
},
|
||||||
|
@ -2655,6 +2652,9 @@
|
||||||
"firmwareFlasherLoadFirmwareFile": {
|
"firmwareFlasherLoadFirmwareFile": {
|
||||||
"message": "Please load firmware file"
|
"message": "Please load firmware file"
|
||||||
},
|
},
|
||||||
|
"firmwareFlasherLoadedConfig": {
|
||||||
|
"message": "Loaded target, please load firmware file"
|
||||||
|
},
|
||||||
"firmwareFlasherNoReboot": {
|
"firmwareFlasherNoReboot": {
|
||||||
"message": "No reboot sequence"
|
"message": "No reboot sequence"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,8 @@ TABS.firmware_flasher = {
|
||||||
releases: null,
|
releases: null,
|
||||||
releaseChecker: new ReleaseChecker('firmware', 'https://api.github.com/repos/betaflight/betaflight/releases'),
|
releaseChecker: new ReleaseChecker('firmware', 'https://api.github.com/repos/betaflight/betaflight/releases'),
|
||||||
jenkinsLoader: new JenkinsLoader('https://ci.betaflight.tech'),
|
jenkinsLoader: new JenkinsLoader('https://ci.betaflight.tech'),
|
||||||
localFileLoaded: false,
|
localFirmwareLoaded: false,
|
||||||
|
selectedBoard: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
TABS.firmware_flasher.initialize = function (callback) {
|
TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
@ -14,19 +15,25 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
GUI.active_tab = 'firmware_flasher';
|
GUI.active_tab = 'firmware_flasher';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TABS.firmware_flasher.selectedBoard = undefined;
|
||||||
|
TABS.firmware_flasher.localFirmwareLoaded = false;
|
||||||
var intel_hex = false; // standard intel hex in string format
|
var intel_hex = false; // standard intel hex in string format
|
||||||
var parsed_hex = false; // parsed raw hex in array format
|
var parsed_hex = false; // parsed raw hex in array format
|
||||||
var targetConfig; // the Unified Target configuration to be spliced into the configuration
|
var targetConfig; // the Unified Target configuration to be spliced into the configuration
|
||||||
var isConfigLocal = false; // Set to true if the user loads one locally
|
var isConfigLocal = false; // Set to true if the user loads one locally
|
||||||
var unifiedConfig; // Unified target configuration loaded from the menu, used when throwing out a local config
|
var unifiedConfig; // Unified target configuration loaded from the menu, used when throwing out a local config
|
||||||
|
|
||||||
self.peekTargetConfig = function () { // This maybe should get removed before merging.
|
|
||||||
return targetConfig;
|
|
||||||
}
|
|
||||||
var unifiedSource = 'https://api.github.com/repos/betaflight/unified-targets/contents/configs/default';
|
var unifiedSource = 'https://api.github.com/repos/betaflight/unified-targets/contents/configs/default';
|
||||||
|
|
||||||
|
|
||||||
|
// These two functions are handy for peeking under the hood. Please don't call them in code.
|
||||||
|
self.peekTargetConfig = function () {
|
||||||
|
return targetConfig;
|
||||||
|
}
|
||||||
|
self.peekHex = function () {
|
||||||
|
return parsed_hex;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change boldness of firmware option depending on cache status
|
* Change boldness of firmware option depending on cache status
|
||||||
*
|
*
|
||||||
|
@ -62,10 +69,9 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
self.enableFlashing(true);
|
self.enableFlashing(true);
|
||||||
|
|
||||||
$('div.release_info .target').text(summary.target);
|
$('div.release_info .target').text(TABS.firmware_flasher.selectedBoard);
|
||||||
$('div.release_info .name').text(summary.version).prop('href', summary.releaseUrl);
|
$('div.release_info .name').text(summary.version).prop('href', summary.releaseUrl);
|
||||||
$('div.release_info .date').text(summary.date);
|
$('div.release_info .date').text(summary.date);
|
||||||
$('div.release_info .status').text(summary.status);
|
|
||||||
$('div.release_info .file').text(summary.file).prop('href', summary.url);
|
$('div.release_info .file').text(summary.file).prop('href', summary.url);
|
||||||
|
|
||||||
var formattedNotes = summary.notes.replace(/#(\d+)/g, '[#$1](https://github.com/betaflight/betaflight/pull/$1)');
|
var formattedNotes = summary.notes.replace(/#(\d+)/g, '[#$1](https://github.com/betaflight/betaflight/pull/$1)');
|
||||||
|
@ -99,6 +105,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLoadSuccess(data, summary) {
|
function onLoadSuccess(data, summary) {
|
||||||
|
self.localFirmwareLoaded = false;
|
||||||
// The path from getting a firmware doesn't fill in summary.
|
// The path from getting a firmware doesn't fill in summary.
|
||||||
summary = typeof summary === "object"
|
summary = typeof summary === "object"
|
||||||
? summary
|
? summary
|
||||||
|
@ -146,7 +153,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
ConfigStorage.get('selected_board', function (result) {
|
ConfigStorage.get('selected_board', function (result) {
|
||||||
if (result.selected_board) {
|
if (result.selected_board) {
|
||||||
var boardBuilds = builds[result.selected_board]
|
var boardBuilds = builds[result.selected_board];
|
||||||
$('select[name="board"]').val(boardBuilds ? result.selected_board : 0).trigger('change');
|
$('select[name="board"]').val(boardBuilds ? result.selected_board : 0).trigger('change');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -206,11 +213,27 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
loadUnifiedBuilds(releases);
|
loadUnifiedBuilds(releases);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function checkOneVersionForUnification(version) {
|
||||||
|
return semver.gte(version.split(' ')[0], '4.1.0-RC1');
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkBuildsForUnification(builds) {
|
||||||
|
// Find a build that is newer than 4.1.0, return true if found
|
||||||
|
let foundSuitable = false;
|
||||||
|
Object.keys(builds).forEach(function (key) {
|
||||||
|
builds[key].forEach(function(target) {
|
||||||
|
if (checkOneVersionForUnification(target.version)) {
|
||||||
|
foundSuitable = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return foundSuitable;
|
||||||
|
}
|
||||||
|
|
||||||
function loadUnifiedBuilds(builds) {
|
function loadUnifiedBuilds(builds) {
|
||||||
var expirationPeriod = 3600 * 2; // Two of your earth hours.
|
var expirationPeriod = 3600 * 2; // Two of your earth hours.
|
||||||
var checkTime = Math.floor(Date.now() / 1000); // Lets deal in seconds.
|
var checkTime = Math.floor(Date.now() / 1000); // Lets deal in seconds.
|
||||||
// Come back to this, how to handle build type without unified targets?
|
if (builds && checkBuildsForUnification(builds)) {
|
||||||
if (builds && builds["STM32F411"]) {
|
|
||||||
console.log('loaded some builds for later');
|
console.log('loaded some builds for later');
|
||||||
var storageTag = 'unifiedSourceCache';
|
var storageTag = 'unifiedSourceCache';
|
||||||
chrome.storage.local.get(storageTag, function (result) {
|
chrome.storage.local.get(storageTag, function (result) {
|
||||||
|
@ -292,7 +315,8 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
ConfigStorage.get('selected_board', function (result) {
|
ConfigStorage.get('selected_board', function (result) {
|
||||||
if (result.selected_board) {
|
if (result.selected_board) {
|
||||||
var boardReleases = unifiedConfigs[result.selected_board]
|
var boardReleases = TABS.firmware_flasher.unifiedConfigs[result.selected_board]
|
||||||
|
|| TABS.firmware_flasher.releases[result.selected_board];
|
||||||
$('select[name="board"]').val(boardReleases ? result.selected_board : 0).trigger('change');
|
$('select[name="board"]').val(boardReleases ? result.selected_board : 0).trigger('change');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -394,6 +418,9 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
if (targetVersions) {
|
if (targetVersions) {
|
||||||
versions_element.append($("<option value='0'>{0} {1}</option>".format(i18n.getMessage('firmwareFlasherOptionLabelSelectFirmwareVersionFor'), target)));
|
versions_element.append($("<option value='0'>{0} {1}</option>".format(i18n.getMessage('firmwareFlasherOptionLabelSelectFirmwareVersionFor'), target)));
|
||||||
targetVersions.forEach(function(descriptor) {
|
targetVersions.forEach(function(descriptor) {
|
||||||
|
if (unifiedConfig && !checkOneVersionForUnification(descriptor.version)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var select_e =
|
var select_e =
|
||||||
$("<option value='{0}'>{0} - {1}</option>".format(
|
$("<option value='{0}'>{0} - {1}</option>".format(
|
||||||
descriptor.version,
|
descriptor.version,
|
||||||
|
@ -411,25 +438,75 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function grabBuildNameFromConfig(config) {
|
||||||
|
let bareBoard;
|
||||||
|
try {
|
||||||
|
bareBoard = config.split("\n")[0].split(' ')[3];
|
||||||
|
} catch (e) {
|
||||||
|
bareBoard = undefined;
|
||||||
|
console.log('grabBuildNameFromConfig failed: ', e.message);
|
||||||
|
}
|
||||||
|
return bareBoard;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setUnifiedConfig(target, configText, bareBoard) {
|
||||||
|
// a target might request a firmware with the same name, remove configuration in this case.
|
||||||
|
if (bareBoard == target) {
|
||||||
|
console.log(bareBoard, '==', target);
|
||||||
|
if (!isConfigLocal) {
|
||||||
|
targetConfig = undefined;
|
||||||
|
unifiedConfig = undefined;
|
||||||
|
} else {
|
||||||
|
unifiedConfig = undefined;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
targetConfig = configText;
|
||||||
|
isConfigLocal = false;
|
||||||
|
unifiedConfig = configText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function clearBufferedFirmware() {
|
||||||
|
isConfigLocal = false;
|
||||||
|
targetConfig = undefined;
|
||||||
|
unifiedConfig = undefined;
|
||||||
|
intel_hex = false;
|
||||||
|
parsed_hex = false;
|
||||||
|
self.localFirmwareLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
$('select[name="board"]').change(function() {
|
$('select[name="board"]').change(function() {
|
||||||
$("a.load_remote_file").addClass('disabled');
|
$("a.load_remote_file").addClass('disabled');
|
||||||
var target = $(this).val();
|
var target = $(this).val();
|
||||||
ConfigStorage.set({'selected_board': target});
|
|
||||||
console.log('board changed to', target);
|
|
||||||
|
|
||||||
if (!GUI.connect_lock) {
|
if (!GUI.connect_lock) {
|
||||||
|
if (TABS.firmware_flasher.selectedBoard != target) {
|
||||||
|
// We're sure the board actually changed
|
||||||
|
if (isConfigLocal) {
|
||||||
|
console.log('Board changed, unloading local config');
|
||||||
|
isConfigLocal = false;
|
||||||
|
targetConfig = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ConfigStorage.set({'selected_board': target});
|
||||||
|
TABS.firmware_flasher.selectedBoard = target;
|
||||||
|
TABS.firmware_flasher.bareBoard = undefined;
|
||||||
|
console.log('board changed to', target);
|
||||||
|
|
||||||
self.flashingMessage('firmwareFlasherLoadFirmwareFile', self.FLASH_MESSAGE_TYPES.NEUTRAL)
|
self.flashingMessage('firmwareFlasherLoadFirmwareFile', self.FLASH_MESSAGE_TYPES.NEUTRAL)
|
||||||
.flashProgress(0);
|
.flashProgress(0);
|
||||||
|
|
||||||
$('div.git_info').slideUp();
|
$('div.git_info').slideUp();
|
||||||
$('div.release_info').slideUp();
|
$('div.release_info').slideUp();
|
||||||
|
|
||||||
if (!self.localFileLoaded) {
|
if (!self.localFirmwareLoaded) {
|
||||||
self.enableFlashing(false);
|
self.enableFlashing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var versions_e = $('select[name="firmware_version"]');
|
var versions_e = $('select[name="firmware_version"]');
|
||||||
if(target == 0) {
|
if(target == 0) {
|
||||||
|
// target == 0 is the "Choose a Board" option. Throw out anything loaded
|
||||||
|
clearBufferedFirmware();
|
||||||
|
|
||||||
versions_e.empty();
|
versions_e.empty();
|
||||||
versions_e.append($("<option value='0'>{0}</option>".format(i18n.getMessage('firmwareFlasherOptionLabelSelectFirmwareVersion'))));
|
versions_e.append($("<option value='0'>{0}</option>".format(i18n.getMessage('firmwareFlasherOptionLabelSelectFirmwareVersion'))));
|
||||||
} else {
|
} else {
|
||||||
|
@ -444,19 +521,24 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
chrome.storage.local.get(storageTag, function (result) {
|
chrome.storage.local.get(storageTag, function (result) {
|
||||||
let storageObj = result[storageTag];
|
let storageObj = result[storageTag];
|
||||||
let bareBoard = null;
|
let bareBoard = null;
|
||||||
|
// Check to see if the cached configuration is the one we want.
|
||||||
if (!storageObj || !storageObj.target || storageObj.target != target) {
|
if (!storageObj || !storageObj.target || storageObj.target != target) {
|
||||||
// Have to go and try and get the unified config, and then do stuff
|
// Have to go and try and get the unified config, and then do stuff
|
||||||
$.get(TABS.firmware_flasher.unifiedConfigs[target], function(data) {
|
$.get(TABS.firmware_flasher.unifiedConfigs[target], function(data) {
|
||||||
console.log('got unified config');
|
console.log('got unified config');
|
||||||
|
// cache it for later
|
||||||
let tempObj = {};
|
let tempObj = {};
|
||||||
tempObj['data'] = data;
|
tempObj['data'] = data;
|
||||||
tempObj['target'] = target;
|
tempObj['target'] = target;
|
||||||
tempObj['checkTime'] = checkTime;
|
tempObj['checkTime'] = checkTime;
|
||||||
targetConfig = data;
|
let newStorageObj = {};
|
||||||
isConfigLocal = false;
|
newStorageObj[storageTag] = tempObj;
|
||||||
unifiedConfig = data;
|
chrome.storage.local.set(newStorageObj);
|
||||||
bareBoard = data.split("\n")[0].split(' ')[3];
|
|
||||||
populateVersions(versions_e, TABS.firmware_flasher.releases[bareBoard],target);
|
bareBoard = grabBuildNameFromConfig(data);
|
||||||
|
TABS.firmware_flasher.bareBoard = bareBoard;
|
||||||
|
setUnifiedConfig(target, data, bareBoard);
|
||||||
|
populateVersions(versions_e, TABS.firmware_flasher.releases[bareBoard], target);
|
||||||
}).fail(xhr => {
|
}).fail(xhr => {
|
||||||
//TODO error, populate nothing?
|
//TODO error, populate nothing?
|
||||||
targetConfig = undefined;
|
targetConfig = undefined;
|
||||||
|
@ -469,11 +551,11 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
} else {
|
} else {
|
||||||
console.log('We have the config cached for', target);
|
console.log('We have the config cached for', target);
|
||||||
var data = storageObj.data;
|
var data = storageObj.data;
|
||||||
targetConfig = data;
|
|
||||||
isConfigLocal = false;
|
bareBoard = grabBuildNameFromConfig(data);
|
||||||
unifiedConfig = data;
|
TABS.firmware_flasher.bareBoard = bareBoard;
|
||||||
bareBoard = data.split("\n")[0].split(' ')[3];
|
setUnifiedConfig(target, data, bareBoard);
|
||||||
populateVersions(versions_e, TABS.firmware_flasher.releases[bareBoard],target);
|
populateVersions(versions_e, TABS.firmware_flasher.releases[bareBoard], target);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -483,6 +565,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
} else {
|
} else {
|
||||||
unifiedConfig = undefined;
|
unifiedConfig = undefined;
|
||||||
}
|
}
|
||||||
|
TABS.firmware_flasher.bareBoard = target;
|
||||||
populateVersions(versions_e, TABS.firmware_flasher.releases[target], target);
|
populateVersions(versions_e, TABS.firmware_flasher.releases[target], target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -490,10 +573,24 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function flashingMessageLocal() {
|
||||||
|
// used by the a.load_file hook, evaluate the loaded information, and enable flashing if suitable
|
||||||
|
if (isConfigLocal && !parsed_hex) {
|
||||||
|
self.flashingMessage(i18n.getMessage('firmwareFlasherLoadedConfig'), self.FLASH_MESSAGE_TYPES.NEUTRAL);
|
||||||
|
}
|
||||||
|
if (isConfigLocal && parsed_hex && !self.localFirmwareLoaded) {
|
||||||
|
self.enableFlashing(true);
|
||||||
|
self.flashingMessage(i18n.getMessage('firmwareFlasherFirmwareLocalLoaded', parsed_hex.bytes_total), self.FLASH_MESSAGE_TYPES.NEUTRAL);
|
||||||
|
}
|
||||||
|
if (self.localFirmwareLoaded) {
|
||||||
|
self.enableFlashing(true);
|
||||||
|
self.flashingMessage(i18n.getMessage('firmwareFlasherFirmwareLocalLoaded', parsed_hex.bytes_total), self.FLASH_MESSAGE_TYPES.NEUTRAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
// UI Hooks
|
// UI Hooks
|
||||||
$('a.load_file').click(function () {
|
$('a.load_file').click(function () {
|
||||||
self.enableFlashing(false);
|
self.enableFlashing(false);
|
||||||
self.localFileLoaded = true;
|
//self.localFileLoaded = true;
|
||||||
|
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_CHANNEL, undefined);
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_CHANNEL, undefined);
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'file');
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'file');
|
||||||
|
@ -537,16 +634,17 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
if (parsed_hex) {
|
if (parsed_hex) {
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SIZE, parsed_hex.bytes_total);
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SIZE, parsed_hex.bytes_total);
|
||||||
|
self.localFirmwareLoaded = true;
|
||||||
self.enableFlashing(true);
|
flashingMessageLocal();
|
||||||
|
|
||||||
self.flashingMessage(i18n.getMessage('firmwareFlasherFirmwareLocalLoaded', parsed_hex.bytes_total), self.FLASH_MESSAGE_TYPES.NEUTRAL);
|
|
||||||
} else {
|
} else {
|
||||||
self.flashingMessage('firmwareFlasherHexCorrupted', self.FLASH_MESSAGE_TYPES.INVALID);
|
self.flashingMessage('firmwareFlasherHexCorrupted', self.FLASH_MESSAGE_TYPES.INVALID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
clearBufferedFirmware();
|
||||||
targetConfig = e.target.result;
|
targetConfig = e.target.result;
|
||||||
|
isConfigLocal = true;
|
||||||
|
flashingMessageLocal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -563,8 +661,15 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
$('select[name="firmware_version"]').change(function(evt){
|
$('select[name="firmware_version"]').change(function(evt){
|
||||||
$('div.release_info').slideUp();
|
$('div.release_info').slideUp();
|
||||||
|
|
||||||
if (!self.localFileLoaded) {
|
if (!self.localFirmwareLoaded) {
|
||||||
self.enableFlashing(false);
|
self.enableFlashing(false);
|
||||||
|
self.flashingMessage(i18n.getMessage('firmwareFlasherLoadFirmwareFile'), self.FLASH_MESSAGE_TYPES.NEUTRAL);
|
||||||
|
if(parsed_hex && parsed_hex.bytes_total) {
|
||||||
|
// Changing the board triggers a version change, so we need only dump it here.
|
||||||
|
console.log('throw out loaded hex');
|
||||||
|
intel_hex = false;
|
||||||
|
parsed_hex = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let release = $("option:selected", evt.target).data("summary");
|
let release = $("option:selected", evt.target).data("summary");
|
||||||
|
@ -588,7 +693,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
$('a.load_remote_file').click(function (evt) {
|
$('a.load_remote_file').click(function (evt) {
|
||||||
self.enableFlashing(false);
|
self.enableFlashing(false);
|
||||||
self.localFileLoaded = false;
|
self.localFirmwareLoaded = false;
|
||||||
|
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'http');
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'http');
|
||||||
|
|
||||||
|
@ -606,6 +711,16 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
var summary = $('select[name="firmware_version"] option:selected').data('summary');
|
var summary = $('select[name="firmware_version"] option:selected').data('summary');
|
||||||
if (summary) { // undefined while list is loading or while running offline
|
if (summary) { // undefined while list is loading or while running offline
|
||||||
|
if (isConfigLocal && FirmwareCache.has(summary)) {
|
||||||
|
// Load the .hex from Cache if available when the user is providing their own config.
|
||||||
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'cache');
|
||||||
|
FirmwareCache.get(summary, cached => {
|
||||||
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, summary.file);
|
||||||
|
console.info("Release found in cache: " + summary.file);
|
||||||
|
onLoadSuccess(cached.hexdata, summary);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, summary.file);
|
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, summary.file);
|
||||||
$("a.load_remote_file").text(i18n.getMessage('firmwareFlasherButtonDownloading'));
|
$("a.load_remote_file").text(i18n.getMessage('firmwareFlasherButtonDownloading'));
|
||||||
$("a.load_remote_file").addClass('disabled');
|
$("a.load_remote_file").addClass('disabled');
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
href="#" target="_blank"></a><br /> <strong i18n="firmwareFlasherReleaseFile"></strong> <a
|
href="#" target="_blank"></a><br /> <strong i18n="firmwareFlasherReleaseFile"></strong> <a
|
||||||
i18n_title="firmwareFlasherReleaseFileUrl" class="file" href="#" target="_blank"></a><br /> <strong
|
i18n_title="firmwareFlasherReleaseFileUrl" class="file" href="#" target="_blank"></a><br /> <strong
|
||||||
i18n="firmwareFlasherReleaseDate"></strong> <span class="date"></span><br /> <strong
|
i18n="firmwareFlasherReleaseDate"></strong> <span class="date"></span><br /> <strong
|
||||||
i18n="firmwareFlasherReleaseStatus"></strong> <span class="status"></span><br /> <strong
|
|
||||||
i18n="firmwareFlasherReleaseNotes"></strong>
|
i18n="firmwareFlasherReleaseNotes"></strong>
|
||||||
<div class=notes></div>
|
<div class=notes></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue