Skip to content

Commit

Permalink
Fix GPS waiting info margin (#3525)
Browse files Browse the repository at this point in the history
* Fix GPS waiting info margin

* Add colors to GPS Signal Strenght info
  • Loading branch information
haslinghuis authored Jul 23, 2023
1 parent 4c54f3c commit d1cb74e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/css/tabs/gps.less
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
float: left;
width: 100%;
.info {
margin-top: 50%;
margin-top: 30%;
}
}
#loadmap {
Expand Down Expand Up @@ -212,6 +212,15 @@ progress[value] {
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.25) inset;
}
}
@media only screen and (max-width: 1455px) {
.tab-gps {
#waiting {
.info {
margin-top: 50%;
}
}
}
}
@media only screen and (max-width: 1055px) {
.tab-gps {
iframe {
Expand Down
27 changes: 24 additions & 3 deletions src/js/tabs/gps.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,30 @@ gps.initialize = async function (callback) {
} else {
rowContent += `<td>${FC.GPS_DATA.svid[i]}</td>`;
rowContent += `<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>`;
const quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
const used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);
const healthy = i18n.getMessage(healthyArray[(FC.GPS_DATA.quality[i] & 0x30) >> 4]);

let quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
let used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);
let healthy = i18n.getMessage(healthyArray[(FC.GPS_DATA.quality[i] & 0x30) >> 4]);

// Add color to the text
if (quality.startsWith('fully locked')) {
quality = `<span class="colorToggle ready">${quality}</span>`;
} else {
quality = `<span class="colorToggle">${quality}</span>`;
}

if (used.startsWith('used')) {
used = `<span class="colorToggle ready">${used}</span>`;
} else {
used = `<span class="colorToggle">${used}</span>`;
}

if (healthy.startsWith('healthy')) {
healthy = `<span class="colorToggle ready">${healthy}</span>`;
} else {
healthy = `<span class="colorToggle">${healthy}</span>`;
}

rowContent += `<td>${quality} | ${used} | ${healthy}</td>`;
}
eSsTable.append(`<tr>${rowContent}</tr>`);
Expand Down

0 comments on commit d1cb74e

Please sign in to comment.