From d22a3d517d88d7dd49bb34a6455441303e516495 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 11 Aug 2023 16:38:52 +0530 Subject: [PATCH] ui: fix conflict/regression found in AutogenView After forward merged from 4.18->main, found a regression due to 3c25a3542655f29543624bcb7b6940afdb20937e where any columns which are custom functions don't render. Such as metrics columns. Signed-off-by: Rohit Yadav --- ui/src/views/AutogenView.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 3c476e168ae..ea448b449d4 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -835,6 +835,7 @@ export default { }) } + const customRender = {} for (var columnKey of this.columnKeys) { let key = columnKey let title = columnKey === 'cidr' && this.columnKeys.includes('ip6cidr') ? 'ipv4.cidr' : columnKey @@ -842,9 +843,11 @@ export default { if ('customTitle' in columnKey && 'field' in columnKey) { key = columnKey.field title = columnKey.customTitle + customRender[key] = columnKey[key] } else { key = Object.keys(columnKey)[0] title = Object.keys(columnKey)[0] + customRender[key] = columnKey[key] } } this.columns.push({ @@ -981,6 +984,12 @@ export default { for (let idx = 0; idx < this.items.length; idx++) { this.items[idx].key = idx + for (const key in customRender) { + const func = customRender[key] + if (func && typeof func === 'function') { + this.items[idx][key] = func(this.items[idx]) + } + } if (this.$route.path.startsWith('/ldapsetting')) { this.items[idx].id = this.items[idx].hostname }