From 08100bafa80278b7a9c278e29b7eae31298a6489 Mon Sep 17 00:00:00 2001 From: HThuren <99370924+HThuren@users.noreply.github.com> Date: Tue, 4 Apr 2023 16:04:48 +0200 Subject: [PATCH] More info on setup tab 2 (#3385) * add help and minor layout changes * add help and minor layout changes * add help and minor layout changes * Fix layout * add disable / enable logic * small changes --- locales/en/messages.json | 28 +++++++++++++++++--- src/css/main.less | 56 ++++++++++++++++++++++++++++++++++------ src/js/tabs/setup.js | 46 +++++++++++++++++++-------------- src/tabs/setup.html | 4 +++ 4 files changed, 103 insertions(+), 31 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 6680cd1e..1e141026 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -867,6 +867,10 @@ "initialSetupInfoHead": { "message": "System info" }, + "initialSetupInfoHeadHelp": { + "message": "Shows FC flags for disarming, Battery information, RSSI level and Sensors hardware", + "description": "Message that pops up to describe the System info section" + }, "initialSetupBattery": { "message": "Battery voltage:" }, @@ -1014,32 +1018,50 @@ "initialSetupGPSHead": { "message": "GPS" }, + "initialSetupGPSHeadHelp": { + "message": "Shows GPS info, if proper activated in Ports tab, Configuration Tab and GPS tab", + "description": "Message that pops up to describe the GPS section" + }, "initialSetupInstrumentsHead": { "message": "Instruments" }, + "initialSetupInstrumentsHeadHelp": { + "message": "Shows Heading, Pitch and Roll in instruments", + "description": "Message that pops up to describe the Instruments section" + }, "initialSetupInfoAPIversion": { "message": "MSP API:" }, "initialSetupInfoBuild": { "message": "Firmware info" }, + "initialSetupInfoBuildHelp": { + "message": "Shows information regarding the build of firmware. The Build Config and Bulid Log links to the cloud information found by the Build key", + "description": "Message that pops up to describe the Build / Firmware section" + }, "initialSetupInfoBuildDate": { "message": "Build date:" }, "initialSetupInfoBuildInfo": { "message": "Build info:" }, + "initialSetupInfoBuildInfoKey": { + "message": "Build key" + }, "initialSetupInfoBuildInfoConfig": { - "message": "Build config" + "message": "Config" }, "initialSetupInfoBuildInfoLog": { - "message": "Build log" + "message": "Log" }, "initialSetupInfoBuildOptions": { "message": "Build Options:" }, + "initialSetupInfoBuildOptionsList": { + "message": "Defines used" + }, "initialSetupInfoBuildOptionsEmpty": { - "message": "Local Build - no Defines" + "message": "Local Build - no Defines used" }, "initialSetupButtonSave": { "message": "Save" diff --git a/src/css/main.less b/src/css/main.less index 723948c7..2f8a0a5e 100644 --- a/src/css/main.less +++ b/src/css/main.less @@ -628,7 +628,7 @@ input[type="number"] { transition: none; background-image: url(../images/icons/cf_icon_link_grey.svg); } -.armedicon.active { +.armedicon.active {user-select background-image: url(../images/icons/cf_icon_armed_active.svg); } .failsafeicon.active { @@ -1498,7 +1498,6 @@ dialog { color: var(--pushedButton-fontColor); border-radius: 3px; } - .danger-button { -webkit-user-drag: none; margin-top: 8px; @@ -1526,7 +1525,6 @@ dialog { color: #fff; border-radius: 3px; } - .small { width: auto; position: relative; @@ -1731,11 +1729,53 @@ dialog { color: #fff; font-size: 10px; } -.buildKeyInfoClass { - background-color: #ffcc3f; - padding: 2px 5px; - border-radius: 3px; - color: #272727; +.buildInfoBtn { + position: relative; + margin-bottom: 0px; + margin-top: 3px; + margin: 4px; + float: right; + a { + padding: 2px 5px 2px 5px; + text-align: center; + background-color: var(--accent); + border-radius: 4px; + border: 1px solid #dba718; + color: #000; + font-weight: 600; + font-size: 10px; + line-height: 11px; + display: block; + transition: all ease 0.2s; + text-decoration: none; + cursor: pointer; + &:hover { + background-color: var(--hoverButton-background); + color: #000; + text-shadow: 0 1px rgba(255, 255, 255, 0.25); + transition: all ease 0.2s; + text-decoration: none; + } + &:active { + background-color: var(--hoverButton-background); + transition: all ease 0.0s; + box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.35); + } + } + a.disabled { + background-color: #f1f1f1; + border: 1px solid var(--subtleAccent); + color: #ccc; + } +} +.buildInfoClassOptions { + margin-bottom: 0px; + margin-top: 3px; + float: right; + background-color: grey; + padding: 2px 5px 2px 5px; + border-radius: 4px; + color: #fff; font-size: 10px; } .cf_tooltiptext { diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index f0855b1b..55beb615 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -338,28 +338,34 @@ setup.initialize = function (callback) { }; const showFirmwareInfo = function() { - MSP.send_message(MSPCodes.MSP_STATUS_EX, false, false, function() { - // Firmware info - msp_api_e.text([FC.CONFIG.apiVersion]); - build_date_e.text([FC.CONFIG.buildInfo]); - if(FC.CONFIG.buildInfo.length > 0) { - const buildRoot = `https://build.betaflight.com/api/builds/${FC.CONFIG.buildKey}`; - const buildConfig = ` - ${i18n.getMessage('initialSetupInfoBuildInfoConfig')}`; - const buildLog = ` - ${i18n.getMessage('initialSetupInfoBuildInfoLog')}`; - build_info_e.html(`${buildConfig}   ${buildLog}`); - } + // Firmware info + msp_api_e.text([FC.CONFIG.apiVersion]); + build_date_e.text([FC.CONFIG.buildInfo]); - if(FC.CONFIG.buildOptions.length > 0) { - build_opt_e.text = ""; - for (const buildOption of FC.CONFIG.buildOptions) { - build_opt_e.append(buildOption, ' '); - } - } else { - build_opt_e.text(i18n.getMessage('initialSetupInfoBuildOptionsEmpty')); + if (FC.CONFIG.buildKey.length > 1) { + const buildRoot = `https://build.betaflight.com/api/builds/${FC.CONFIG.buildKey}`; + const buildConfig = ` + ${i18n.getMessage('initialSetupInfoBuildInfoConfig')}`; + const buildLog = ` + ${i18n.getMessage('initialSetupInfoBuildInfoLog')}`; + build_info_e.html(`${buildConfig}     ${buildLog}`); + $('.build-info a').removeClass('disabled'); + } else { + $('.build-info a').addClass('disabled'); + } + + if (FC.CONFIG.buildOptions.length > 0) { + let buildOptions = ""; + build_opt_e.text = ""; + for (const buildOption of FC.CONFIG.buildOptions) { + buildOptions = `${buildOptions}   ${buildOption}`; } - }); + build_opt_e.html(` + ${i18n.getMessage('initialSetupInfoBuildOptionsList')}`); + } else { + build_opt_e.html(i18n.getMessage('initialSetupInfoBuildOptionsEmpty')); + } }; prepareDisarmFlags(); diff --git a/src/tabs/setup.html b/src/tabs/setup.html index 5c41ffd5..00aa99d8 100644 --- a/src/tabs/setup.html +++ b/src/tabs/setup.html @@ -91,6 +91,7 @@