diff --git a/docs/WORKFLOWS.md b/docs/WORKFLOWS.md index 60d9b4d0..254f9c45 100755 --- a/docs/WORKFLOWS.md +++ b/docs/WORKFLOWS.md @@ -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. + +![Action target](./img/WORKFLOWS/actions_target.png) + #### Example Action: + - **Action Type**: `update_field` + - **Field**: `devIsNew` - **Value**: `0` diff --git a/docs/img/WORKFLOWS/actions_target.png b/docs/img/WORKFLOWS/actions_target.png new file mode 100644 index 00000000..fb15f1f7 Binary files /dev/null and b/docs/img/WORKFLOWS/actions_target.png differ diff --git a/front/css/app.css b/front/css/app.css index 7f5a43b0..dc2a4652 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -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; diff --git a/front/plugins/kea_api/script.py b/front/plugins/kea_api/script.py index 9128eed5..2f418d9c 100644 --- a/front/plugins/kea_api/script.py +++ b/front/plugins/kea_api/script.py @@ -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)).