mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Disable plugins that have errors (#14383)
* Disable plugins that have errors Disable plugin if a hook throws an error and set a notification Move notification code to class, so we can access it Clear notification when plugin is attempted to be enabled again * fix style and lint fixes * another lint fix and handle if property is missing
This commit is contained in:
@@ -28,6 +28,24 @@ class Notification extends Model
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = 'notifications_id';
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'body',
|
||||
'severity',
|
||||
'source',
|
||||
'checksum',
|
||||
'datetime',
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
// delete attribs for this notification
|
||||
static::deleting(function (Notification $notification) {
|
||||
$notification->attribs()->delete();
|
||||
});
|
||||
}
|
||||
|
||||
// ---- Helper Functions ----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user