diff --git a/locales/en/messages.json b/locales/en/messages.json index dadb73d390d..2768576ae67 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1119,6 +1119,18 @@ "initialSetupInfoBuildEmpty": { "message": "Local Build - no Cloud information" }, + "initialSetupInfoBuildType": { + "message": "Build type" + }, + "initialSetupInfoBuildLocal": { + "message": "Local Build" + }, + "initialSetupInfoBuildCloud": { + "message": "Cloud Build" + }, + "initialSetupNoBuildInfo": { + "message": "No build information available" + }, "initialSetupNotOnline": { "message": "Server unavailable" }, diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index 328508887e1..5e0d806e304 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -9,7 +9,7 @@ import FC from '../fc'; import MSP from '../msp'; import Model from '../model'; import MSPCodes from '../msp/MSPCodes'; -import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_46 } from '../data_storage'; +import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_45, API_VERSION_1_46 } from '../data_storage'; import { gui_log } from '../gui_log'; import $ from 'jquery'; @@ -223,7 +223,9 @@ setup.initialize = function (callback) { // Firmware info msp_api_e = $('.api-version'), build_date_e = $('.build-date'), - build_info_e = $('.build-info'); + build_type_e = $('.build-type'), + build_info_e = $('.build-info'), + build_options_e = $('.build-options'); // DISARM FLAGS // We add all the arming/disarming flags available, and show/hide them if needed. @@ -445,50 +447,62 @@ setup.initialize = function (callback) { } } - const showFirmwareInfo = function() { - // Firmware info - msp_api_e.text([FC.CONFIG.apiVersion]); - build_date_e.text([FC.CONFIG.buildInfo]); + const showBuildInfo = function() { + const supported = FC.CONFIG.buildKey.length === 32; + + if (supported && navigator.onLine) { + const buildRoot = `https://build.betaflight.com/api/builds/${FC.CONFIG.buildKey}`; + const buildConfig = ` + ${i18n.getMessage('initialSetupInfoBuildConfig')}`; + const buildLog = ` + ${i18n.getMessage('initialSetupInfoBuildLog')}`; + build_info_e.html(` + ${i18n.getMessage('initialSetupInfoBuildOptionList')}`); + build_info_e.html(`${buildConfig} ${buildLog}`); + } else { + build_info_e.html(supported ? i18n.getMessage('initialSetupNotOnline') : i18n.getMessage('initialSetupNoBuildInfo')); + } + }; - if (navigator.onLine) { - let buildOptionList = ""; + const showBuildOptions = function() { + const supported = (semver.eq(FC.CONFIG.apiVersion, API_VERSION_1_45) && navigator.onLine || semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) && FC.CONFIG.buildOptions.length; - if (FC.CONFIG.buildOptions.length) { - buildOptionList = `