Added scan button to controller section
This commit is contained in:
parent
e662f7e29d
commit
6656882859
4 changed files with 34 additions and 13 deletions
|
|
@ -19,8 +19,8 @@
|
|||
<td>{{#.getDescription()}}{{.getDescription()}}{{/.getDescription()}}</td>
|
||||
<td>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="modify">
|
||||
<input type="hidden" name="action_id" value="{{.getName()}}">
|
||||
<input type="hidden" name="action" value="plugin_enable">
|
||||
<input type="hidden" name="plugin_name" value="{{.getName()}}">
|
||||
|
||||
<div class="btn-toolbar pull-right">
|
||||
<input class="toggle-switch" type="checkbox" name="enabled"
|
||||
|
|
@ -44,10 +44,23 @@
|
|||
<table class="table table-hover table-condensed">
|
||||
<thead>
|
||||
<th class="col-md-3">Name</th>
|
||||
<th class="col-md-1 text-right">Actions</th>
|
||||
</thead>
|
||||
{{#controllers}}
|
||||
<tr>
|
||||
<td>{{.getClass().getName()}}</td>
|
||||
<td>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="controller_scan">
|
||||
<input type="hidden" name="controller" value="{{.getClass().getName()}}">
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-xs" style="padding: 1px 20px;">
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/controllers}}
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public abstract class HalAbstractControllerManager<T extends HalAbstractControll
|
|||
/**
|
||||
* Registers a device configuration class type as usable by this manager
|
||||
*/
|
||||
protected void addAvailableDeviceConfig(Class<? extends C> deviceConfigClass) {
|
||||
public void addAvailableDeviceConfig(Class<? extends C> deviceConfigClass) {
|
||||
if (!availableDeviceConfigs.contains(deviceConfigClass))
|
||||
availableDeviceConfigs.add(deviceConfigClass);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ public class PluginConfigWebPage extends HalWebPage {
|
|||
throws Exception{
|
||||
|
||||
if (request.containsKey("action")) {
|
||||
String name = request.get("action_id");
|
||||
switch (request.get("action")) {
|
||||
case "plugin_enable":
|
||||
String name = request.get("plugin_name");
|
||||
|
||||
if (!name.equals("Hal-Core")) {
|
||||
HalServer.enablePlugin(name,
|
||||
|
|
@ -46,6 +48,12 @@ public class PluginConfigWebPage extends HalWebPage {
|
|||
HalAlertManager.getInstance().addAlert(new UserMessage(
|
||||
MessageLevel.ERROR, "Hal-Core cannot be disabled as it is critical component of Hal.", MessageTTL.ONE_VIEW));
|
||||
}
|
||||
break;
|
||||
|
||||
case "controller_scan":
|
||||
String controllerName = request.get("controller");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
List<HalAbstractController> controllers = new LinkedList<>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue