From 3578bbfcadfebfd7f20f5d6bed22d6c4fa1f8f01 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Fri, 5 May 2023 22:42:11 +1000 Subject: [PATCH] emty columns fixes --- back/pialert.py | 10 +++++++++- front/plugins/nmap_services/config.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index f18d2097..4ee3e6d0 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -3939,7 +3939,7 @@ def execute_plugin(plugin): for row in arr: # There has to be always 9 columns if len(row) == 9 and (row[0] in ['','null']) == False : - sqlParams.append((plugin["unique_prefix"], row[0], row[1], 'null', row[2], row[3], row[4], row[5], row[6], 0, row[7], 'null', row[8])) + sqlParams.append((plugin["unique_prefix"], row[0], handle_empty(row[1]), 'null', row[2], row[3], row[4], handle_empty(row[5]), handle_empty(row[6]), 0, row[7], 'null', row[8])) else: mylog('none', [' [Plugins]: Skipped invalid sql result']) @@ -3964,6 +3964,14 @@ def execute_plugin(plugin): update_api(False, ["plugins_events","plugins_objects"]) +#------------------------------------------------------------------------------- +# Handle empty value +def handle_empty(value): + if value == '' or value is None: + value = 'null' + + return value + #------------------------------------------------------------------------------- # Check if watched values changed for the given plugin def process_plugin_events(plugin): diff --git a/front/plugins/nmap_services/config.json b/front/plugins/nmap_services/config.json index 97464a10..725e3108 100755 --- a/front/plugins/nmap_services/config.json +++ b/front/plugins/nmap_services/config.json @@ -49,7 +49,7 @@ "column": "Object_PrimaryID", "css_classes": "col-sm-2", "show": true, - "type": "label", + "type": "devicemac", "default_value":"", "options": [], "localized": ["name"],