Added clear button for detected sensors

This commit is contained in:
Ziver Koc 2018-12-03 18:55:34 +01:00
parent 68e695da67
commit 208655b465
3 changed files with 18 additions and 1 deletions

View file

@ -60,7 +60,13 @@
<th>Type</th> <th>Type</th>
<th>Date</th> <th>Date</th>
<th>Data</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">
<span class="glyphicon glyphicon-trash"></span>
</button>
</form>
</th>
</thead> </thead>
{{#detectedSensors}} {{#detectedSensors}}
<tr> <tr>

View file

@ -132,6 +132,13 @@ public class ControllerManager implements HalSensorReportListener,
return detectedSensors; return detectedSensors;
} }
/**
* Removes all auto detected sensors.
*/
public void clearDetectedSensors(){
detectedSensors.clear();
}
/** /**
* Called by Controllers to report received Sensor data * Called by Controllers to report received Sensor data
*/ */

View file

@ -88,6 +88,10 @@ public class SensorConfigHttpPage extends HalHttpPage {
} }
break; break;
case "remove_all_detected_sensors":
ControllerManager.getInstance().clearDetectedSensors();
break;
// External Users // External Users
case "create_external_user": case "create_external_user":
user = new User(); user = new User();