From 60a1349be577bd47de7ef769af6cc88e0722f294 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 15 Mar 2025 08:52:46 +1100 Subject: [PATCH] OPENWRT/LUCI #1010 --- front/plugins/luci_import/config.json | 28 +++++++++++++++++++++++++++ front/plugins/luci_import/script.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/front/plugins/luci_import/config.json b/front/plugins/luci_import/config.json index ec232a56..ffb22812 100755 --- a/front/plugins/luci_import/config.json +++ b/front/plugins/luci_import/config.json @@ -355,6 +355,34 @@ "string": "Если необходимо отключить проверку SSL/TLS для ресурсов HTTPS (для самоподписанных сертификатов и т. д.)" } ] + }, + { + "function": "only_reachable", + "type": { + "dataType": "boolean", + "elements": [ + { + "elementType": "input", + "elementOptions": [{ "type": "checkbox" }], + "transformers": [] + } + ] + }, + "default_value": true, + "options": [], + "localized": ["name", "description"], + "name": [ + { + "language_code": "en_us", + "string": "Only reachable" + } + ], + "description": [ + { + "language_code": "en_us", + "string": "Retrieve only devices that are reachable." + } + ] } ], "database_column_definitions": [ diff --git a/front/plugins/luci_import/script.py b/front/plugins/luci_import/script.py index 74dbe62b..825f3dc6 100755 --- a/front/plugins/luci_import/script.py +++ b/front/plugins/luci_import/script.py @@ -67,7 +67,7 @@ def get_device_data(): else: mylog('error', [f'[{pluginName}] login fail.']) - device_data = router.get_all_connected_devices(only_reachable=True) + device_data = router.get_all_connected_devices(only_reachable=get_setting_value("LUCIRPC_only_reachable")) return device_data if __name__ == '__main__':