Device-Groups are defined via a pattern using a similar syntax like Alert-Rules.
The groups are resolved OnDemand, means their members are not statically assigned.
Device-Groups are displayed in the Devices-Dropdown underneath the Types.
Device-Groups are managed in /device-groups/.
On creation of a new Alert-Rule, you can now define a set of devices and/or groups that the alert should apply to. This mapping can be altered afterwards via /alert-map/.
This PR is a draft. It requires indepth testing and a lot of clicking around.
I'm not a Web-Dev, Please keep an eye on your browser's console-log in case something break.
Feedback please :)
Force device_id of 0 for new alert-rules to use the maps.
Need to drop the DEFAULT from the sql update file.
Few scrut issues to at least take a look at, not sure they are 100% valid.
Scrut issues are mostly invalid. They refer to code-duplication in the ajax-forms.
Then a type-check that I'm willing to add. :)
Assign invalid `device_id` if a rule is created with a mapping.
Update rule to invalidate `device_id` if a map has been assigned afterwards.
Update rule to restore `device_id` if no more maps are assigned to it.
Remove all maps (if any) if a rule is deleted.
Fixed SQL bug
Remove stale alerts if a map has been changed or the device does not …
…match the group-criteria anymore
I'm happy to merge if you are @f0o