Skip to content

Commit d1cb74e

Browse files
authored
Fix GPS waiting info margin (#3525)
* Fix GPS waiting info margin * Add colors to GPS Signal Strenght info
1 parent 4c54f3c commit d1cb74e

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

src/css/tabs/gps.less

+10-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
float: left;
140140
width: 100%;
141141
.info {
142-
margin-top: 50%;
142+
margin-top: 30%;
143143
}
144144
}
145145
#loadmap {
@@ -212,6 +212,15 @@ progress[value] {
212212
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.25) inset;
213213
}
214214
}
215+
@media only screen and (max-width: 1455px) {
216+
.tab-gps {
217+
#waiting {
218+
.info {
219+
margin-top: 50%;
220+
}
221+
}
222+
}
223+
}
215224
@media only screen and (max-width: 1055px) {
216225
.tab-gps {
217226
iframe {

src/js/tabs/gps.js

+24-3
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,30 @@ gps.initialize = async function (callback) {
259259
} else {
260260
rowContent += `<td>${FC.GPS_DATA.svid[i]}</td>`;
261261
rowContent += `<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>`;
262-
const quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
263-
const used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);
264-
const healthy = i18n.getMessage(healthyArray[(FC.GPS_DATA.quality[i] & 0x30) >> 4]);
262+
263+
let quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
264+
let used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);
265+
let healthy = i18n.getMessage(healthyArray[(FC.GPS_DATA.quality[i] & 0x30) >> 4]);
266+
267+
// Add color to the text
268+
if (quality.startsWith('fully locked')) {
269+
quality = `<span class="colorToggle ready">${quality}</span>`;
270+
} else {
271+
quality = `<span class="colorToggle">${quality}</span>`;
272+
}
273+
274+
if (used.startsWith('used')) {
275+
used = `<span class="colorToggle ready">${used}</span>`;
276+
} else {
277+
used = `<span class="colorToggle">${used}</span>`;
278+
}
279+
280+
if (healthy.startsWith('healthy')) {
281+
healthy = `<span class="colorToggle ready">${healthy}</span>`;
282+
} else {
283+
healthy = `<span class="colorToggle">${healthy}</span>`;
284+
}
285+
265286
rowContent += `<td>${quality} | ${used} | ${healthy}</td>`;
266287
}
267288
eSsTable.append(`<tr>${rowContent}</tr>`);

0 commit comments

Comments
 (0)