From 4cdf56b55691f0dba762e13d3eb28e4465a9a525 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 26 Aug 2021 09:53:51 -0700 Subject: [PATCH] Device tag fixes, #3063 --- views/default-mobile.handlebars | 13 +++++++------ views/default.handlebars | 17 +++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 935ddcc4..51653130 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -1,4 +1,4 @@ - + @@ -3430,11 +3430,11 @@ // Node tags var groupingTags = '' + "None" + ''; - if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '' + EscapeHtml(node.tags[i]) + ''; } } + if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '' + EscapeHtml(node.tags[i]) + ' '; } } if ((meshrights & 4) != 0) { - x += addDeviceAttribute("Tags", '' + groupingTags + ''); + x += addDeviceAttribute("Tags", '' + groupingTags + ''); } else { - x += addDeviceAttribute("Tags", '' + groupingTags + ''); + x += addDeviceAttribute("Tags", '' + groupingTags + ''); } // SSH & RDP Credentials @@ -3869,8 +3869,8 @@ for (var i in nodes) { if (nodes[i].tags) { for (var j in nodes[i].tags) { if (allTags.indexOf(nodes[i].tags[j]) == -1) { allTags.push(nodes[i].tags[j]); } } } } if (allTags.length > 0) { allTags.sort(); - for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ''; } - x += '
' + y; + for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ' '; } + x += '
' + y + '
'; } } setDialogMode(2, "Edit Device", 3, showEditNodeValueDialogEx, x, mode); @@ -3887,6 +3887,7 @@ for (var i in tt) { t2.push(tt[i].trim()); } if (t2.indexOf(t) >= 0) return; Q('dp10devicevalue').value += ((Q('dp10devicevalue').value.length == 0) ? '' : ', ') + decodeURIComponent(t); + setTimeout(function () { Q('dp10devicevalue').selectionStart = Q('dp10devicevalue').selectionEnd = 90000; }, 0); p10editdevicevalueValidate(); } diff --git a/views/default.handlebars b/views/default.handlebars index 57c04a67..4aebcef6 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -5161,8 +5161,8 @@ for (var i in nodes) { if (nodes[i].tags) { for (var j in nodes[i].tags) { if (allTags.indexOf(nodes[i].tags[j]) == -1) { allTags.push(nodes[i].tags[j]); } } } } if (allTags.length > 0) { allTags.sort(); - for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ''; } - x += '
' + addHtmlValue("Existing Tags", y); + for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ' '; } + x += '
' + y + '
'; } setDialogMode(2, "Edit Device Tags", 3, d2groupActionFunctionTagsExec, x); } else if (op == 108) { @@ -6611,13 +6611,13 @@ x += addDeviceAttribute("Connectivity", cstate.join(', ')); } - // Node grouping tags + // Node tags var groupingTags = '' + "None" + ''; - if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '' + EscapeHtml(node.tags[i]) + ''; } } + if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '' + EscapeHtml(node.tags[i]) + ' '; } } if ((meshrights & 4) != 0) { - x += addDeviceAttribute("Tags", '' + groupingTags + ' '); + x += addDeviceAttribute("Tags", '' + groupingTags + ' '); } else { - x += addDeviceAttribute("Tags", groupingTags); + x += addDeviceAttribute("Tags", '' + groupingTags + ''); } // SSH & RDP Credentials @@ -7693,8 +7693,8 @@ for (var i in nodes) { if (nodes[i].tags) { for (var j in nodes[i].tags) { if (allTags.indexOf(nodes[i].tags[j]) == -1) { allTags.push(nodes[i].tags[j]); } } } } if (allTags.length > 0) { allTags.sort(); - for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ''; } - x += '
' + addHtmlValue("Existing Tags", y); + for (var i in allTags) { y += '' + EscapeHtml(allTags[i]) + ' '; } + x += '
' + y + '
'; } } setDialogMode(2, "Edit Device", 3, showEditNodeValueDialogEx, x, mode); @@ -7711,6 +7711,7 @@ for (var i in tt) { t2.push(tt[i].trim()); } if (t2.indexOf(t) >= 0) return; Q('dp10devicevalue').value += ((Q('dp10devicevalue').value.length == 0)?'':', ') + decodeURIComponent(t); + setTimeout(function(){ Q('dp10devicevalue').selectionStart = Q('dp10devicevalue').selectionEnd = 90000; }, 0); p10editdevicevalueValidate(); }