Revert "added caching for betaflight releases in the firmware flasher"
This reverts commit 27e8dcc963
.
10.3.x-maintenance
parent
517dbca0f0
commit
9fe4a6bb5d
|
@ -1408,9 +1408,6 @@
|
|||
"firmwareFlasherButtonLoadOnline": {
|
||||
"message": "Load Firmware [Online]"
|
||||
},
|
||||
"firmwareFlasherButtonUpdateReleasesList": {
|
||||
"message": "Force Releases update"
|
||||
},
|
||||
"firmwareFlasherFlashFirmware": {
|
||||
"message": "Flash Firmware"
|
||||
},
|
||||
|
@ -1546,17 +1543,32 @@
|
|||
"pidTuningGps": {
|
||||
"message": "GPS Navigation"
|
||||
},
|
||||
"pidTuningLevelP": {
|
||||
"message": "Strength (Angle)"
|
||||
"pidTuningStrength": {
|
||||
"message": "Strength"
|
||||
},
|
||||
"pidTuningLevelI": {
|
||||
"message": "Strength (Horizon)"
|
||||
"pidTuningTransition": {
|
||||
"message": "Transition"
|
||||
},
|
||||
"pidTuningLevelD": {
|
||||
"message": "Transition (Horizon)"
|
||||
"pidTuningHorizon": {
|
||||
"message": "Horizon"
|
||||
},
|
||||
"pidTuningAngle": {
|
||||
"message": "Angle"
|
||||
},
|
||||
"pidTuningLevelHelp": {
|
||||
"message": "The values below change the behaviour of the ANGLE and HORIZON flight modes. Different PID controllers handle the LEVEL values differently. Please check the documentation."
|
||||
"message": "The values below change the behaviour of the ANGLE and HORIZON flight modes. Different PID controllers handle the values differently. Please check the documentation."
|
||||
},
|
||||
"pidTuningLfpFilters": {
|
||||
"message": "LFP Filters"
|
||||
},
|
||||
"pidTuningGyro": {
|
||||
"message": "Gyro Soft (Hz)"
|
||||
},
|
||||
"pidTuningDTerm": {
|
||||
"message": "D Term (Hz)"
|
||||
},
|
||||
"pidTuningYaw": {
|
||||
"message": "Yaw (Hz)"
|
||||
},
|
||||
"configHelp2": {
|
||||
"message": "Arbitrary board rotation in degrees, to allow mounting it sideways / upside down / rotated etc. When running external sensors, use the sensor alignments (Gyro, Acc, Mag) to define sensor position independent from board orientation. "
|
||||
|
@ -1679,11 +1691,11 @@
|
|||
"message": "Magnetometer (if supported)"
|
||||
},
|
||||
"PIDTip": {
|
||||
"message": "<strong><i>Derivative from Error</i></strong> provides more direct stick response and is mostly prefered for Racing.<br><strong><i>Derivative from Measurement</i></strong> provides smoother stick response what is more usefull for freestyling"
|
||||
}
|
||||
|
||||
|
||||
|
||||
"message": "<b>Derivative from Error</b> provides more direct stick response and is mostly prefered for Racing.<br><br><b>Derivative from Measurement</b> provides smoother stick response what is more usefull for freestyling"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,12 +7,7 @@
|
|||
<td><select name="release">
|
||||
<option value="0">Loading ...</option>
|
||||
</select></td>
|
||||
<td>
|
||||
<span class="description" i18n="firmwareFlasherOnlineReleasesDescription"></span>
|
||||
<div class="btn">
|
||||
<a class="updateReleasesList" href="#" i18n="firmwareFlasherButtonUpdateReleasesList"></a>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="description" i18n="firmwareFlasherOnlineReleasesDescription"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label> <input class="updating toggle" type="checkbox" /> <span
|
||||
|
@ -23,7 +18,7 @@
|
|||
<tr class="option flash_on_connect_wrapper">
|
||||
<td><label> <input class="flash_on_connect toggle" type="checkbox" /> <span
|
||||
i18n="firmwareFlasherFlashOnConnect"></span></label></td>
|
||||
|
||||
|
||||
<td><span class="description" i18n="firmwareFlasherFlashOnConnectDescription"></span></td>
|
||||
</tr>
|
||||
<tr class="option">
|
||||
|
@ -106,7 +101,7 @@
|
|||
<p i18n="firmwareFlasherRecoveryText"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="info"><a name="progressbar"></a>
|
||||
<progress class="progress" value="0" min="0" max="100"></progress>
|
||||
<span class="progressLabel" i18n="firmwareFlasherLoadFirmwareFile"></span>
|
||||
|
@ -123,4 +118,4 @@
|
|||
<a class="flash_firmware disabled" href="#progressbar" i18n="firmwareFlasherFlashFirmware"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -134,57 +134,29 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
})
|
||||
};
|
||||
|
||||
var updateReleases = function (){
|
||||
$.get('https://api.github.com/repos/betaflight/betaflight/releases', function (releases){
|
||||
processReleases(releases);
|
||||
updateReleasesList(releases);
|
||||
$.get('https://api.github.com/repos/betaflight/betaflight/releases', function (releases){
|
||||
processReleases(releases);
|
||||
TABS.firmware_flasher.releases = releases;
|
||||
|
||||
chrome.storage.local.set({'releases': releases, 'lastReleasesSync': Date()}, function() {
|
||||
console.log('Releases saved');
|
||||
});
|
||||
// bind events
|
||||
$('select[name="release"]').change(function() {
|
||||
if (!GUI.connect_lock) {
|
||||
$('.progress').val(0).removeClass('valid invalid');
|
||||
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherLoadFirmwareFile'));
|
||||
$('div.git_info').slideUp();
|
||||
$('div.release_info').slideUp();
|
||||
$('a.flash_firmware').addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
}).fail(function (data){
|
||||
if (data["responseJSON"]){
|
||||
GUI.log("<b>GITHUB Query Failed: <code>{0}</code></b>".format(data["responseJSON"].message));
|
||||
}
|
||||
$('select[name="release"]').empty().append('<option value="0">Offline</option>');
|
||||
});
|
||||
};
|
||||
|
||||
var updateReleasesList = function(releases){
|
||||
TABS.firmware_flasher.releases = releases;
|
||||
|
||||
// bind events
|
||||
$('select[name="release"]').change(function() {
|
||||
if (!GUI.connect_lock) {
|
||||
$('.progress').val(0).removeClass('valid invalid');
|
||||
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherLoadFirmwareFile'));
|
||||
$('div.git_info').slideUp();
|
||||
$('div.release_info').slideUp();
|
||||
$('a.flash_firmware').addClass('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chrome.storage.local.get('lastReleasesSync', function (result) {
|
||||
// calculate time between last online sync and now
|
||||
var lastReleasesSync = new Date(result.lastReleasesSync);
|
||||
var currentDate = new Date();
|
||||
var timeDiff = Math.abs(currentDate.getTime() - lastReleasesSync.getTime());
|
||||
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
|
||||
console.log(result.lastReleasesSync);
|
||||
if(diffDays > 1) {
|
||||
console.log("Last sync older than one day, updating releases");
|
||||
updateReleases();
|
||||
} else {
|
||||
console.log("Last sync younger than one day, using stored releases");
|
||||
chrome.storage.local.get('releases', function (result) {
|
||||
updateReleasesList(result.releases);
|
||||
buildFirmwareOptions();
|
||||
});
|
||||
}).fail(function (data){
|
||||
if (data["responseJSON"]){
|
||||
GUI.log("<b>GITHUB Query Failed: <code>{0}</code></b>".format(data["responseJSON"].message));
|
||||
}
|
||||
$('select[name="release"]').empty().append('<option value="0">Offline</option>');
|
||||
});
|
||||
|
||||
|
||||
// UI Hooks
|
||||
$('a.load_file').click(function () {
|
||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['hex']}]}, function (fileEntry) {
|
||||
|
@ -384,10 +356,6 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
}
|
||||
});
|
||||
|
||||
$('a.updateReleasesList').click(function() {
|
||||
updateReleases();
|
||||
});
|
||||
|
||||
$(document).on('click', 'span.progressLabel a.save_firmware', function () {
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{extensions: ['hex']}]}, function (fileEntry) {
|
||||
if (chrome.runtime.lastError) {
|
||||
|
|
Loading…
Reference in New Issue