Builder View Fix for Collection Selector (#11290)

* Builder View Fix for Collection Selector

* change rule, to set priority on builder rule like in backend code

* builder key existance verification

* Update alert_rule_collection.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
SourceDoctor
2020-03-24 12:11:12 +01:00
committed by GitHub
parent 40062e0e08
commit 8263046c00

View File

@@ -23,6 +23,8 @@
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
use LibreNMS\Alerting\QueryBuilderParser;
if (!Auth::user()->hasGlobalAdmin()) {
die('ERROR: You need to be admin');
}
@@ -53,7 +55,9 @@ if (!Auth::user()->hasGlobalAdmin()) {
echo "
<tr>
<td>{$rule['name']}</td>
<td>{$rule['rule']}</td>
<td>";
echo !empty($rule['builder']) ? QueryBuilderParser::fromJson($rule['builder'])->toSql(false) : $rule['rule'];
echo " </td>
<td>{$rule['rule_id']}</td>
</tr>
";