Enumerate AlertState (#11665)

* Enumerate AlertState

* fix typo

* add missing use's

* .

* .
This commit is contained in:
SourceDoctor
2020-05-23 21:14:36 -05:00
committed by GitHub
parent b8c6769049
commit b89eb22cd5
46 changed files with 163 additions and 90 deletions
+2 -1
View File
@@ -26,6 +26,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use LibreNMS\Enum\AlertState;
class AlertRule extends BaseModel
{
@@ -52,7 +53,7 @@ class AlertRule extends BaseModel
{
return $query->enabled()
->join('alerts', 'alerts.rule_id', 'alert_rules.id')
->whereNotIn('alerts.state', [0, 2]);
->whereNotIn('alerts.state', [AlertState::CLEAR, AlertState::ACKNOWLEDGED, AlertState::RECOVERED]);
}
/**