Show serial number next to Anker device name on the monitor page
This commit is contained in:
@@ -1114,6 +1114,11 @@ function nameCell(d, kind, cls) {
|
|||||||
return '<span class="' + classes.trim() + '"' + attrs + '>' + esc(d.name) + '</span>';
|
return '<span class="' + classes.trim() + '"' + attrs + '>' + esc(d.name) + '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serialTag(d) {
|
||||||
|
if (!d.serial) return '';
|
||||||
|
return '<span class="device-meta">(' + esc(d.serial) + ')</span>';
|
||||||
|
}
|
||||||
|
|
||||||
function startEdit(span) {
|
function startEdit(span) {
|
||||||
if (span.dataset.editing) return;
|
if (span.dataset.editing) return;
|
||||||
span.dataset.editing = '1';
|
span.dataset.editing = '1';
|
||||||
@@ -1226,6 +1231,7 @@ function renderAnker(devices) {
|
|||||||
if (!d.live) {
|
if (!d.live) {
|
||||||
return '<div class="device"><div class="device-head">'
|
return '<div class="device"><div class="device-head">'
|
||||||
+ nameCell(d, 'anker', 'device-name')
|
+ nameCell(d, 'anker', 'device-name')
|
||||||
|
+ serialTag(d)
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<p class="empty">No live readings. Live data comes from a running '
|
+ '<p class="empty">No live readings. Live data comes from a running '
|
||||||
+ 'automation.<br>Start one with <b>solixauto service <profile></b>.</p></div>';
|
+ 'automation.<br>Start one with <b>solixauto service <profile></b>.</p></div>';
|
||||||
@@ -1233,6 +1239,7 @@ function renderAnker(devices) {
|
|||||||
return '<div class="device">'
|
return '<div class="device">'
|
||||||
+ '<div class="device-head">'
|
+ '<div class="device-head">'
|
||||||
+ nameCell(d, 'anker', 'device-name')
|
+ nameCell(d, 'anker', 'device-name')
|
||||||
|
+ serialTag(d)
|
||||||
+ (d.floor_latched ? '<span class="pill unknown">FLOOR LATCHED</span>' : '')
|
+ (d.floor_latched ? '<span class="pill unknown">FLOOR LATCHED</span>' : '')
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="readouts">'
|
+ '<div class="readouts">'
|
||||||
|
|||||||
Reference in New Issue
Block a user