From df90060adf5d65fe9148d0208d871f1c3c51028c Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sun, 30 Jun 2024 21:17:52 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BB=20Plugin=20Boilerplate=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/plugins/__template/config.json | 6 +++--- front/plugins/__template/rename_me.py | 2 +- front/settings.php | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/front/plugins/__template/config.json b/front/plugins/__template/config.json index a7466e9d..8938a1c4 100755 --- a/front/plugins/__template/config.json +++ b/front/plugins/__template/config.json @@ -1,7 +1,7 @@ { - "code_name": "folder_name", - "unique_prefix": "", - "plugin_type": "scanner", + "code_name": "__template", + "unique_prefix": "TMP", + "plugin_type": "device_scanner", "enabled": true, "data_source": "script", "mapped_to_table": "CurrentScan", diff --git a/front/plugins/__template/rename_me.py b/front/plugins/__template/rename_me.py index 1256f9d4..e996402e 100755 --- a/front/plugins/__template/rename_me.py +++ b/front/plugins/__template/rename_me.py @@ -59,7 +59,7 @@ def main(): extra = '', foreignKey = device['mac_address']) - mylog('verbose', [f'[{pluginName}] New entries: "{len(new_devices)}"']) + mylog('verbose', [f'[{pluginName}] New entries: "{len(device_data)}"']) # log result plugin_objects.write_result_file() diff --git a/front/settings.php b/front/settings.php index 80473a93..d3662d46 100755 --- a/front/settings.php +++ b/front/settings.php @@ -386,6 +386,12 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX // is this isn't a metadata entry, get corresponding metadata object from the dummy setting const setObj = isMetadata ? {} : JSON.parse(getSetting(`${codeName}__metadata`)); + // not initialized properly, reload + if(isMetadata && val == "" ) + { + clearCache(); + } + // constructing final HTML for the setting setHtml = ""