From db8bde4ca392a054be4324fceb928627ddda9c4a Mon Sep 17 00:00:00 2001 From: Seth Grover Date: Tue, 14 Jan 2025 11:37:33 -0700 Subject: [PATCH] for cisagov/Malcolm#551, URL pivot links from dashboards to netbox --- dashboards/scripts/index-refresh.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dashboards/scripts/index-refresh.py b/dashboards/scripts/index-refresh.py index 3abff360d..061463db9 100755 --- a/dashboards/scripts/index-refresh.py +++ b/dashboards/scripts/index-refresh.py @@ -370,24 +370,16 @@ def main(): ] = '/netbox/search/?q={{value}}&obj_types=virtualization.cluster&lookup=iexact' elif field['name'].endswith('.device.device_type') or (field['name'] == 'related.device_type'): - fieldFormatInfo['params'][ - 'urlTemplate' - ] = '/netbox/search/?q={{value}}&obj_types=dcim.devicetype&lookup=iexact' + fieldFormatInfo['params']['urlTemplate'] = '/netbox/search/?q={{value}}&obj_types=dcim.devicetype' elif field['name'].endswith('.device.manufacturer') or (field['name'] == 'related.manufacturer'): - fieldFormatInfo['params'][ - 'urlTemplate' - ] = '/netbox/search/?q={{value}}&obj_types=dcim.manufacturer&lookup=iexact' + fieldFormatInfo['params']['urlTemplate'] = '/netbox/search/?q={{value}}&obj_types=dcim.manufacturer' elif field['name'].endswith('.device.role') or (field['name'] == 'related.role'): - fieldFormatInfo['params'][ - 'urlTemplate' - ] = '/netbox/search/?q={{value}}&obj_types=dcim.devicerole&lookup=iexact' + fieldFormatInfo['params']['urlTemplate'] = '/netbox/search/?q={{value}}&obj_types=dcim.devicerole' elif field['name'].endswith('.device.service') or (field['name'] == 'related.service'): - fieldFormatInfo['params'][ - 'urlTemplate' - ] = '/netbox/search/?q={{value}}&obj_types=ipam.service&lookup=iexact' + fieldFormatInfo['params']['urlTemplate'] = '/netbox/search/?q={{value}}&obj_types=ipam.service' elif field['name'].endswith('.device.url') or field['name'].endswith('.segment.url'): fieldFormatInfo['params']['urlTemplate'] = '{{value}}'