From 05601e0adb441d37506baf7018c317c6892527c6 Mon Sep 17 00:00:00 2001 From: inportb Date: Sat, 24 Sep 2022 14:32:11 -0400 Subject: [PATCH] Promote single-line comments --- htdocs/ViewData.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ViewData.vue b/htdocs/ViewData.vue index 6868137..495751d 100644 --- a/htdocs/ViewData.vue +++ b/htdocs/ViewData.vue @@ -179,9 +179,9 @@ group = group.values.reduce(((acc, x) => ((acc.values[x.name] || (acc.values[x.name] = [])).push(x), acc)), { key: group.key, datehdr: date_header(group.key), values: {}}); for(var k in group.values) if(group.values.hasOwnProperty(k)) { var items = group.values[k].sort((a, b) => a.time - b.time); - var strings = items.map(item => item.time.toLocaleTimeString('en-GB') + ' • ' + item.value + (item.unit ? ' ' + item.unit : '') + (item.flag ? ' [' + item.flag + ']' : '')); + var strings = items.map(item => item.time.toLocaleTimeString('en-GB') + ' • ' + item.value + (item.unit ? ' ' + item.unit : '') + (item.flag ? ' [' + item.flag + ']' : '') + (item.comment && item.comment.indexOf('\n') < 0 ? ' • ' + item.comment : '')); var flags = uniq(items.map(item => item.flag).filter(x => x).map(x => x.charAt(0))); - var comments = uniq(items.map(item => item.comment).filter(x => x)); + var comments = uniq(items.map(item => item.comment).filter(x => x && x.indexOf('\n') >= 0)); var numbers = uniq(items.map(item => item.value).filter(x => isNumeric(x))); var min = Math.min.apply(null, numbers); var max = Math.max.apply(null, numbers);