Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GPS waiting info margin #3525

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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 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