mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 06:15:13 +03:00
chore: add prefer template rule
This commit is contained in:
parent
27b3afbca7
commit
8cf9473c88
36 changed files with 277 additions and 276 deletions
|
@ -789,17 +789,17 @@ function bit_clear(num, bit) {
|
|||
function update_dataflash_global() {
|
||||
function formatFilesize(bytes) {
|
||||
if (bytes < 1024) {
|
||||
return bytes + "B";
|
||||
return `${bytes }B`;
|
||||
}
|
||||
const kilobytes = bytes / 1024;
|
||||
|
||||
if (kilobytes < 1024) {
|
||||
return Math.round(kilobytes) + "kB";
|
||||
return `${Math.round(kilobytes) }kB`;
|
||||
}
|
||||
|
||||
const megabytes = kilobytes / 1024;
|
||||
|
||||
return megabytes.toFixed(1) + "MB";
|
||||
return `${megabytes.toFixed(1) }MB`;
|
||||
}
|
||||
|
||||
const supportsDataflash = FC.DATAFLASH.totalSize > 0;
|
||||
|
@ -814,10 +814,10 @@ function update_dataflash_global() {
|
|||
});
|
||||
|
||||
$(".dataflash-free_global").css({
|
||||
width: (100-(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize) / FC.DATAFLASH.totalSize * 100) + "%",
|
||||
width: `${100-(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize) / FC.DATAFLASH.totalSize * 100}%`,
|
||||
display: 'block',
|
||||
});
|
||||
$(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize));
|
||||
$(".dataflash-free_global div").text(`Dataflash: free ${ formatFilesize(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize)}`);
|
||||
} else {
|
||||
$(".noflash_global").css({
|
||||
display: 'block',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue