Skip to content

Commit 3752d74

Browse files
authored
Merge pull request #1676 from netalertx/next_release
BE: css + docs for WF
2 parents 4075aa4 + 65dc689 commit 3752d74

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

docs/WORKFLOWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Triggers define the event that activates a workflow. They monitor changes to obj
2323
> Workflows not running? Check the [Workflows debugging](./WORKFLOWS_DEBUGGING.md) guide how to troubleshoot triggers and conditions.
2424
2525
#### Example Trigger:
26+
2627
- **Object Type**: `Devices`
2728
- **Event Type**: `update`
2829

@@ -38,7 +39,9 @@ Conditions determine whether a workflow should proceed based on certain criteria
3839
> To better understand how to use specific Device fields, please read through the [Database overview](./DATABASE.md) guide.
3940
4041
#### Example Condition:
42+
4143
- **Logic**: `AND`
44+
4245
- **Field**: `devVendor`
4346
- **Operator**: `contains` (case in-sensitive)
4447
- **Value**: `Google`
@@ -53,8 +56,16 @@ Actions define the tasks that the workflow will perform once the conditions are
5356

5457
You can include multiple actions that should execute once the conditions are met.
5558

59+
#### Target device for the Actions
60+
61+
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.
62+
63+
![Action target](./img/WORKFLOWS/actions_target.png)
64+
5665
#### Example Action:
66+
5767
- **Action Type**: `update_field`
68+
5869
- **Field**: `devIsNew`
5970
- **Value**: `0`
6071

57.4 KB
Loading

front/css/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,12 @@ textarea[readonly],
24412441
color: var(--color-green) !important;
24422442
}
24432443

2444+
.workflows .add-condition, .workflows .add-condition-group, .workflows .add-target-condition
2445+
{
2446+
padding-top: 0.5em;
2447+
padding-bottom: 0.5em;
2448+
}
2449+
24442450
.workflows .action-target-conditions
24452451
{
24462452
opacity: 0.8;

front/plugins/kea_api/script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ def main():
4040
if entry['result'] == 0:
4141
leases = entry['arguments']['leases']
4242
for lease in leases:
43-
mac = lease['hw-address']
43+
mac = lease['hw-address']
4444
state = lease['state']
4545
if is_mac(mac):
4646
plugin_objects.add_object(
4747
primaryId = mac,
4848
secondaryId = lease['ip-address'],
4949
# Active or not, similar to watched1 of DHCPLSS plugin
50-
watched1 = state == 0,
50+
watched1 = state == 0,
5151
watched2 = lease['hostname'],
5252
watched3 = None,
5353
# Default (or assigned) (0), declined (1), expired-reclaimed (2), released (3), and registered (4)).

0 commit comments

Comments
 (0)