mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-06-20 22:30:11 -04:00
Merge pull request #1676 from netalertx/next_release
BE: css + docs for WF
This commit is contained in:
@@ -23,6 +23,7 @@ Triggers define the event that activates a workflow. They monitor changes to obj
|
||||
> Workflows not running? Check the [Workflows debugging](./WORKFLOWS_DEBUGGING.md) guide how to troubleshoot triggers and conditions.
|
||||
|
||||
#### Example Trigger:
|
||||
|
||||
- **Object Type**: `Devices`
|
||||
- **Event Type**: `update`
|
||||
|
||||
@@ -38,7 +39,9 @@ Conditions determine whether a workflow should proceed based on certain criteria
|
||||
> To better understand how to use specific Device fields, please read through the [Database overview](./DATABASE.md) guide.
|
||||
|
||||
#### Example Condition:
|
||||
|
||||
- **Logic**: `AND`
|
||||
|
||||
- **Field**: `devVendor`
|
||||
- **Operator**: `contains` (case in-sensitive)
|
||||
- **Value**: `Google`
|
||||
@@ -53,8 +56,16 @@ Actions define the tasks that the workflow will perform once the conditions are
|
||||
|
||||
You can include multiple actions that should execute once the conditions are met.
|
||||
|
||||
#### Target device for the Actions
|
||||
|
||||
You can change the target of the actions of the workflows. You can either target the device that triggered by selecting the **Apply action to** to `triggering_device`, or target multiple devices by selecting `query` in the **Apply action to** dropdown.
|
||||
|
||||

|
||||
|
||||
#### Example Action:
|
||||
|
||||
- **Action Type**: `update_field`
|
||||
|
||||
- **Field**: `devIsNew`
|
||||
- **Value**: `0`
|
||||
|
||||
|
||||
BIN
docs/img/WORKFLOWS/actions_target.png
Normal file
BIN
docs/img/WORKFLOWS/actions_target.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@@ -2441,6 +2441,12 @@ textarea[readonly],
|
||||
color: var(--color-green) !important;
|
||||
}
|
||||
|
||||
.workflows .add-condition, .workflows .add-condition-group, .workflows .add-target-condition
|
||||
{
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.workflows .action-target-conditions
|
||||
{
|
||||
opacity: 0.8;
|
||||
|
||||
@@ -40,14 +40,14 @@ def main():
|
||||
if entry['result'] == 0:
|
||||
leases = entry['arguments']['leases']
|
||||
for lease in leases:
|
||||
mac = lease['hw-address']
|
||||
mac = lease['hw-address']
|
||||
state = lease['state']
|
||||
if is_mac(mac):
|
||||
plugin_objects.add_object(
|
||||
primaryId = mac,
|
||||
secondaryId = lease['ip-address'],
|
||||
# Active or not, similar to watched1 of DHCPLSS plugin
|
||||
watched1 = state == 0,
|
||||
watched1 = state == 0,
|
||||
watched2 = lease['hostname'],
|
||||
watched3 = None,
|
||||
# Default (or assigned) (0), declined (1), expired-reclaimed (2), released (3), and registered (4)).
|
||||
|
||||
Reference in New Issue
Block a user