Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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`
Expand All @@ -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.

![Action target](./img/WORKFLOWS/actions_target.png)

#### Example Action:

- **Action Type**: `update_field`

- **Field**: `devIsNew`
- **Value**: `0`

Expand Down
Binary file added docs/img/WORKFLOWS/actions_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions front/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions front/plugins/kea_api/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
Loading