Detected sensors will be shown on the web
Former-commit-id: 6c942025a7ad2c8567ae4db97194ba9fef1a6611
This commit is contained in:
parent
26810e9b2c
commit
1ab72ffbc3
2 changed files with 30 additions and 4 deletions
|
|
@ -120,8 +120,9 @@ public class PCConfigureHttpPage extends HalHttpPage {
|
||||||
// Output
|
// Output
|
||||||
Templator tmpl = new Templator(FileUtil.find("web-resource/configure.tmpl"));
|
Templator tmpl = new Templator(FileUtil.find("web-resource/configure.tmpl"));
|
||||||
tmpl.set("user", localUser);
|
tmpl.set("user", localUser);
|
||||||
tmpl.set("localSensor", Sensor.getLocalSensors(db));
|
tmpl.set("localSensors", Sensor.getLocalSensors(db));
|
||||||
tmpl.set("localSensorConf", sensorConfigurations);
|
tmpl.set("localSensorConf", sensorConfigurations);
|
||||||
|
tmpl.set("detectedSensors", ControllerManager.getInstance().getDetectedSensors());
|
||||||
tmpl.set("extUsers", User.getExternalUsers(db));
|
tmpl.set("extUsers", User.getExternalUsers(db));
|
||||||
tmpl.set("extSensor", Sensor.getExternalSensors(db));
|
tmpl.set("extSensor", Sensor.getExternalSensors(db));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
</button>
|
</button>
|
||||||
</th>
|
</th>
|
||||||
</thead>
|
</thead>
|
||||||
{{#localSensor}}
|
{{#localSensors}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{.name}}</td>
|
<td>{{.name}}</td>
|
||||||
<td>{{.type}}</td>
|
<td>{{.type}}</td>
|
||||||
|
|
@ -76,7 +76,32 @@
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/localSensor}}
|
{{/localSensors}}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<p>Sensors that has been automatically detected.</p>
|
||||||
|
<table class="table table-hover table-condensed">
|
||||||
|
<thead>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Configuration</th>
|
||||||
|
</thead>
|
||||||
|
{{#detectedSensors}}
|
||||||
|
<tr>
|
||||||
|
<td>{{.getClass().getName()}}</td>
|
||||||
|
<td>{{.}}</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-toolbar pull-right">
|
||||||
|
<button type="button" class="btn btn-default btn-xs" data-toggle="modal"
|
||||||
|
data-target="#sensorModal"
|
||||||
|
data-type="{{.type}}"
|
||||||
|
data-config="{{.config}}">
|
||||||
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/detectedSensors}}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -193,7 +218,7 @@
|
||||||
// Update dynamic inputs
|
// Update dynamic inputs
|
||||||
$("#sensorModal #sensor-data-conf").html(sensorDataConf[$(this).val()]);
|
$("#sensorModal #sensor-data-conf").html(sensorDataConf[$(this).val()]);
|
||||||
});
|
});
|
||||||
// event
|
// click event
|
||||||
$("#sensorModal").on('show.bs.modal', function (event) {
|
$("#sensorModal").on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue