Merge branch 'next_release' of github.com:netalertx/NetAlertX into next_release

This commit is contained in:
jokob-sk committed 2026-10-10 07:54:44 +11:00
commit 1a42bcf8a1
18 files changed
+88 -49

No files matched your search

+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "نظام",
"settings_update_item_warning": "قم بتحديث القيمة أدناه. احرص على اتباع التنسيق السابق. <b>لم يتم إجراء التحقق.</b>",
"test_event_tooltip": "احفظ التغييرات أولاً قبل اختبار الإعدادات."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Sistema",
"settings_update_item_warning": "Actualitza el valor sota. Sigues curós de seguir el format anterior. <b>No hi ha validació.</b>",
"test_event_tooltip": "Deseu els canvis primer abans de comprovar la configuració."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Systém",
"settings_update_item_warning": "Zaktualizujte níže uvedenou hodnotu. Dávejte pozor, ať je dodržen předchozí formát. <b>Ověřování správnosti není prováděno.</b>",
"test_event_tooltip": "Než budete svá nastavení zkoušet, nejprve vámi provedené změny uložte."
}
}
+1 -1
View File
@@ -938,4 +938,4 @@
"settings_system_label": "System",
"settings_update_item_warning": "",
"test_event_tooltip": "Speichere die Änderungen, bevor Sie die Einstellungen testen."
}
}
+1 -1
View File
@@ -936,4 +936,4 @@
"settings_system_label": "Sistema",
"settings_update_item_warning": "Actualice el valor a continuación. Tenga cuidado de seguir el formato anterior. <b>O la validación no se realiza.</b>",
"test_event_tooltip": "Guarda tus cambios antes de probar nuevos ajustes."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Système",
"settings_update_item_warning": "Mettre à jour la valeur ci-dessous. Veillez à bien suivre le même format qu'auparavant. <b>Il n'y a pas de pas de contrôle.</b>",
"test_event_tooltip": "Enregistrer d'abord vos modifications avant de tester vôtre paramétrage."
}
}
+5 -5
View File
@@ -245,7 +245,7 @@
"Device_TableHead_CustomProps": "Proprietà/Azioni",
"Device_TableHead_FQDN": "FQDN",
"Device_TableHead_Favorite": "Preferito",
"Device_TableHead_FirstSession": "Prima sessione",
"Device_TableHead_FirstSession": "Prima apparizione",
"Device_TableHead_Flapping": "Flapping",
"Device_TableHead_GUID": "GUID",
"Device_TableHead_Group": "Gruppo",
@@ -254,7 +254,7 @@
"Device_TableHead_Icon": "Icona",
"Device_TableHead_LastIP": "Ultimo IP",
"Device_TableHead_LastIPOrder": "Ordina per ultimo IP",
"Device_TableHead_LastSession": "Ultimo offline",
"Device_TableHead_LastSession": "Ultima apparizione",
"Device_TableHead_Location": "Posizione",
"Device_TableHead_MAC": "MAC casuale",
"Device_TableHead_MAC_full": "MAC completo",
@@ -828,7 +828,7 @@
"general_event_title": "Esecuzione di un evento ad-hoc",
"go_to_device_event_tooltip": "Naviga al dispositivo",
"go_to_node_event_tooltip": "Passa alla pagina Rete del nodo specificato",
"nav_pending_dot": "",
"nav_pending_dot": "Sono presenti alcune notifiche visualizzate nel menu.",
"new_version_available": "È disponibile una nuova versione.",
"report_guid": "GUID notifica:",
"report_guid_missing": "Notifica collegata non trovata. C'è un piccolo ritardo tra la disponibilità delle notifiche inviate di recente e la loro disponibilità. Aggiorna la pagina e la cache dopo alcuni secondi. È anche possibile che la notifica selezionata sia stata eliminata durante la manutenzione come specificato nell'impostazione <code>DBCLNP_NOTIFI_HIST</code>. <br/> <br/>Viene invece visualizzata l'ultima notifica. La notifica mancante ha il seguente GUID:",
@@ -853,7 +853,7 @@
"settings_other_scanners": "Altri plugin, non scanner per dispositivi, che sono attualmente abilitati.",
"settings_other_scanners_icon": "fa-solid fa-recycle",
"settings_other_scanners_label": "Altri scanner",
"settings_pending_reload": "",
"settings_pending_reload": "Impostazioni salvate: il backend le sta ancora applicando, operazione che in genere richiede del tempo a seconda delle scansioni in background.",
"settings_publishers": "Gateway/editori di notifica abilitati, che invieranno una notifica in base alle tue impostazioni.",
"settings_publishers_icon": "fa-solid fa-paper-plane",
"settings_publishers_info": "Carica più editori con l'impostazione <a href=\"/settings.php#LOADED_PLUGINS\">LOADED_PLUGINS</a>",
@@ -865,4 +865,4 @@
"settings_system_label": "Sistema",
"settings_update_item_warning": "Aggiorna il valore qui sotto. Fai attenzione a seguire il formato precedente. <b>La convalida non viene eseguita.</b>",
"test_event_tooltip": "Salva le modifiche prima di provare le nuove impostazioni."
}
}
+23 -23
View File
@@ -238,9 +238,9 @@
"Device_Shortcut_OnlineChart": "デバイス検出",
"Device_Shortcut_Unstable": "不安定",
"Device_TableHead_AlertDown": "ダウンアラート",
"Device_TableHead_AlertEvents": "",
"Device_TableHead_CanSleep": "",
"Device_TableHead_Comments": "",
"Device_TableHead_AlertEvents": "アラートイベント",
"Device_TableHead_CanSleep": "スリープ可",
"Device_TableHead_Comments": "コメント",
"Device_TableHead_Connected_Devices": "接続",
"Device_TableHead_CustomProps": "属性 / アクション",
"Device_TableHead_FQDN": "FQDN",
@@ -270,7 +270,7 @@
"Device_TableHead_Rowid": "行ID",
"Device_TableHead_SSID": "SSID",
"Device_TableHead_SourcePlugin": "ソースプラグイン",
"Device_TableHead_StaticIP": "",
"Device_TableHead_StaticIP": "静的IP",
"Device_TableHead_Status": "状態",
"Device_TableHead_Status_description": "",
"Device_TableHead_SyncHubNodeName": "同期ノード",
@@ -347,7 +347,7 @@
"Gen_Copy": "実行",
"Gen_CopyToClipboard": "クリップボードにコピー",
"Gen_DataUpdatedUITakesTime": "OK - スキャン実行中は、UIの更新に時間がかかることがあります。",
"Gen_Day": "",
"Gen_Day": "日",
"Gen_Delete": "削除",
"Gen_DeleteAll": "全削除",
"Gen_Description": "説明",
@@ -356,19 +356,19 @@
"Gen_Filter": "フィルター",
"Gen_Flapping": "フラッピング",
"Gen_Generate": "生成",
"Gen_Hour": "",
"Gen_Hour": "時",
"Gen_InvalidMac": "無効なMacアドレス。",
"Gen_Invalid_Value": "無効な値が入力されました",
"Gen_LockedDB": "エラー - DBがロックされている可能性があります - F12で開発者ツール→コンソールを確認するか、後で試してください。",
"Gen_Month": "",
"Gen_Month": "月",
"Gen_NetworkMask": "ネットワークマスク",
"Gen_New": "New",
"Gen_Next": "",
"Gen_Next": "次",
"Gen_No_Data": "データなし",
"Gen_Offline": "オフライン",
"Gen_Okay": "Ok",
"Gen_Online": "オンライン",
"Gen_Prev": "",
"Gen_Prev": "前",
"Gen_Purge": "除去",
"Gen_ReadDocs": "詳細はドキュメントを参照。",
"Gen_Remove_All": "全削除",
@@ -392,7 +392,7 @@
"Gen_Update_Value": "更新値",
"Gen_ValidIcon": "<i class=\"fa-solid fa-chevron-right \"></i>",
"Gen_Warning": "警告",
"Gen_Week": "",
"Gen_Week": "週",
"Gen_Work_In_Progress": "作業中、https://github.com/netalertx/NetAlertX/issues へのフィードバックの好機です",
"Gen_create_new_device": "新規デバイス",
"Gen_create_new_device_info": "デバイスは通常、<a target=\"_blank\" href=\"https://docs.netalertx.com/PLUGINS\">プラグイン</a> を使用して検出されます。ただし、特定のケースでは手動でデバイスを追加する必要がある場合があります。具体的なシナリオについては、<a target=\"_blank\" href=\"https://docs.netalertx.com/REMOTE_NETWORKS\">リモートネットワークドキュメント</a> を参照してください。",
@@ -402,8 +402,8 @@
"HRS_TO_KEEP_NEWDEV_name": "新規デバイスの削除",
"HRS_TO_KEEP_OFFDEV_description": "これは <b>デバイスを削除</b> するメンテナンス設定です。有効にした場合(<code>0</code> で無効)、<b>オフライン</b> 状態のデバイスの内、<b>最終接続日時</b> が指定された時間より古いものは削除されます。<b>オフラインデバイス</b> を <code>X</code> 時間経過後に自動削除したい場合に使用してください。",
"HRS_TO_KEEP_OFFDEV_name": "オフラインデバイスを削除する",
"Header_PauseScans_Tooltip": "",
"Header_ResumeScans_Tooltip": "",
"Header_PauseScans_Tooltip": "自動スキャン一時停止",
"Header_ResumeScans_Tooltip": "自動スキャン再開",
"LOADED_PLUGINS_description": "読み込まれたプラグイン。プラグインの追加はアプリケーションの速度を低下させる可能性があります。有効化が必要なプラグインの種類やスキャンオプションについては、<a target=\"_blank\" href=\"https://docs.netalertx.com/PLUGINS\">プラグインのドキュメント</a> を参照してください。読み込まれなかったプラグインの設定は失われます。読み込まない設定にできるのは <code>無効化</code> されたプラグインのみです。",
"LOADED_PLUGINS_name": "読み込まれたプラグイン",
"LOG_LEVEL_description": "この設定により、より詳細なログ出力が有効になります。データベースへのイベント書き込みのデバッグに有用です。",
@@ -667,8 +667,8 @@
"SCAN_SUBNETS_description": "ほとんどのネットワーク内スキャナー(ARP-SCAN、NMAP、NSLOOKUP、DIG)は、特定のネットワークインターフェースとサブネットをスキャンすることに依存しています。この設定に関するヘルプについては、<a href=\"https://docs.netalertx.com/SUBNETS\" target=\"_blank\">サブネットのドキュメント</a> を確認してください。特にVLAN、サポートされているVLANの種類、ネットワークマスクとインターフェースの確認方法についてです。<br/><br/> ネットワーク内スキャナーの代替手段として、NetAlert<sup>X</sup> がネットワークにアクセスする必要のない他のデバイススキャナー/インポーター(UNIFI、dhcp.leases、PiHoleなど)を有効化できます。<br/><br/> 注:スキャン時間自体は確認するIPアドレス数に依存するため、適切なネットワークマスクとインターフェースで慎重に設定してください。",
"SCAN_SUBNETS_name": "スキャン対象ネットワーク",
"SYSTEM_TITLE": "システム情報",
"Scans_Paused": "",
"Scans_Resumed": "",
"Scans_Paused": "スキャン一時停止",
"Scans_Resumed": "スキャン再開",
"Setting_Override": "上書き値",
"Setting_Override_Description": "このオプションを有効にすると、アプリが提供するデフォルト値が上記で指定された値で上書きされます。",
"Settings_Metadata_Toggle": "指定された設定のメタデータを表示/非表示にする。",
@@ -727,14 +727,14 @@
"Systeminfo_Network_Server_Query": "サーバークエリ:",
"Systeminfo_Network_Server_Query_String": "クエリ文字列なし",
"Systeminfo_Network_Server_Version": "サーバーバージョン:",
"Systeminfo_Performance": "",
"Systeminfo_Performance_CPU": "",
"Systeminfo_Performance_Disabled": "",
"Systeminfo_Performance_Duration": "",
"Systeminfo_Performance_IO_Caption": "",
"Systeminfo_Performance_IO_Read": "",
"Systeminfo_Performance_IO_Write": "",
"Systeminfo_Performance_Memory": "",
"Systeminfo_Performance": "パフォーマンス",
"Systeminfo_Performance_CPU": "CPU %",
"Systeminfo_Performance_Disabled": "リソース履歴の収集は現在無効になっています。<a onclick=\"toggleAllSettings()\" href=\"#MAINT_PERF_DAYS\">設定で有効にしてください</a>。",
"Systeminfo_Performance_Duration": "スキャン時間",
"Systeminfo_Performance_IO_Caption": "NetAlertX プロセスの I/O のみを対象とします。プラグインのサブプロセスの I/O(例:スキャナーが独自の結果ファイルを書き込む場合など)は対象外です。",
"Systeminfo_Performance_IO_Read": "IO 読込 (MB)",
"Systeminfo_Performance_IO_Write": "IO書込 (MB)",
"Systeminfo_Performance_Memory": "メモリ使用量(MB)",
"Systeminfo_Services": "サービス",
"Systeminfo_Services_Description": "サービス内容",
"Systeminfo_Services_Name": "サービス名",
@@ -865,4 +865,4 @@
"settings_system_label": "システム",
"settings_update_item_warning": "以下の値を更新してください。以前のフォーマットに従うよう注意してください。<b>検証は行われません。</b>",
"test_event_tooltip": "設定をテストする前に、まず変更を保存してください。"
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "System",
"settings_update_item_warning": "Oppdater verdien nedenfor. Pass på å følge forrige format. <b>Validering etterpå utføres ikke.</b>",
"test_event_tooltip": "Lagre endringene først, før du tester innstillingene dine."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "System",
"settings_update_item_warning": "Zaktualizuj wartość poniżej. Uważaj, aby zachować poprzedni format. <b>Walidacja nie jest wykonywana.</b>",
"test_event_tooltip": "Najpierw zapisz swoje zmiany, zanim przetestujesz ustawienia."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "",
"settings_update_item_warning": "",
"test_event_tooltip": "Guarde as alterações antes de testar as definições."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Sistema",
"settings_update_item_warning": "Atualize o valor abaixo. Tenha cuidado em seguir o formato anterior. <b>Validação não é efetuada.</b>",
"test_event_tooltip": "Guarde as alterações antes de testar as definições."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Sistem",
"settings_update_item_warning": "",
"test_event_tooltip": ""
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "Система",
"settings_update_item_warning": "Оновіть значення нижче. Слідкуйте за попереднім форматом. <b>Перевірка не виконана.</b>",
"test_event_tooltip": "Перш ніж перевіряти налаштування, збережіть зміни."
}
}
+1 -1
View File
@@ -865,4 +865,4 @@
"settings_system_label": "系统",
"settings_update_item_warning": "更新下面的值。请注意遵循先前的格式。<b>未执行验证。</b>",
"test_event_tooltip": "在测试设置之前,请先保存更改。"
}
}
+4 -3
View File
@@ -360,21 +360,22 @@
},
{
"column": "extra",
"mapped_to_column": "scanSSID",
"css_classes": "col-sm-3",
"default_value": "",
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Network"
"string": "SSID"
},
{
"language_code": "es_es",
"string": "Red"
"string": "SSID"
},
{
"language_code": "de_de",
"string": "Netzwerk"
"string": "SSID"
}
],
"options": [],
+2 -1
View File
@@ -171,6 +171,7 @@ def get_entries(plugin_objects: Plugin_Objects) -> Plugin_Objects:
# -----------------------------------------------------------------------------
def collect_details(device_type, devices, online_macs, processed_macs, plugin_objects, device_label, device_vendor, force_import):
"""Add eligible UniFi devices with their identity, topology, and wireless SSID to plugin results."""
for device in devices:
mylog('verbose', [f'{json.dumps(device)}'])
@@ -198,7 +199,7 @@ def collect_details(device_type, devices, online_macs, processed_macs, plugin_ob
watched2=get_unifi_val(device, 'oui', device_vendor),
watched3=deviceType,
watched4=status,
extra=get_unifi_val(device, 'connection_network_name', ''),
extra='' if device.get('is_wired') is True else get_unifi_val(device, 'essid', ''),
foreignKey="",
helpVal1=parentMac,
helpVal2=get_port(get_unifi_val(device, 'sw_port'), get_unifi_val(device, 'uplink_remote_port')),
+41 -4
View File
@@ -1,7 +1,5 @@
"""
Tests for unifi_import/script.py - focused on the LOCK_FILE persistence fix
(moved from the ephemeral LOG_PATH/tmpfs to durable dbFolderPath, with a
one-time migration for existing installs).
Tests for UniFi client SSID import and persistent full-import lock files.
Run from inside the NetAlertX container, or locally - NetAlertX-specific
modules are stubbed out automatically before the script is imported.
@@ -10,6 +8,7 @@ modules are stubbed out automatically before the script is imported.
"""
import importlib.util
import json
import os
import sys
import tempfile
@@ -25,6 +24,7 @@ _stubbed_module_names = []
def _stub(name: str, **attrs):
"""Register an absent dependency stub and track it for cleanup after importing the plugin."""
if name not in sys.modules:
mod = types.ModuleType(name)
for k, v in attrs.items():
@@ -44,7 +44,7 @@ _stub(
is_mac=lambda v: isinstance(v, str) and len(v.split(":")) == 6,
)
_stub("logger", mylog=lambda *a: None, Logger=MagicMock)
_stub("helper", get_setting_value=lambda k: "", normalize_string=lambda s: s)
_stub("helper", get_setting_value=lambda k: "UTC" if k == "TIMEZONE" else "", normalize_string=lambda s: s)
if "pyunifi" not in sys.modules:
_pyunifi = types.ModuleType("pyunifi")
@@ -88,6 +88,43 @@ read_lock_file = script.read_lock_file
set_lock_file_value = script.set_lock_file_value
@pytest.mark.parametrize(
"client_fields,expected_ssid",
[
({"is_wired": False, "essid": "example-wifi", "last_connection_network_name": "example-vlan"}, "example-wifi"),
({"is_wired": False, "essid": "example-wifi", "connection_network_name": "example-vlan"}, "example-wifi"),
({"essid": "example-wifi"}, "example-wifi"),
({"is_wired": True, "essid": "old-wifi", "connection_network_name": "example-vlan"}, ""),
({"is_wired": True}, ""),
({"is_wired": False, "last_connection_network_name": "example-vlan"}, ""),
({"is_wired": False, "essid": None}, ""),
({"is_wired": False, "essid": ""}, ""),
],
)
def test_collect_details_reports_wireless_ssid(client_fields, expected_ssid):
"""Import the wireless SSID without treating network names as SSIDs."""
objects = MagicMock()
client = {"mac": "aa:bb:cc:dd:ee:01", "ip": "192.0.2.1", **client_fields}
script.collect_details(
{"cl": ""}, [client], set(), [], objects, "client", "", True
)
objects.add_object.assert_called_once()
assert objects.add_object.call_args.kwargs["extra"] == expected_ssid
def test_unifi_ssid_is_mapped_to_current_scan():
"""Route imported SSIDs through CurrentScan to the device update policy."""
config_path = os.path.join(os.path.dirname(_SCRIPT_PATH), "config.json")
with open(config_path, encoding="utf-8") as config_file:
config = json.load(config_file)
assert config["mapped_to_table"] == "CurrentScan"
extra = next(column for column in config["database_column_definitions"] if column["column"] == "extra")
assert extra.get("mapped_to_column") == "scanSSID"
class TestMigrateLegacyLockFile:
def test_migrates_legacy_file_to_new_location(self, tmp_path):
legacy = tmp_path / "full_run.UNFIMP.lock"