From 7cdcf95300df8b6310ced04c9c31dbfaef21e0bc Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Tue, 24 Dec 2024 11:06:43 +1100 Subject: [PATCH] Docs and simngle quote removal when editing device #918 --- front/deviceDetailsEdit.php | 6 +++--- front/plugins/README.md | 27 ++++++++++++++------------- front/plugins/wake_on_lan/config.json | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/front/deviceDetailsEdit.php b/front/deviceDetailsEdit.php index c69780d7..4814a5fc 100755 --- a/front/deviceDetailsEdit.php +++ b/front/deviceDetailsEdit.php @@ -400,12 +400,12 @@ function setDeviceData(direction = '', refreshCallback = '') { $.get('php/server/devices.php?action=setDeviceData&mac='+ $('#NEWDEV_devMac').val() + '&name=' + encodeURIComponent($('#NEWDEV_devName').val().replace(/'/g, "")) + '&owner=' + encodeURIComponent($('#NEWDEV_devOwner').val().replace(/'/g, "")) - + '&type=' + $('#NEWDEV_devType').val() + + '&type=' + $('#NEWDEV_devType').val().replace(/'/g, "") + '&vendor=' + encodeURIComponent($('#NEWDEV_devVendor').val().replace(/'/g, "")) + '&icon=' + encodeURIComponent($('#NEWDEV_devIcon').val()) + '&favorite=' + ($('#NEWDEV_devFavorite')[0].checked * 1) - + '&group=' + encodeURIComponent($('#NEWDEV_devGroup').val()) - + '&location=' + encodeURIComponent($('#NEWDEV_devLocation').val()) + + '&group=' + encodeURIComponent($('#NEWDEV_devGroup').val().replace(/'/g, "")) + + '&location=' + encodeURIComponent($('#NEWDEV_devLocation').val().replace(/'/g, "")) + '&comments=' + encodeURIComponent(encodeSpecialChars($('#NEWDEV_devComments').val())) + '&networknode=' + $('#NEWDEV_devParentMAC').val() + '&networknodeport=' + $('#NEWDEV_devParentPort').val() diff --git a/front/plugins/README.md b/front/plugins/README.md index 60148384..4aa648ce 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -24,49 +24,50 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T | ID | Type | Description | Features | Required | Data source | Detailed docs | -|---------------|---------|--------------------------------------------|----------|----------|--------------------|---------------------------------------------------------------| +|---------------|---------|--------------------------------------------|----------|----------|--------------|---------------------------------------------------------------------| | `APPRISE` | ▢️ | Apprise notification proxy | | | Script | [_publisher_apprise](/front/plugins/_publisher_apprise/) | | `ARPSCAN` | πŸ” | ARP-scan on current network | | | Script | [arp_scan](/front/plugins/arp_scan/) | | `AVAHISCAN` | πŸ†Ž | Avahi (mDNS-based) name resolution | | | Script | [avahi_scan](/front/plugins/avahi_scan/) | | `CSVBCKP` | βš™ | CSV devices backup | | | Script | [csv_backup](/front/plugins/csv_backup/) | | `DBCLNP` | βš™ | Database cleanup | | Yes* | Script | [db_cleanup](/front/plugins/db_cleanup/) | | `DDNS` | βš™ | DDNS update | | | Script | [ddns_update](/front/plugins/ddns_update/) | -| `DHCPLSS` | πŸ”/πŸ“₯/πŸ†Ž| Import devices from DHCP leases | | | Script | [dhcp_leases](/front/plugins/dhcp_leases/) | +| `DHCPLSS` | πŸ”/πŸ“₯/πŸ†Ž| Import devices from DHCP leases | | | Script | [dhcp_leases](/front/plugins/dhcp_leases/) | | `DHCPSRVS` | β™» | DHCP servers | | | Script | [dhcp_servers](/front/plugins/dhcp_servers/) | -| `FREEBOX` | πŸ”/β™»/πŸ†Ž | Pull data and names from Freebox/Iliadbox | | | Script | [freebox](/front/plugins/freebox/) | +| `FREEBOX` | πŸ”/β™»/πŸ†Ž | Pull data and names from Freebox/Iliadbox | | | Script | [freebox](/front/plugins/freebox/) | | `ICMP` | πŸ” | ICMP (ping) status checker | | | Script | [icmp_scan](/front/plugins/icmp_scan/) | | `INTRNT` | πŸ” | Internet IP scanner | | | Script | [internet_ip](/front/plugins/internet_ip/) | | `INTRSPD` | β™» | Internet speed test | | | Script | [internet_speedtest](/front/plugins/internet_speedtest/) | | `IPNEIGH` | πŸ” | Scan ARP (IPv4) and NDP (IPv6) tables | | | Script | [ipneigh](/front/plugins/ipneigh/) | | `MAINT` | βš™ | Maintenance of logs, etc. | | | Script | [maintenance](/front/plugins/maintenance/) | | `MQTT` | ▢️ | MQTT for synching to Home Assistant | | | Script | [_publisher_mqtt](/front/plugins/_publisher_mqtt/) | -| `NBTSCAN` | πŸ†Ž | Nbtscan (NetBIOS-based) name resolution | | | Script | [nbtscan_scan](/front/plugins/nbtscan_scan/) | +| `NBTSCAN` | πŸ†Ž | Nbtscan (NetBIOS-based) name resolution | | | Script | [nbtscan_scan](/front/plugins/nbtscan_scan/) | | `NEWDEV` | βš™ | New device template | | Yes | Template | [newdev_template](/front/plugins/newdev_template/) | | `NMAP` | β™» | Nmap port scanning & discovery | | | Script | [nmap_scan](/front/plugins/nmap_scan/) | | `NMAPDEV` | πŸ” | Nmap dev scan on current network | | | Script | [nmap_dev_scan](/front/plugins/nmap_dev_scan/) | -| `NSLOOKUP` | πŸ†Ž | NSLookup (DNS-based) name resolution | | | Script | [nslookup_scan](/front/plugins/nslookup_scan/) | +| `NSLOOKUP` | πŸ†Ž | NSLookup (DNS-based) name resolution | | | Script | [nslookup_scan](/front/plugins/nslookup_scan/) | | `NTFPRCS` | βš™ | Notification processing | | Yes | Template | [notification_processing](/front/plugins/notification_processing/)| | `NTFY` | ▢️ | NTFY notifications | | | Script | [_publisher_ntfy](/front/plugins/_publisher_ntfy/) | -| `OMDSDN` | πŸ“₯/πŸ†Ž | OMADA TP-Link import | πŸ–§ πŸ”„ | | Script | [omada_sdn_imp](/front/plugins/omada_sdn_imp/) | -| `PIHOLE` | πŸ”/πŸ†Ž/πŸ“₯| Pi-hole device import & sync | | | SQLite DB | [pihole_scan](/front/plugins/pihole_scan/) | +| `OMDSDN` | πŸ“₯/πŸ†Ž | OMADA TP-Link import | πŸ–§ πŸ”„ | | Script | [omada_sdn_imp](/front/plugins/omada_sdn_imp/) | +| `PIHOLE` | πŸ”/πŸ†Ž/πŸ“₯| Pi-hole device import & sync | | | SQLite DB | [pihole_scan](/front/plugins/pihole_scan/) | | `PUSHSAFER` | ▢️ | Pushsafer notifications | | | Script | [_publisher_pushsafer](/front/plugins/_publisher_pushsafer/) | | `PUSHOVER` | ▢️ | Pushover notifications | | | Script | [_publisher_pushover](/front/plugins/_publisher_pushover/) | | `SETPWD` | βš™ | Set password | | Yes | Template | [set_password](/front/plugins/set_password/) | | `SMTP` | ▢️ | Email notifications | | | Script | [_publisher_email](/front/plugins/_publisher_email/) | | `SNMPDSC` | πŸ”/πŸ“₯ | SNMP device import & sync | | | Script | [snmp_discovery](/front/plugins/snmp_discovery/) | -| `SYNC` | πŸ”/βš™/πŸ“₯| Sync & import from NetAlertX instances | πŸ–§ πŸ”„ | Yes | Script | [sync](/front/plugins/sync/) | +| `SYNC` | πŸ”/βš™/πŸ“₯| Sync & import from NetAlertX instances | πŸ–§ πŸ”„ | Yes | Script | [sync](/front/plugins/sync/) | | `TELEGRAM` | ▢️ | Telegram notifications | | | Script | [_publisher_telegram](/front/plugins/_publisher_telegram/) | -| `UNDIS` | πŸ”/πŸ“₯ | Create dummy devices | | | Script | [undiscoverables](/front/plugins/undiscoverables/) | -| `UNFIMP` | πŸ”/πŸ“₯/πŸ†Ž| UniFi device import & sync | πŸ–§ | | Script | [unifi_import](/front/plugins/unifi_import/) | +| `UI` | β™» | UI specific settings | | Yes | Template | [ui_settings](/front/plugins/ui_settings/) | +| `UNDIS` | πŸ”/πŸ“₯ | Create dummy devices ❌ | | | Script | [undiscoverables](/front/plugins/undiscoverables/) | +| `UNFIMP` | πŸ”/πŸ“₯/πŸ†Ž| UniFi device import & sync | πŸ–§ | | Script | [unifi_import](/front/plugins/unifi_import/) | | `VNDRPDT` | βš™ | Vendor database update | | | Script | [vendor_update](/front/plugins/vendor_update/) | | `WEBHOOK` | ▢️ | Webhook notifications | | | Script | [_publisher_webhook](/front/plugins/_publisher_webhook/) | | `WEBMON` | β™» | Website down monitoring | | | Script | [website_monitor](/front/plugins/website_monitor/) | +| `WOL` | β™» | Automatic wake-on-lan | | | Script | [wake_on_lan](/front/plugins/wake_on_lan/) | > \* The database cleanup plugin (`DBCLNP`) is not _required_ but the app will become unusable after a while if not executed. -> > \** The Undiscoverables plugin (`UNDIS`) inserts only user-specified dummy devices. - +> ❌ marked for removal > ⌚It's recommended to use the same schedule interval for all plugins responsible for discovering new devices. ## Plugin types @@ -79,7 +80,7 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T | name discovery | πŸ†Ž | Discovers names of devices via various protocols. | `before_name_updates`, `schedule` | βœ– | Script | | importer | πŸ“₯ | Importing devices from another service. | `schedule` | βœ– | Script / SQLite DB | | system | βš™ | Providing core system functionality. | `schedule` / always on | βœ–/βœ” | Script / Template | -| other | β™» | Other scanners, e.g. for name resolution | misc | βœ– | Script / Template | +| other | β™» | Other plugins | misc | βœ– | Script / Template | ## Features diff --git a/front/plugins/wake_on_lan/config.json b/front/plugins/wake_on_lan/config.json index 43c16a1f..c316251d 100755 --- a/front/plugins/wake_on_lan/config.json +++ b/front/plugins/wake_on_lan/config.json @@ -95,7 +95,7 @@ }, { "function": "devices_to_wake", - "events": ["run"], + "events": [], "type": { "dataType": "string", "elements": [