Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1183,20 +1183,29 @@
"initialSetupInfoBuildConfig": {
"message": "Config"
},
"initialSetupInfoBuildDownload": {
"message": "Download"
},
"initialSetupInfoBuildFirmware": {
"message": "Firmware:"
},
"initialSetupInfoBuildLog": {
"message": "Log"
},
"initialSetupInfoBuildOptions": {
"message": "Options"
},
"initialSetupInfoBuildOptionsLabel": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no standard I saw for label vs. content, so I appended "Label" here because the plain "Options" string is used elsewhere.

"message": "Options:"
},
"initialSetupInfoBuildOptionList": {
"message": "Options defined in firmware build"
},
"initialSetupInfoBuildEmpty": {
"message": "Local Build - no Cloud information"
},
"initialSetupInfoBuildType": {
"message": "Build type"
"message": "Build type:"
},
"initialSetupInfoBuildLocal": {
"message": "Local Build"
Expand Down
29 changes: 20 additions & 9 deletions src/js/tabs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ setup.initialize = function (callback) {
build_date_e = $(".build-date"),
build_type_e = $(".build-type"),
build_info_e = $(".build-info"),
build_firmware_e = $(".build-firmware"),
build_options_e = $(".build-options");

// DISARM FLAGS
Expand Down Expand Up @@ -369,29 +370,39 @@ setup.initialize = function (callback) {

if (supported && ispConnected()) {
const buildRoot = `https://build.betaflight.com/api/builds/${FC.CONFIG.buildKey}`;

const buildConfig = `<span class="buildInfoBtn" title="${i18n.getMessage(
"initialSetupInfoBuildConfig",
)}: ${buildRoot}/json">
<a href="${buildRoot}/json" target="_blank"><strong>${i18n.getMessage(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask me how much I like prettier some day... ;)

<a href="${buildRoot}/json" target="_blank"><strong>${i18n.getMessage(
"initialSetupInfoBuildConfig",
)}</strong></a></span>`;

const buildLog = `<span class="buildInfoBtn" title="${i18n.getMessage(
"initialSetupInfoBuildLog",
)}: ${buildRoot}/log">
<a href="${buildRoot}/log" target="_blank"><strong>${i18n.getMessage(
<a href="${buildRoot}/log" target="_blank"><strong>${i18n.getMessage(
"initialSetupInfoBuildLog",
)}</strong></a></span>`;
build_info_e.html(`<span class="buildInfoBtn" title="${i18n.getMessage(
"initialSetupInfoBuildOptions",
)}">
<a class="buildOptions" href=#"><strong>${i18n.getMessage(
"initialSetupInfoBuildOptionList",
)}</strong></a></span>`);

build_info_e.html(`${buildConfig} ${buildLog}`);

const buildDownload = `<span class="buildInfoBtn" title="${i18n.getMessage(
"initialSetupInfoBuildDownload",
)}: ${buildRoot}/hex">
<a href="${buildRoot}/hex" target="_blank"><strong>${i18n.getMessage(
"initialSetupInfoBuildDownload",
)}</strong></a></span>`;

build_firmware_e.html(buildDownload);
} else {
build_info_e.html(
supported ? i18n.getMessage("initialSetupNotOnline") : i18n.getMessage("initialSetupNoBuildInfo"),
);

build_firmware_e.html(
supported ? i18n.getMessage("initialSetupNotOnline") : i18n.getMessage("initialSetupNoBuildInfo"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bit of code and UI duplication here. The UI duplication seemed fine and I didn't know what else to put. The code duplication could be refactored to assign and reuse the ternary instead of duplicating it. This seemed clearer at no real cost.

);
}
};

Expand All @@ -418,7 +429,7 @@ setup.initialize = function (callback) {
const buildOptions = `<span class="buildInfoBtn" title="${i18n.getMessage(
"initialSetupInfoBuildOptionList",
)}">
<a class="buildOptions" href=#"><strong>${i18n.getMessage(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure consistency change, this matches the formatting 7 lines above. I think prettier should have made this itself.

<a class="buildOptions" href=#"><strong>${i18n.getMessage(
"initialSetupInfoBuildOptions",
)}</strong></a></span>`;

Expand Down
11 changes: 7 additions & 4 deletions src/tabs/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,24 @@
<td id="api-version" i18n="initialSetupInfoAPIversion"></td>
<td class="api-version"></td>
</tr>
<tr>
<tr>
<td id="build-date" i18n="initialSetupInfoBuildDate"></td>
<td class="build-date"></td>
</tr>
<tr>
<td id="build-type" i18n="initialSetupInfoBuildType"></td>
<td class="build-type"></td>
</tr>
</tr>
<tr>
<tr>
<td id="build-info" i18n="initialSetupInfoBuildInfo"></td>
<td class="build-info"></td>
</tr>
<tr>
<td id="build-options" i18n="initialSetupInfoBuildOptions"></td>
<td id="build-firmware" i18n="initialSetupInfoBuildFirmware"></td>
<td class="build-firmware"></td>
</tr>
<tr>
<td id="build-options" i18n="initialSetupInfoBuildOptionsLabel"></td>
<td class="build-options"></td>
</tr>
</tbody>
Expand Down