From 19e03eaf2932ef4042ff7abb6c01ca294e46b122 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Thu, 19 Oct 2023 23:25:27 +0100 Subject: [PATCH] add tags to columns Signed-off-by: Simon Smith --- views/default.handlebars | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/views/default.handlebars b/views/default.handlebars index b03aa7cc..529f5cdb 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -3949,6 +3949,7 @@ x += '
'; x += '
'; x += '
'; + x += '
'; x += '
'; x += '
'; x += '
'; @@ -3968,6 +3969,7 @@ if (Q('d2c7').checked) { cols.push('lastseen'); } if (Q('d2c8').checked) { cols.push('agtype'); } if (Q('d2c9').checked) { cols.push('agver'); } + if (Q('d2c10').checked) { cols.push('tags'); } deviceViewSettings.devsCols = cols; putstore('_deviceViewSettings', JSON.stringify(deviceViewSettings)); mainUpdate(4); @@ -4404,6 +4406,7 @@ if (deviceViewSettings.devsCols.indexOf('agtype') >= 0) { colums += '' + "Agent Type"; } if (deviceViewSettings.devsCols.indexOf('agver') >= 0) { colums += '' + "Agent Version"; } if (deviceViewSettings.devsCols.indexOf('os') >= 0) { colums += '' + "OS"; } + if (deviceViewSettings.devsCols.indexOf('tags') >= 0) { colums += '' + "Tags"; } if (deviceViewSettings.devsCols.indexOf('links') >= 0) { colums += '' + "Links"; } if (deviceViewSettings.devsCols.indexOf('user') >= 0) { colums += '' + "User"; } if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { colums += '' + "Address"; } @@ -4697,6 +4700,16 @@ r += '' + EscapeHtml(node.osdesc?node.osdesc:''); } } + if (deviceViewSettings.devsCols.indexOf('tags') >= 0) { // Tags + r += ''; + var groupingTags = ''; + if (node.tags != null) { + for (var i in node.tags) { + groupingTags += '' + EscapeHtml(node.tags[i]) + ' '; + } + } + r += '' + groupingTags + ''; + } if (deviceViewSettings.devsCols.indexOf('links') >= 0) { r += '' + getShortRouterLinks(node); } // Links if (deviceViewSettings.devsCols.indexOf('user') >= 0) { r += '' + getUserShortStr(node); } // User if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { var ip = ''; if (node.mtype == 3) { ip = node.host; } else if (node.ip) { ip = node.ip; } r += '' + ip; } // IP address