mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Merge pull request #697 from wind0r/add_firmware_to_topbar
add firmware version to top bar
This commit is contained in:
commit
0b1a8b0bcc
3 changed files with 70 additions and 53 deletions
|
@ -215,6 +215,7 @@ function onOpen(openInfo) {
|
|||
|
||||
GUI.log(chrome.i18n.getMessage('fcInfoReceived', [CONFIG.flightControllerIdentifier, CONFIG.flightControllerVersion]));
|
||||
updateStatusBarVersion(CONFIG.flightControllerVersion, CONFIG.flightControllerIdentifier);
|
||||
updateTopBarVersion(CONFIG.flightControllerVersion, CONFIG.flightControllerIdentifier);
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_BUILD_INFO, false, false, function () {
|
||||
|
||||
|
@ -224,6 +225,7 @@ function onOpen(openInfo) {
|
|||
|
||||
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
||||
updateStatusBarVersion(CONFIG.flightControllerVersion, CONFIG.flightControllerIdentifier, CONFIG.boardIdentifier);
|
||||
updateTopBarVersion(CONFIG.flightControllerVersion, CONFIG.flightControllerIdentifier, CONFIG.boardIdentifier);
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_UID, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
||||
|
@ -369,6 +371,7 @@ function onClosed(result) {
|
|||
$('#tabs ul.mode-disconnected').show();
|
||||
|
||||
updateStatusBarVersion();
|
||||
updateTopBarVersion();
|
||||
|
||||
var sensor_state = $('#sensor-status');
|
||||
sensor_state.hide();
|
||||
|
|
2
main.css
2
main.css
|
@ -134,7 +134,7 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
.logo_text {
|
||||
position: absolute;
|
||||
height: 20px;
|
||||
width: 125px;
|
||||
width: 200px;
|
||||
left: 80px;
|
||||
top: 50px;
|
||||
color: #949494;
|
||||
|
|
14
main.js
14
main.js
|
@ -11,6 +11,7 @@ $(document).ready(function () {
|
|||
|
||||
$('#logo .version').text(chrome.runtime.getManifest().version);
|
||||
updateStatusBarVersion();
|
||||
updateTopBarVersion();
|
||||
|
||||
// notification messages for various operating systems
|
||||
switch (GUI.operating_system) {
|
||||
|
@ -517,6 +518,19 @@ function generateFilename(prefix, suffix) {
|
|||
return filename + '.' + suffix;
|
||||
}
|
||||
|
||||
function updateTopBarVersion(firmwareVersion, firmwareId, hardwareId) {
|
||||
var versionText = chrome.i18n.getMessage('versionLabelConfigurator') + ': ' + chrome.runtime.getManifest().version + '<br />';
|
||||
|
||||
if (firmwareVersion) {
|
||||
versionText += chrome.i18n.getMessage('versionLabelFirmware') + ': ' + firmwareId + ' ' + firmwareVersion;
|
||||
if (hardwareId) {
|
||||
versionText += ' (Target: ' + hardwareId + ')';
|
||||
}
|
||||
}
|
||||
|
||||
$('#logo .logo_text').html(versionText);
|
||||
}
|
||||
|
||||
function updateStatusBarVersion(firmwareVersion, firmwareId, hardwareId) {
|
||||
var versionText = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue