Settings cleanup, docs and strings, Removal of ENABLE_ARPSCAN

This commit is contained in:
Jokob-sk
2023-08-16 08:01:56 +10:00
parent c8bae60060
commit a3359dbec4
11 changed files with 40 additions and 28 deletions

View File

@@ -454,11 +454,8 @@
"Setting_Override" : "Override value",
"Setting_Override_Description" : "Enabling this option will override an App supplied default value with the value specified above.",
"General_display_name" : "General",
"General_icon" : "<i class=\"fa fa-gears\"></i>",
"ENABLE_ARPSCAN_name" : "Enable ARP scan",
"ENABLE_ARPSCAN_description" : "Arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. An alternative to ARP scan is to enable the <a onclick=\"toggleAllSettings()\" href=\"#PIHOLE_RUN\"><code>PIHOLE_RUN</code>PiHole integration settings</a>.",
"SCAN_SUBNETS_name" : "Subnets to scan",
"SCAN_SUBNETS_description" : "The arp-scan time itself depends on the number of IP addresses to check so set this up carefully with the appropriate network mask and interface. Check the <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md\" target=\"_blank\">subnets documentation</a> for help on setting up VLANs, what VLANs are supported, or how to figure out the network mask and your interface.",
"General_icon" : "<i class=\"fa fa-gears\"></i>",
"SCAN_SUBNETS_description" : "Arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. An alternative to ARP scan is to enable the <a onclick=\"toggleAllSettings()\" href=\"#PIHOLE_RUN\"><code>PIHOLE_RUN</code>PiHole integration settings</a>. The arp-scan time itself depends on the number of IP addresses to check so set this up carefully with the appropriate network mask and interface. Check the <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md\" target=\"_blank\">subnets documentation</a> for help on setting up VLANs, what VLANs are supported, or how to figure out the network mask and your interface.",
"LOG_LEVEL_name" : "Print additional logging",
"LOG_LEVEL_description" : "This setting will enable more verbose logging. Useful for debugging events writing into the database.",
"TIMEZONE_name" : "Time zone",

View File

@@ -448,10 +448,8 @@
"Setting_Override_Description": "Habilitar esta opción anulará un valor predeterminado proporcionado por la aplicación con el valor especificado anteriormente.",
"General_display_name" : "General",
"General_icon" : "<i class=\"fa fa-gears\"></i>",
"ENABLE_ARPSCAN_name" : "Activar escaneo ARP",
"ENABLE_ARPSCAN_description" : "El escaneo Arp es una herramienta de la línea de comandos que usa el protocolo ARP para encontrar e identificar la ip de los dispositivos. Una alternativa a este escaneo sería activar los ajustes de la <a onclick=\"toggleAllSettings()\" href=\"#PIHOLE_RUN\"><code>PIHOLE_RUN</code>integración con PiHole</a>.",
"SCAN_SUBNETS_name" : "Subredes para escanear",
"SCAN_SUBNETS_description" : "El tiempo del escaneo ARP depende del número de ips a comprobar, así que es importante establecer correctamente la máscara y la interfaz de red. Comprueba la <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentación sobre sudredes</a> para obtener ayuda para establecer VLANs, cuáles son soportadas o como averiguar la máscara y la interfaz de red.",
"SCAN_SUBNETS_description" : "El escaneo Arp es una herramienta de la línea de comandos que usa el protocolo ARP para encontrar e identificar la ip de los dispositivos. Una alternativa a este escaneo sería activar los ajustes de la <a onclick=\"toggleAllSettings()\" href=\"#PIHOLE_RUN\"><code>PIHOLE_RUN</code>integración con PiHole</a>. El tiempo del escaneo ARP depende del número de ips a comprobar, así que es importante establecer correctamente la máscara y la interfaz de red. Comprueba la <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentación sobre sudredes</a> para obtener ayuda para establecer VLANs, cuáles son soportadas o como averiguar la máscara y la interfaz de red.",
"LOG_LEVEL_name" : "Imprimir registros adicionales",
"LOG_LEVEL_description" : "Esto hará que el registro tenga más información. Util para depurar que eventos se van guardando en la base de datos.",
"TIMEZONE_name" : "Zona horaria",

View File

@@ -463,7 +463,8 @@ Required attributes are:
- `"localized"` - a list of properties on the current JSON level which need to be localized
- `"name"` and `"description"` - Displayed on the Settings page. An array of localized strings. (see Localized strings below).
- (optional) `"events"` - `<test|run>` - to generate an execution button next to the input field of the setting (not fully tested)
- (optional) `"override_value"` - used to determine a user-defined override for the setting. Useful for template-based plugins, where you can choose to leave the current value or override it with the value defined in the setting. (wip)
- (optional) `"override_value"` - used to determine a user-defined override for the setting. Useful for template-based plugins, where you can choose to leave the current value or override it with the value defined in the setting. (work in progress)
- (optional) `"events": ["run", "test"]` - used to trigger the plugin. Usually used on the `RUN` setting. Not fully tested in all scenarios. Will show a play button next to the setting and then after clicking an event is generated for the backend in the `Parameters` database table to process the front-end event on the next run.
##### Supported settings `function` values

View File

@@ -19,11 +19,11 @@
"display_name": [
{
"language_code": "en_us",
"string": "Network scan (Arp-Scan)"
"string": "Arp-Scan (Network scan)"
},
{
"language_code": "es_es",
"string": "Escaneo de red (Arp-Scan)"
"string": "Arp-Scan (Escaneo de red)"
}
],
"icon": [
@@ -60,6 +60,7 @@
"default_value":"schedule",
"options": ["disabled", "once", "schedule", "always_after_scan", "on_new_device"],
"localized": ["name", "description"],
"events": ["run"],
"name" :[
{
"language_code":"en_us",

View File

@@ -17,7 +17,7 @@
"mapped_to_table": "DHCP_Leases",
"display_name" : [{
"language_code":"en_us",
"string" : "DHCP Leases"
"string" : "DHCP Leases (Device import)"
}],
"icon":[{
"language_code":"en_us",

View File

@@ -19,7 +19,7 @@
"display_name": [
{
"language_code": "en_us",
"string": "Network scan (PiHole)"
"string": "PiHole (Device sync)"
}
],
"icon": [
@@ -31,7 +31,7 @@
"description": [
{
"language_code": "en_us",
"string": "This plugin is to import devices from PiHole"
"string": "This plugin syncs devices from the PiHole database"
}
],
"params" : [

View File

@@ -356,6 +356,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
eventsList.forEach(event => {
eventsHtml += `<span class="input-group-addon pointer"
data-myparam="${codeName}"
data-myparam-plugin="${group}"
data-myevent="${event}"
onclick="handleEvent(this)"
>
@@ -680,8 +681,8 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
function handleEvent (element){
// value has to be in format event|param. e.g. run|ENABLE_ARPSCAN
value = $(element).attr('data-myevent') + '|'+ $(element).attr('data-myparam')
// value has to be in format event|param. e.g. run|ARPSCAN
value = $(element).attr('data-myevent') + '|'+ $(element).attr('data-myparam-plugin')
setParameter ('Front_Event', value)