mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
HomeAssistant docs + Delete listed Plugin Obj #813
This commit is contained in:
@@ -6,6 +6,7 @@ NetAlertX comes with MQTT support, allowing you to show all detected devices as
|
|||||||
|
|
||||||
- Please note that discovery takes about ~10s per device.
|
- Please note that discovery takes about ~10s per device.
|
||||||
- Deleting of devices is not handled automatically. Please use [MQTT Explorer](https://mqtt-explorer.com/) to delete devices in the broker (Home Assistant), if needed.
|
- Deleting of devices is not handled automatically. Please use [MQTT Explorer](https://mqtt-explorer.com/) to delete devices in the broker (Home Assistant), if needed.
|
||||||
|
- For optimization reasons, the devices are not always fully synchronized. You can delete Plugin objects as described in the [MQTT plugin](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/_publisher_mqtt#forcing-an-update) docs to force a full synchronization.
|
||||||
|
|
||||||
|
|
||||||
## 🧭 Guide
|
## 🧭 Guide
|
||||||
|
|||||||
@@ -27,6 +27,29 @@ If you are running a DNS server, such as **AdGuard**, set up **Private reverse D
|
|||||||
5. Click **Apply** to save your settings.
|
5. Click **Apply** to save your settings.
|
||||||
|
|
||||||
|
|
||||||
|
### Specifying the DNS in the container
|
||||||
|
|
||||||
|
You can specify the DNS server in the docker-compose to improve name resolution on your network.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
netalertx:
|
||||||
|
container_name: netalertx
|
||||||
|
image: "jokobsk/netalertx:latest"
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /home/netalertx/config:/app/config
|
||||||
|
- /home/netalertx/db:/app/db
|
||||||
|
- /home/netalertx/log:/app/front/log
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Berlin
|
||||||
|
- PORT=20211
|
||||||
|
network_mode: host
|
||||||
|
dns:
|
||||||
|
- 10.8.0.1
|
||||||
|
- 10.8.0.17
|
||||||
|
```
|
||||||
|
|
||||||
### Using a custom resolv.conf file
|
### Using a custom resolv.conf file
|
||||||
|
|
||||||
You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details.
|
You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details.
|
||||||
|
|||||||
@@ -1458,7 +1458,7 @@ function setDeviceData (direction='', refreshCallback='') {
|
|||||||
somethingChanged = false;
|
somethingChanged = false;
|
||||||
|
|
||||||
// refresh API
|
// refresh API
|
||||||
updateApi()
|
updateApi("devices,appevents")
|
||||||
|
|
||||||
hideSpinner()
|
hideSpinner()
|
||||||
|
|
||||||
@@ -1678,7 +1678,7 @@ function deleteDevice () {
|
|||||||
$('#panDetails :input').attr('disabled', true);
|
$('#panDetails :input').attr('disabled', true);
|
||||||
|
|
||||||
// refresh API
|
// refresh API
|
||||||
updateApi()
|
updateApi("devices,appevents")
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1006,11 +1006,11 @@ function hideSpinner()
|
|||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// Calls a backend function to add a front-end event to an execution queue
|
// Calls a backend function to add a front-end event to an execution queue
|
||||||
function updateApi()
|
function updateApi(apiEndpoints)
|
||||||
{
|
{
|
||||||
|
|
||||||
// value has to be in format event|param. e.g. run|ARPSCAN
|
// value has to be in format event|param. e.g. run|ARPSCAN
|
||||||
action = `${getGuid()}|update_api|devices,appevents`
|
action = `${getGuid()}|update_api|${apiEndpoints}`
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ function executeAction(action, whereColumnName, key, targetColumns, newTargetCol
|
|||||||
window.onbeforeunload = null;
|
window.onbeforeunload = null;
|
||||||
|
|
||||||
// update API endpoints to refresh the UI
|
// update API endpoints to refresh the UI
|
||||||
updateApi()
|
updateApi("devices,appevents")
|
||||||
|
|
||||||
write_notification(`[Multi edit] Executed "${action}" on Columns "${targetColumns}" matching "${key}"`, 'info')
|
write_notification(`[Multi edit] Executed "${action}" on Columns "${targetColumns}" matching "${key}"`, 'info')
|
||||||
|
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "",
|
"Plugins_DeleteAll": "",
|
||||||
"Plugins_Filters_Mac": "",
|
"Plugins_Filters_Mac": "",
|
||||||
"Plugins_History": "",
|
"Plugins_History": "",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "",
|
"Plugins_Objects": "",
|
||||||
"Plugins_Out_of": "",
|
"Plugins_Out_of": "",
|
||||||
"Plugins_Unprocessed_Events": "",
|
"Plugins_Unprocessed_Events": "",
|
||||||
|
|||||||
@@ -573,6 +573,7 @@
|
|||||||
"Plugins_DeleteAll": "Delete all (filters are ignored)",
|
"Plugins_DeleteAll": "Delete all (filters are ignored)",
|
||||||
"Plugins_Filters_Mac": "Mac Filter",
|
"Plugins_Filters_Mac": "Mac Filter",
|
||||||
"Plugins_History": "Events History",
|
"Plugins_History": "Events History",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Plugin Objects",
|
"Plugins_Objects": "Plugin Objects",
|
||||||
"Plugins_Out_of": "von",
|
"Plugins_Out_of": "von",
|
||||||
"Plugins_Unprocessed_Events": "Unprocessed Events",
|
"Plugins_Unprocessed_Events": "Unprocessed Events",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Delete all (filters are ignored)",
|
"Plugins_DeleteAll": "Delete all (filters are ignored)",
|
||||||
"Plugins_Filters_Mac": "Mac Filter",
|
"Plugins_Filters_Mac": "Mac Filter",
|
||||||
"Plugins_History": "Events History",
|
"Plugins_History": "Events History",
|
||||||
|
"Plugins_Obj_DeleteListed": "Delete Listed Objects",
|
||||||
"Plugins_Objects": "Plugin Objects",
|
"Plugins_Objects": "Plugin Objects",
|
||||||
"Plugins_Out_of": "out of",
|
"Plugins_Out_of": "out of",
|
||||||
"Plugins_Unprocessed_Events": "Unprocessed Events",
|
"Plugins_Unprocessed_Events": "Unprocessed Events",
|
||||||
|
|||||||
@@ -571,6 +571,7 @@
|
|||||||
"Plugins_DeleteAll": "Eliminar todo (se ignoran los filtros)",
|
"Plugins_DeleteAll": "Eliminar todo (se ignoran los filtros)",
|
||||||
"Plugins_Filters_Mac": "Filtro MAC",
|
"Plugins_Filters_Mac": "Filtro MAC",
|
||||||
"Plugins_History": "Historial de eventos",
|
"Plugins_History": "Historial de eventos",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Objetos del Plugin",
|
"Plugins_Objects": "Objetos del Plugin",
|
||||||
"Plugins_Out_of": "de",
|
"Plugins_Out_of": "de",
|
||||||
"Plugins_Unprocessed_Events": "Eventos sin procesar",
|
"Plugins_Unprocessed_Events": "Eventos sin procesar",
|
||||||
@@ -777,4 +778,4 @@
|
|||||||
"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>",
|
"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_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Guarda tus cambios antes de probar nuevos ajustes."
|
"test_event_tooltip": "Guarda tus cambios antes de probar nuevos ajustes."
|
||||||
}
|
}
|
||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Tout supprimer (ne prend pas en compte les filtres)",
|
"Plugins_DeleteAll": "Tout supprimer (ne prend pas en compte les filtres)",
|
||||||
"Plugins_Filters_Mac": "Filtrer par MAC",
|
"Plugins_Filters_Mac": "Filtrer par MAC",
|
||||||
"Plugins_History": "Historique des événements",
|
"Plugins_History": "Historique des événements",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Objets des plugins",
|
"Plugins_Objects": "Objets des plugins",
|
||||||
"Plugins_Out_of": "sur",
|
"Plugins_Out_of": "sur",
|
||||||
"Plugins_Unprocessed_Events": "Événements non traités",
|
"Plugins_Unprocessed_Events": "Événements non traités",
|
||||||
@@ -698,4 +699,4 @@
|
|||||||
"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>",
|
"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_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Enregistrer d'abord vos modifications avant de tester vôtre paramétrage."
|
"test_event_tooltip": "Enregistrer d'abord vos modifications avant de tester vôtre paramétrage."
|
||||||
}
|
}
|
||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Elimina tutti (i filtri vengono ignorati)",
|
"Plugins_DeleteAll": "Elimina tutti (i filtri vengono ignorati)",
|
||||||
"Plugins_Filters_Mac": "Filtro MAC",
|
"Plugins_Filters_Mac": "Filtro MAC",
|
||||||
"Plugins_History": "Storico eventi",
|
"Plugins_History": "Storico eventi",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Oggetti plugin",
|
"Plugins_Objects": "Oggetti plugin",
|
||||||
"Plugins_Out_of": "fuori da",
|
"Plugins_Out_of": "fuori da",
|
||||||
"Plugins_Unprocessed_Events": "Eventi non processati",
|
"Plugins_Unprocessed_Events": "Eventi non processati",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Slett alle (filtre blir ignorert)",
|
"Plugins_DeleteAll": "Slett alle (filtre blir ignorert)",
|
||||||
"Plugins_Filters_Mac": "Mac filter",
|
"Plugins_Filters_Mac": "Mac filter",
|
||||||
"Plugins_History": "Hendelses historikk",
|
"Plugins_History": "Hendelses historikk",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Plugin-objekter",
|
"Plugins_Objects": "Plugin-objekter",
|
||||||
"Plugins_Out_of": "ut av",
|
"Plugins_Out_of": "ut av",
|
||||||
"Plugins_Unprocessed_Events": "Uprosesserte hendelser",
|
"Plugins_Unprocessed_Events": "Uprosesserte hendelser",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Usuń wszystkie (filtry są ignorowane)",
|
"Plugins_DeleteAll": "Usuń wszystkie (filtry są ignorowane)",
|
||||||
"Plugins_Filters_Mac": "Filtr MAC",
|
"Plugins_Filters_Mac": "Filtr MAC",
|
||||||
"Plugins_History": "Historia Wydarzeń",
|
"Plugins_History": "Historia Wydarzeń",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Obiekty Wtyczek",
|
"Plugins_Objects": "Obiekty Wtyczek",
|
||||||
"Plugins_Out_of": "brakujące",
|
"Plugins_Out_of": "brakujące",
|
||||||
"Plugins_Unprocessed_Events": "Nieprzeprocesowane Wydarzenia",
|
"Plugins_Unprocessed_Events": "Nieprzeprocesowane Wydarzenia",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "",
|
"Plugins_DeleteAll": "",
|
||||||
"Plugins_Filters_Mac": "",
|
"Plugins_Filters_Mac": "",
|
||||||
"Plugins_History": "",
|
"Plugins_History": "",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "",
|
"Plugins_Objects": "",
|
||||||
"Plugins_Out_of": "",
|
"Plugins_Out_of": "",
|
||||||
"Plugins_Unprocessed_Events": "",
|
"Plugins_Unprocessed_Events": "",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "Удалить все (фильтры игнорируются)",
|
"Plugins_DeleteAll": "Удалить все (фильтры игнорируются)",
|
||||||
"Plugins_Filters_Mac": "Фильтр MAC-адреса",
|
"Plugins_Filters_Mac": "Фильтр MAC-адреса",
|
||||||
"Plugins_History": "История событий",
|
"Plugins_History": "История событий",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "Объекты плагина",
|
"Plugins_Objects": "Объекты плагина",
|
||||||
"Plugins_Out_of": "из",
|
"Plugins_Out_of": "из",
|
||||||
"Plugins_Unprocessed_Events": "Необработанные события",
|
"Plugins_Unprocessed_Events": "Необработанные события",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "",
|
"Plugins_DeleteAll": "",
|
||||||
"Plugins_Filters_Mac": "",
|
"Plugins_Filters_Mac": "",
|
||||||
"Plugins_History": "",
|
"Plugins_History": "",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "",
|
"Plugins_Objects": "",
|
||||||
"Plugins_Out_of": "",
|
"Plugins_Out_of": "",
|
||||||
"Plugins_Unprocessed_Events": "",
|
"Plugins_Unprocessed_Events": "",
|
||||||
|
|||||||
@@ -532,6 +532,7 @@
|
|||||||
"Plugins_DeleteAll": "全部删除(忽略过滤器)",
|
"Plugins_DeleteAll": "全部删除(忽略过滤器)",
|
||||||
"Plugins_Filters_Mac": "Mac 过滤器",
|
"Plugins_Filters_Mac": "Mac 过滤器",
|
||||||
"Plugins_History": "事件历史",
|
"Plugins_History": "事件历史",
|
||||||
|
"Plugins_Obj_DeleteListed": "",
|
||||||
"Plugins_Objects": "插件对象",
|
"Plugins_Objects": "插件对象",
|
||||||
"Plugins_Out_of": "",
|
"Plugins_Out_of": "",
|
||||||
"Plugins_Unprocessed_Events": "未处理的事件",
|
"Plugins_Unprocessed_Events": "未处理的事件",
|
||||||
|
|||||||
@@ -246,9 +246,6 @@ function getData(){
|
|||||||
|
|
||||||
generateTabs()
|
generateTabs()
|
||||||
|
|
||||||
// hide spinning icon
|
|
||||||
hideSpinner()
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -259,6 +256,8 @@ function getData(){
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function generateTabs()
|
function generateTabs()
|
||||||
{
|
{
|
||||||
|
showSpinner()
|
||||||
|
|
||||||
activetab = 'active'
|
activetab = 'active'
|
||||||
|
|
||||||
// clear previous headers data
|
// clear previous headers data
|
||||||
@@ -413,6 +412,8 @@ function generateTabs()
|
|||||||
</table>
|
</table>
|
||||||
<div class="plugin-obj-purge">
|
<div class="plugin-obj-purge">
|
||||||
<button class="btn btn-primary" onclick="purgeAll('${prefix}', 'Plugins_Objects' )"><?= lang('Plugins_DeleteAll');?></button>
|
<button class="btn btn-primary" onclick="purgeAll('${prefix}', 'Plugins_Objects' )"><?= lang('Plugins_DeleteAll');?></button>
|
||||||
|
<button class="btn btn-danger " onclick="deleteListed('${prefix}', 'Plugins_Objects' )"><?= lang('Plugins_Obj_DeleteListed');?></button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="eventsTarget_${prefix}" class="tab-pane">
|
<div id="eventsTarget_${prefix}" class="tab-pane">
|
||||||
@@ -492,6 +493,9 @@ function initTabs() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// hide spinning icon
|
||||||
|
hideSpinner()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -564,16 +568,19 @@ function purgeAllExecute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
function purgeVisible() {
|
function deleteListed(plugPrefix, dbTable) {
|
||||||
|
|
||||||
idArr = $(`#${plugPrefix} table[data-my-dbtable="${dbTable}"] tr[data-my-index]`).map(function(){return $(this).attr("data-my-index");}).get();
|
idArr = $(`#${plugPrefix} table[data-my-dbtable="${dbTable}"] tr[data-my-index]`).map(function(){return $(this).attr("data-my-index");}).get();
|
||||||
|
|
||||||
|
console.log(idArr);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "php/server/dbHelper.php",
|
url: "php/server/dbHelper.php",
|
||||||
data: { action: "delete", dbtable: dbTable, columnName: 'Index', id:idArr.toString() },
|
data: { action: "delete", dbtable: dbTable, columnName: 'Index', id:idArr.toString() },
|
||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
showModalOk ('Result', data );
|
updateApi("plugins_objects")
|
||||||
|
showModalOk ('Result', data );
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user