Compare commits

...

5 Commits

Author SHA1 Message Date
github-actions[bot]
2fb6e8fb12 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-06-30 11:53:49 +00:00
jokob-sk
15d16dcd81 📚Docs 2024-06-30 21:37:14 +10:00
jokob-sk
28a5b6af2a 📚Docs 2024-06-30 21:24:31 +10:00
jokob-sk
651b346a27 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-06-30 21:18:27 +10:00
jokob-sk
df90060adf 💻 Plugin Boilerplate update 2024-06-30 21:17:52 +10:00
6 changed files with 23 additions and 9 deletions

View File

@@ -1,9 +1,5 @@
## 🌟 Create a custom plugin: Overview
| ![Screen 1][screen1] | ![Screen 2][screen2] | ![Screen 3][screen3] |
|----------------------|----------------------| ----------------------|
| ![Screen 4][screen4] | ![Screen 5][screen5] |
NetAlertX comes with a plugin system to feed events from third-party scripts into the UI and then send notifications, if desired. The highlighted core functionality this plugin system supports, is:
* dynamic creation of a simple UI to interact with the discovered objects,
@@ -12,7 +8,19 @@ NetAlertX comes with a plugin system to feed events from third-party scripts int
* different column types for reported values to e.g. link back to a device
* import objects into existing NetAlertX database tables
> (Currently, update/overwriting of existing objects is not supported.)
> (Currently, update/overwriting of existing objects is only supported for devices via the `CurrentScan` table.)
### 🎥 Watch the video:
[![Watch the video](/docs/img/YouTube_thumbnail.png)](https://youtu.be/bjA7wIK_jXY)
### 📸 Screenshots
| ![Screen 1][screen1] | ![Screen 2][screen2] | ![Screen 3][screen3] |
|----------------------|----------------------| ----------------------|
| ![Screen 4][screen4] | ![Screen 5][screen5] |
## Use cases
Example use cases for plugins could be:

BIN
docs/img/YouTube_thumbnail.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

0
front/php/templates/language/it_it.json Normal file → Executable file
View File

View File

@@ -1,7 +1,7 @@
{
"code_name": "folder_name",
"unique_prefix": "",
"plugin_type": "scanner",
"code_name": "__template",
"unique_prefix": "TMP",
"plugin_type": "device_scanner",
"enabled": true,
"data_source": "script",
"mapped_to_table": "CurrentScan",

View File

@@ -59,7 +59,7 @@ def main():
extra = '',
foreignKey = device['mac_address'])
mylog('verbose', [f'[{pluginName}] New entries: "{len(new_devices)}"'])
mylog('verbose', [f'[{pluginName}] New entries: "{len(device_data)}"'])
# log result
plugin_objects.write_result_file()

View File

@@ -386,6 +386,12 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
// is this isn't a metadata entry, get corresponding metadata object from the dummy setting
const setObj = isMetadata ? {} : JSON.parse(getSetting(`${codeName}__metadata`));
// not initialized properly, reload
if(isMetadata && val == "" )
{
clearCache();
}
// constructing final HTML for the setting
setHtml = ""