Added clear detected events button

This commit is contained in:
Ziver Koc 2018-12-03 19:13:27 +01:00
parent a3a7409808
commit 88d2b2cebf
4 changed files with 19 additions and 0 deletions

View file

@ -59,6 +59,13 @@
<th>Date</th>
<th>Data</th>
<th>Configuration</th>
<th>
<form method="POST">
<button type="submit" class="btn btn-danger btn-xs pull-right" name="action" value="remove_all_detected_events">
<span class="glyphicon glyphicon-trash"></span>
</button>
</form>
</th>
</thead>
{{#detectedEvents}}
<tr>

View file

@ -61,6 +61,7 @@
<th>Type</th>
<th>Date</th>
<th>Data</th>
<th>Configuration</th>
<th>
<form method="POST">
<button type="submit" class="btn btn-danger btn-xs pull-right" name="action" value="remove_all_detected_sensors">

View file

@ -265,6 +265,13 @@ public class ControllerManager implements HalSensorReportListener,
return detectedEvents;
}
/**
* Removes all auto detected events.
*/
public void clearDetectedEvents(){
detectedEvents.clear();
}
/**
* Called by Controllers to report received Event data
*/

View file

@ -85,6 +85,10 @@ public class EventConfigHttpPage extends HalHttpPage {
AlertLevel.ERROR, "Unknown event id: "+id, AlertTTL.ONE_VIEW));
}
break;
case "remove_all_detected_events":
ControllerManager.getInstance().clearDetectedEvents();
break;
}
}