fix: dashcam mobile shows filename, RPM/fuel/throttle don't append unit when disconnected
- yaris.css: split mobile rules by list ID — video-list shows thumb+actions, dashcam-file-list shows dash-col-file+actions; thead display:none !important - yaris.js: check data !== '-' before appending rpm/°C/% units so disconnected state shows — instead of '- rpm' Co-authored-by: Copilot <[email protected]>
This commit is contained in:
+4
-4
@@ -161,22 +161,22 @@ socket.on('obd_speed', function (data) {
|
|||||||
|
|
||||||
socket.on('obd_rpm', function (data) {
|
socket.on('obd_rpm', function (data) {
|
||||||
const el = document.getElementById('obd-rpm');
|
const el = document.getElementById('obd-rpm');
|
||||||
if (el) el.textContent = data != null ? data + ' rpm' : '—';
|
if (el) el.textContent = (data != null && data !== '-') ? data + ' rpm' : '—';
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('obd_coolant_temp', function (data) {
|
socket.on('obd_coolant_temp', function (data) {
|
||||||
const el = document.getElementById('obd-coolant');
|
const el = document.getElementById('obd-coolant');
|
||||||
if (el) el.textContent = data != null ? data + ' °C' : '—';
|
if (el) el.textContent = (data != null && data !== '-') ? data + ' °C' : '—';
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('obd_fuel_level', function (data) {
|
socket.on('obd_fuel_level', function (data) {
|
||||||
const el = document.getElementById('obd-fuel');
|
const el = document.getElementById('obd-fuel');
|
||||||
if (el) el.textContent = data != null ? data + ' %' : '—';
|
if (el) el.textContent = (data != null && data !== '-') ? data + ' %' : '—';
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('obd_throttle', function (data) {
|
socket.on('obd_throttle', function (data) {
|
||||||
const el = document.getElementById('obd-throttle');
|
const el = document.getElementById('obd-throttle');
|
||||||
if (el) el.textContent = data != null ? data + ' %' : '—';
|
if (el) el.textContent = (data != null && data !== '-') ? data + ' %' : '—';
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('obd_error', function (data) {
|
socket.on('obd_error', function (data) {
|
||||||
|
|||||||
+15
-8
@@ -280,7 +280,7 @@ body {
|
|||||||
@media (max-width: 575.98px) {
|
@media (max-width: 575.98px) {
|
||||||
/* Hide table header */
|
/* Hide table header */
|
||||||
#local-video-list thead,
|
#local-video-list thead,
|
||||||
#dashcam-file-list thead { display: none; }
|
#dashcam-file-list thead { display: none !important; }
|
||||||
|
|
||||||
/* Row becomes flex */
|
/* Row becomes flex */
|
||||||
.dash-row { display: flex !important; align-items: center; gap: .5rem;
|
.dash-row { display: flex !important; align-items: center; gap: .5rem;
|
||||||
@@ -289,19 +289,26 @@ body {
|
|||||||
/* Hide all cells by default */
|
/* Hide all cells by default */
|
||||||
.dash-row > td { display: none !important; }
|
.dash-row > td { display: none !important; }
|
||||||
|
|
||||||
/* Show only first cell (thumb or checkbox) and actions */
|
/* local-video-list: show thumb cell + actions */
|
||||||
.dash-row > td:first-child,
|
#local-video-list .dash-row > td:first-child,
|
||||||
.dash-row > .dash-actions-td { display: flex !important; align-items: center; }
|
#local-video-list .dash-row > .dash-actions-td { display: flex !important; align-items: center; }
|
||||||
|
#local-video-list .dash-row > td:first-child { flex: 1; min-width: 0; }
|
||||||
|
|
||||||
/* First cell takes remaining space, no overflow */
|
/* dashcam-file-list: show filename cell + actions (no thumbnail) */
|
||||||
.dash-row > td:first-child { flex: 1; min-width: 0; }
|
#dashcam-file-list .dash-row > .dash-col-file,
|
||||||
|
#dashcam-file-list .dash-row > .dash-actions-td { display: flex !important; align-items: center; }
|
||||||
|
#dashcam-file-list .dash-row > .dash-col-file {
|
||||||
|
flex: 1; min-width: 0;
|
||||||
|
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||||
|
font-size: .8rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Actions never shrink */
|
/* Actions never shrink */
|
||||||
.dash-row > .dash-actions-td { flex-shrink: 0; }
|
.dash-row > .dash-actions-td { flex-shrink: 0; }
|
||||||
|
|
||||||
/* Thumbnail sizing — override any inline style */
|
/* Thumbnail sizing */
|
||||||
.dash-thumb-td { width: 5rem !important; padding: 0.2rem !important; }
|
.dash-thumb-td { width: 5rem !important; padding: 0.2rem !important; }
|
||||||
.local-video-thumbnail { width: 4.5rem !important; }
|
.local-video-thumbnail { width: 4.5rem !important; height: auto !important; }
|
||||||
|
|
||||||
/* Filename under thumbnail */
|
/* Filename under thumbnail */
|
||||||
.dash-thumb-name { display: block !important; font-size: .7rem; margin-top: .2rem; }
|
.dash-thumb-name { display: block !important; font-size: .7rem; margin-top: .2rem; }
|
||||||
|
|||||||
Reference in New Issue
Block a user