mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-18 00:10:20 +00:00
New edit device in testing
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>4beta2.6</version>
|
<version>4beta2.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -408,6 +408,20 @@ app.service ('bridgeService', function ($http, $window, ngToast) {
|
|||||||
return newDevices
|
return newDevices
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateCallObjectsType = function (theDevices) {
|
||||||
|
var i, s, type, len = theDevices.length
|
||||||
|
for (i=0; i<len; ++i) {
|
||||||
|
if (i in theDevices) {
|
||||||
|
s = theDevices[i];
|
||||||
|
if (s.type !== null)
|
||||||
|
type = self.getMapType(s.type[0])
|
||||||
|
s.type = type[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return theDevices
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.viewMapTypes = function () {
|
this.viewMapTypes = function () {
|
||||||
return $http.get(this.state.base + "/map/types").then(
|
return $http.get(this.state.base + "/map/types").then(
|
||||||
function (response) {
|
function (response) {
|
||||||
@@ -473,7 +487,7 @@ app.service ('bridgeService', function ($http, $window, ngToast) {
|
|||||||
this.addDevice = function (aDevice) {
|
this.addDevice = function (aDevice) {
|
||||||
var device = {};
|
var device = {};
|
||||||
angular.extend(device, aDevice );
|
angular.extend(device, aDevice );
|
||||||
if (device.httpVerb !== null && device.httpVerb !== "")
|
if (device.deviceType === null || device.deviceType === "")
|
||||||
device.deviceType = "custom";
|
device.deviceType = "custom";
|
||||||
if (device.targetDevice === null || device.targetDevice === "")
|
if (device.targetDevice === null || device.targetDevice === "")
|
||||||
device.targetDevice = "Encapsulated";
|
device.targetDevice = "Encapsulated";
|
||||||
@@ -2052,9 +2066,13 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
|
|||||||
$scope.bridge = bridgeService.state;
|
$scope.bridge = bridgeService.state;
|
||||||
$scope.device = $scope.bridge.device;
|
$scope.device = $scope.bridge.device;
|
||||||
$scope.onDevices = bridgeService.getCallObjects($scope.bridge.device.onUrl);
|
$scope.onDevices = bridgeService.getCallObjects($scope.bridge.device.onUrl);
|
||||||
|
$scope.newOnItem = [];
|
||||||
|
$scope.dimDevices = bridgeService.getCallObjects($scope.bridge.device.dimUrl);
|
||||||
|
$scope.newDimItem = [];
|
||||||
|
$scope.offDevices = bridgeService.getCallObjects($scope.bridge.device.offUrl);
|
||||||
|
$scope.newOffItem = [];
|
||||||
$scope.mapTypeSelected = bridgeService.getMapType($scope.device.mapType);
|
$scope.mapTypeSelected = bridgeService.getMapType($scope.device.mapType);
|
||||||
$scope.device_dim_control = "";
|
$scope.device_dim_control = "";
|
||||||
$scope.bulk = { devices: [] };
|
|
||||||
$scope.imgButtonsUrl = "glyphicon glyphicon-plus";
|
$scope.imgButtonsUrl = "glyphicon glyphicon-plus";
|
||||||
$scope.buttonsVisible = false;
|
$scope.buttonsVisible = false;
|
||||||
|
|
||||||
@@ -2067,6 +2085,9 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
|
|||||||
if($scope.device.name === "" && $scope.device.onUrl === "")
|
if($scope.device.name === "" && $scope.device.onUrl === "")
|
||||||
return;
|
return;
|
||||||
$scope.device.mapType = $scope.mapTypeSelected[0];
|
$scope.device.mapType = $scope.mapTypeSelected[0];
|
||||||
|
$scope.device.onUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.onDevices));
|
||||||
|
$scope.device.dimUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.dimDevices));
|
||||||
|
$scope.device.offUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.offDevices));
|
||||||
bridgeService.addDevice($scope.device).then(
|
bridgeService.addDevice($scope.device).then(
|
||||||
function () {
|
function () {
|
||||||
$scope.clearDevice();
|
$scope.clearDevice();
|
||||||
@@ -2088,6 +2109,10 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.device.id = null;
|
$scope.device.id = null;
|
||||||
|
$scope.device.mapType = $scope.mapTypeSelected[0];
|
||||||
|
$scope.device.onUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.onDevices));
|
||||||
|
$scope.device.dimUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.dimDevices));
|
||||||
|
$scope.device.offUrl = angular.toJson(bridgeService.updateCallObjectsType($scope.offDevices));
|
||||||
bridgeService.addDevice($scope.device).then(
|
bridgeService.addDevice($scope.device).then(
|
||||||
function () {
|
function () {
|
||||||
$scope.clearDevice();
|
$scope.clearDevice();
|
||||||
@@ -2097,7 +2122,50 @@ app.controller('EditController', function ($scope, $location, $http, bridgeServi
|
|||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
$scope.addItemOn = function (anItem) {
|
||||||
|
if (anItem.item === null || anItem.item === "")
|
||||||
|
return;
|
||||||
|
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
|
||||||
|
$scope.onDevices.push(newitem);
|
||||||
|
$scope.newOnItem = [];
|
||||||
|
};
|
||||||
|
$scope.removeItemOn = function (anItem) {
|
||||||
|
for(var i = $scope.onDevices.length - 1; i >= 0; i--) {
|
||||||
|
if($scope.onDevices[i].item === anItem.item && $scope.onDevices[i].type === anItem.type) {
|
||||||
|
$scope.onDevices.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.addItemDim = function (anItem) {
|
||||||
|
if (anItem.item === null || anItem.item === "")
|
||||||
|
return;
|
||||||
|
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
|
||||||
|
$scope.dimDevices.push(newitem);
|
||||||
|
$scope.newDimItem = [];
|
||||||
|
};
|
||||||
|
$scope.removeItemDim = function (anItem) {
|
||||||
|
for(var i = $scope.dimDevices.length - 1; i >= 0; i--) {
|
||||||
|
if($scope.dimDevices[i].item === anItem.item && $scope.dimDevices[i].type === anItem.type) {
|
||||||
|
$scope.dimDevices.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.addItemOff = function (anItem) {
|
||||||
|
if (anItem.item === null || anItem.item === "")
|
||||||
|
return;
|
||||||
|
var newitem = { item: anItem.item, type: anItem.type, delay: anItem.delay, count: anItem.count, filterIPs: anItem.filterIPs, httpVerb: anItem.httpVerb, httpBody: anItem.httpBody, httpHeaders: anItem.httpHeaders, contentType: anItem.contentType };
|
||||||
|
$scope.offDevices.push(newitem);
|
||||||
|
$scope.newOffItem = [];
|
||||||
|
};
|
||||||
|
$scope.removeItemOff = function (anItem) {
|
||||||
|
for(var i = $scope.offDevices.length - 1; i >= 0; i--) {
|
||||||
|
if($scope.offDevices[i].item === anItem.item && $scope.offDevices[i].type === anItem.type) {
|
||||||
|
$scope.offDevices.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
app.filter('availableHarmonyActivityId', function(bridgeService) {
|
app.filter('availableHarmonyActivityId', function(bridgeService) {
|
||||||
|
|||||||
@@ -33,32 +33,35 @@
|
|||||||
point device.</p>
|
point device.</p>
|
||||||
<p>When copying, update the name and select the "Add Bridge
|
<p>When copying, update the name and select the "Add Bridge
|
||||||
Device" Button.</p>
|
Device" Button.</p>
|
||||||
</div>
|
|
||||||
<form class="form-horizontal">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-name">Name</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<form name="form">
|
||||||
|
<p>
|
||||||
|
<button class="btn btn-primary" ng-click="copyDevice()">Add Bridge Device</button>
|
||||||
|
<button type="submit" class="col-xs-4 col-sm-2 btn btn-success" ng-click="addDevice()">Update Bridge Device</button>
|
||||||
|
<button class="btn btn-danger" ng-click="clearDevice()">Clear Device</button>
|
||||||
|
</p>
|
||||||
|
<table class="table table-bordered table-striped table-hover">
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-name">Name</label></td>
|
||||||
|
|
||||||
|
<td>
|
||||||
<input type="text" class="form-control" id="device-name"
|
<input type="text" class="form-control" id="device-name"
|
||||||
ng-model="device.name" placeholder="Device Name">
|
ng-model="device.name" placeholder="Device Name">
|
||||||
</div>
|
</td>
|
||||||
<button type="submit" class="col-xs-4 col-sm-2 btn btn-success"
|
</tr>
|
||||||
ng-click="addDevice()">Update Bridge Device</button>
|
<tr>
|
||||||
</div>
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-target">Target</label></td>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-target">Target</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<input type="text" class="form-control" id="device-target"
|
<input type="text" class="form-control" id="device-target"
|
||||||
ng-model="device.targetDevice" placeholder="default">
|
ng-model="device.targetDevice" placeholder="default">
|
||||||
</div>
|
</td>
|
||||||
<button class="btn btn-primary" ng-click="copyDevice()">Add Bridge Device</button>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-type">Device Type</label></td>
|
||||||
<div class="row">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-type">Device Type</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<select name="device-type" id="device-type"
|
<select name="device-type" id="device-type"
|
||||||
ng-model="device.deviceType">
|
ng-model="device.deviceType">
|
||||||
<option value="">---Types if needed---</option>
|
<option value="">---Types if needed---</option>
|
||||||
@@ -76,41 +79,36 @@
|
|||||||
<option value="thermo">Thermo</option>
|
<option value="thermo">Thermo</option>
|
||||||
<option value="passthru">Pass Thru</option>
|
<option value="passthru">Pass Thru</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div class="row">
|
for="device-map-type">Map Type</label></td>
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-map-type">Map Type</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="mapTypeSelected"></select>
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="mapTypeSelected"></select>
|
||||||
</div>
|
</td>
|
||||||
<button class="btn btn-danger" ng-click="clearDevice()">Clear Device</button>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-unique-id">Unique Id (used for Hue responses)</label></td>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-unique-id">Unique Id (used for Hue responses)</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<input type="text" class="form-control" id="device-unique-id"
|
<input type="text" class="form-control" id="device-unique-id"
|
||||||
ng-model="device.uniqueid" placeholder="AA:BB:CC:DD:EE:FF-XX" readonly>
|
ng-model="device.uniqueid" placeholder="AA:BB:CC:DD:EE:FF-XX" readonly>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div ng-if="device.mapType" class="form-group">
|
<tr>
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-map-id">Map ID</label>
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-map-id">Map ID</label></td>
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<input type="text" class="form-control" id="device-map-id"
|
<input type="text" class="form-control" id="device-map-id"
|
||||||
ng-model="device.mapId" placeholder="1111">
|
ng-model="device.mapId" placeholder="1111">
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div class="form-group">
|
<tr>
|
||||||
<div class="row">
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-on-url">On Items</label></td>
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-on-url">On Items</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<scrollable-table watch="onDevices">
|
<scrollable-table watch="onDevices">
|
||||||
<table class="table table-bordered table-striped table-hover">
|
<table class="table table-bordered table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -124,22 +122,23 @@
|
|||||||
<th>Http Body</th>
|
<th>Http Body</th>
|
||||||
<th>Http Headers</th>
|
<th>Http Headers</th>
|
||||||
<th>Content Type</th>
|
<th>Content Type</th>
|
||||||
|
<th>Manage</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="anItem in onDevices">
|
<tr ng-repeat="onItem in onDevices">
|
||||||
<td>
|
<td>
|
||||||
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="anItem.type"></select>
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="onItem.type"></select>
|
||||||
</td>
|
</td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-target"
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
ng-model="anItem.item" placeholder="Target Desc"></textarea></td>
|
ng-model="onItem.item" placeholder="The Call"></textarea></td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-delay"
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
ng-model="anItem.delay" placeholder="Delay millis"></textarea></td>
|
ng-model="onItem.delay" placeholder="millis"></textarea></td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-count"
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
ng-model="anItem.count" placeholder="Delay millis"></textarea></td>
|
ng-model="onItem.count" placeholder="number"></textarea></td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-filterIPs"
|
<td><textarea rows="1" cols="16"class="form-control" id="item-filterIPs"
|
||||||
ng-model="anItem.filterIPs" placeholder="Delay millis"></textarea></td>
|
ng-model="onItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="item-http-verb" id="item-http-verb" ng-model="anItem.httpVerb">
|
<select name="item-http-verb" id="item-http-verb" ng-model="onItem.httpVerb">
|
||||||
<option value="">---Please select---</option>
|
<option value="">---Please select---</option>
|
||||||
<!-- not selected / blank option -->
|
<!-- not selected / blank option -->
|
||||||
<option value="GET">GET</option>
|
<option value="GET">GET</option>
|
||||||
@@ -147,13 +146,13 @@
|
|||||||
<option value="POST">POST</option>
|
<option value="POST">POST</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-httpBody"
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
ng-model="anItem.httpBody" placeholder="Delay millis"></textarea></td>
|
ng-model="onItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
<td><textarea rows="1" class="form-control" id="item-httpHeaders"
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
ng-model="anItem.httpHeaders" placeholder="Delay millis"></textarea></td>
|
ng-model="onItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="item-content-type" id="item-content-type"
|
<select name="item-content-type" id="item-content-type"
|
||||||
ng-model="item.contentType">
|
ng-model="onItem.contentType">
|
||||||
<option value="">---Please select---</option>
|
<option value="">---Please select---</option>
|
||||||
<!-- not selected / blank option -->
|
<!-- not selected / blank option -->
|
||||||
<option value="application/atom+xml">application/atom+xml</option>
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
@@ -171,49 +170,315 @@
|
|||||||
<option value="*/*">*/*</option>
|
<option value="*/*">*/*</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
<td><button class="btn btn-danger" type="submit"
|
||||||
|
ng-click="removeItemOn(onItem)">Del</button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="newOnItem.type"></select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
|
ng-model="newOnItem.item" placeholder="The Call"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
|
ng-model="newOnItem.delay" placeholder="millis"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
|
ng-model="newOnItem.count" placeholder="number"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-filterIPs"
|
||||||
|
ng-model="newOnItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-http-verb" id="item-http-verb" ng-model="newOnItem.httpVerb">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
|
ng-model="newOnItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
|
ng-model="newOnItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-content-type" id="item-content-type"
|
||||||
|
ng-model="newOnItem.contentType">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
|
<option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
|
||||||
|
<option value="application/json">application/json</option>
|
||||||
|
<option value="application/octet-stream">application/octet-stream</option>
|
||||||
|
<option value="application/svg+xml">application/svg+xml</option>
|
||||||
|
<option value="application/xhtml+xml">application/xhtml+xml</option>
|
||||||
|
<option value="application/xml">application/xml</option>
|
||||||
|
<option value="*">*</option>
|
||||||
|
<option value="multipart/form-data">multipart/form-data</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
<option value="text/plain">text/plain</option>
|
||||||
|
<option value="text/xml">text/xml</option>
|
||||||
|
<option value="*/*">*/*</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><button class="btn btn-success" type="submit"
|
||||||
|
ng-click="addItemOn(newOnItem)">Add</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</scrollable-table>
|
</scrollable-table>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-dim-url">Dim Items</label></td>
|
||||||
<div class="row">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-dim-url">Dim Items</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control" id="device-dim-url"
|
<scrollable-table watch="dimDevices">
|
||||||
ng-model="device.dimUrl" placeholder="URL to dim device"></textarea>
|
<table class="table table-bordered table-striped table-hover">
|
||||||
</div>
|
<thead>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<th>Type</th>
|
||||||
<div class="form-group">
|
<th>Target Item</th>
|
||||||
<div class="row">
|
<th>Delay</th>
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-off-url">Off Items</label>
|
<th>Count</th>
|
||||||
|
<th>Filter IPs</th>
|
||||||
|
<th>Http Verb</th>
|
||||||
|
<th>Http Body</th>
|
||||||
|
<th>Http Headers</th>
|
||||||
|
<th>Content Type</th>
|
||||||
|
<th>Manage</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tr ng-repeat="dimItem in dimDevices">
|
||||||
|
<td>
|
||||||
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="dimItem.type"></select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
|
ng-model="dimItem.item" placeholder="The Call"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
|
ng-model="dimItem.delay" placeholder="millis"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
|
ng-model="dimItem.count" placeholder="number"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-filterIPs"
|
||||||
|
ng-model="dimItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-http-verb" id="item-http-verb" ng-model="dimItem.httpVerb">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
|
ng-model="dimItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
|
ng-model="dimItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-content-type" id="item-content-type"
|
||||||
|
ng-model="dimItem.contentType">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
|
<option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
|
||||||
|
<option value="application/json">application/json</option>
|
||||||
|
<option value="application/octet-stream">application/octet-stream</option>
|
||||||
|
<option value="application/svg+xml">application/svg+xml</option>
|
||||||
|
<option value="application/xhtml+xml">application/xhtml+xml</option>
|
||||||
|
<option value="application/xml">application/xml</option>
|
||||||
|
<option value="*">*</option>
|
||||||
|
<option value="multipart/form-data">multipart/form-data</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
<option value="text/plain">text/plain</option>
|
||||||
|
<option value="text/xml">text/xml</option>
|
||||||
|
<option value="*/*">*/*</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><button class="btn btn-danger" type="submit"
|
||||||
|
ng-click="removeItemDim(dimItem)">Del</button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="newDimItem.type"></select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
|
ng-model="newDimItem.item" placeholder="The Call"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
|
ng-model="newDimItem.delay" placeholder="millis"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
|
ng-model="newDimItem.count" placeholder="number"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-filterIPs"
|
||||||
|
ng-model="newDimItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-http-verb" id="item-http-verb" ng-model="newDimItem.httpVerb">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
|
ng-model="newDimItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
|
ng-model="newDimItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-content-type" id="item-content-type"
|
||||||
|
ng-model="newDimItem.contentType">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
|
<option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
|
||||||
|
<option value="application/json">application/json</option>
|
||||||
|
<option value="application/octet-stream">application/octet-stream</option>
|
||||||
|
<option value="application/svg+xml">application/svg+xml</option>
|
||||||
|
<option value="application/xhtml+xml">application/xhtml+xml</option>
|
||||||
|
<option value="application/xml">application/xml</option>
|
||||||
|
<option value="*">*</option>
|
||||||
|
<option value="multipart/form-data">multipart/form-data</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
<option value="text/plain">text/plain</option>
|
||||||
|
<option value="text/xml">text/xml</option>
|
||||||
|
<option value="*/*">*/*</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><button class="btn btn-success" type="submit"
|
||||||
|
ng-click="addItemDim(newDimItem)">Add</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</scrollable-table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-off-url">Off Items</label></td>
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control" id="device-off-url"
|
<scrollable-table watch="offDevices">
|
||||||
ng-model="device.offUrl" placeholder="URL to turn device off"></textarea>
|
<table class="table table-bordered table-striped table-hover">
|
||||||
</div>
|
<thead>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<th>Type</th>
|
||||||
<div class="form-group">
|
<th>Target Item</th>
|
||||||
<div class="row">
|
<th>Delay</th>
|
||||||
<label class="col-xs-12 col-sm-2 control-label" for="device-headers">HTTP Headers</label>
|
<th>Count</th>
|
||||||
|
<th>Filter IPs</th>
|
||||||
|
<th>Http Verb</th>
|
||||||
|
<th>Http Body</th>
|
||||||
|
<th>Http Headers</th>
|
||||||
|
<th>Content Type</th>
|
||||||
|
<th>Manage</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tr ng-repeat="offItem in offDevices">
|
||||||
|
<td>
|
||||||
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="offItem.type"></select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
|
ng-model="offItem.item" placeholder="The Call"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
|
ng-model="offItem.delay" placeholder="millis"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
|
ng-model="offItem.count" placeholder="number"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-filterIPs"
|
||||||
|
ng-model="offItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-http-verb" id="item-http-verb" ng-model="offItem.httpVerb">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
|
ng-model="offItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
|
ng-model="offItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-content-type" id="item-content-type"
|
||||||
|
ng-model="offItem.contentType">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
|
<option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
|
||||||
|
<option value="application/json">application/json</option>
|
||||||
|
<option value="application/octet-stream">application/octet-stream</option>
|
||||||
|
<option value="application/svg+xml">application/svg+xml</option>
|
||||||
|
<option value="application/xhtml+xml">application/xhtml+xml</option>
|
||||||
|
<option value="application/xml">application/xml</option>
|
||||||
|
<option value="*">*</option>
|
||||||
|
<option value="multipart/form-data">multipart/form-data</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
<option value="text/plain">text/plain</option>
|
||||||
|
<option value="text/xml">text/xml</option>
|
||||||
|
<option value="*/*">*/*</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><button class="btn btn-danger" type="submit"
|
||||||
|
ng-click="removeItemOff(offItem)">Del</button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<select ng-options="mapType as mapType[1] for mapType in bridge.mapTypes track by mapType[0]" ng-model="newOffItem.type"></select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="20" class="form-control" id="item-target"
|
||||||
|
ng-model="newOffItem.item" placeholder="The Call"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="4" class="form-control" id="item-delay"
|
||||||
|
ng-model="newOffItem.delay" placeholder="millis"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="2" class="form-control" id="item-count"
|
||||||
|
ng-model="newOffItem.count" placeholder="number"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-filterIPs"
|
||||||
|
ng-model="newOffItem.filterIPs" placeholder="restrict IPs"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-http-verb" id="item-http-verb" ng-model="newOffItem.httpVerb">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpBody"
|
||||||
|
ng-model="newOffItem.httpBody" placeholder="body args"></textarea></td>
|
||||||
|
<td><textarea rows="1" cols="16" class="form-control" id="item-httpHeaders"
|
||||||
|
ng-model="newOffItem.httpHeaders" placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea></td>
|
||||||
|
<td>
|
||||||
|
<select name="item-content-type" id="item-content-type"
|
||||||
|
ng-model="newOffItem.contentType">
|
||||||
|
<option value="">---Please select---</option>
|
||||||
|
<!-- not selected / blank option -->
|
||||||
|
<option value="application/atom+xml">application/atom+xml</option>
|
||||||
|
<option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
|
||||||
|
<option value="application/json">application/json</option>
|
||||||
|
<option value="application/octet-stream">application/octet-stream</option>
|
||||||
|
<option value="application/svg+xml">application/svg+xml</option>
|
||||||
|
<option value="application/xhtml+xml">application/xhtml+xml</option>
|
||||||
|
<option value="application/xml">application/xml</option>
|
||||||
|
<option value="*">*</option>
|
||||||
|
<option value="multipart/form-data">multipart/form-data</option>
|
||||||
|
<option value="text/html">text/html</option>
|
||||||
|
<option value="text/plain">text/plain</option>
|
||||||
|
<option value="text/xml">text/xml</option>
|
||||||
|
<option value="*/*">*/*</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><button class="btn btn-success" type="submit"
|
||||||
|
ng-click="addItemOff(newOffItem)">Add</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</scrollable-table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label class="col-xs-12 col-sm-2 control-label" for="device-headers">HTTP Headers</label></td>
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control" id="device-headers"
|
<textarea rows="3" class="form-control" id="device-headers"
|
||||||
ng-model="device.headers"
|
ng-model="device.headers"
|
||||||
placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea>
|
placeholder="format like: [{"name":"A name","value":"a value"}]"></textarea>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div class="row">
|
for="device-http-verb">Http Verb</label></td>
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-http-verb">Http Verb</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<select name="device-http-verb" id="device-http-verb"
|
<select name="device-http-verb" id="device-http-verb"
|
||||||
ng-model="device.httpVerb">
|
ng-model="device.httpVerb">
|
||||||
<option value="">---Please select---</option>
|
<option value="">---Please select---</option>
|
||||||
@@ -222,15 +487,13 @@
|
|||||||
<option value="PUT">PUT</option>
|
<option value="PUT">PUT</option>
|
||||||
<option value="POST">POST</option>
|
<option value="POST">POST</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div ng-if="device.httpVerb" class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div class="row">
|
for="device-content-type">Content Type</label></td>
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-content-type">Content Type</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<select name="device-content-type" id="device-content-type"
|
<select name="device-content-type" id="device-content-type"
|
||||||
ng-model="device.contentType">
|
ng-model="device.contentType">
|
||||||
<option value="">---Please select---</option>
|
<option value="">---Please select---</option>
|
||||||
@@ -249,47 +512,39 @@
|
|||||||
<option value="text/xml">text/xml</option>
|
<option value="text/xml">text/xml</option>
|
||||||
<option value="*/*">*/*</option>
|
<option value="*/*">*/*</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div ng-if="device.httpVerb" class="form-group">
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div class="row">
|
for="device-content-body">Content Body On</label></td>
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-content-body">Content Body On</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control" id="device-content-body"
|
<textarea rows="3" class="form-control" id="device-content-body"
|
||||||
ng-model="device.contentBody"
|
ng-model="device.contentBody"
|
||||||
placeholder="Content Body On for specific GET/PUT/POST type"></textarea>
|
placeholder="Content Body On for specific GET/PUT/POST type"></textarea>
|
||||||
</div>
|
</td>
|
||||||
<div class="clearfix visible-xs"></div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div ng-if="device.httpVerb" class="form-group">
|
for="device-content-body-dim">Content Body Dim</label></td>
|
||||||
<div class="row">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-content-body-dim">Content Body Dim</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control" id="device-content-body-dim"
|
<textarea rows="3" class="form-control" id="device-content-body-dim"
|
||||||
ng-model="device.contentBodyDim"
|
ng-model="device.contentBodyDim"
|
||||||
placeholder="Content Body Dim for specific GET/PUT/POST type"></textarea>
|
placeholder="Content Body Dim for specific GET/PUT/POST type"></textarea>
|
||||||
</div>
|
</td>
|
||||||
<div class="clearfix visible-xs"></div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<td><label class="col-xs-12 col-sm-2 control-label"
|
||||||
<div ng-if="device.httpVerb" class="form-group">
|
for="device-content-body-off">Content Body Off</label></td>
|
||||||
<div class="row">
|
|
||||||
<label class="col-xs-12 col-sm-2 control-label"
|
|
||||||
for="device-content-body-off">Content Body Off</label>
|
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<td>
|
||||||
<textarea rows="3" class="form-control"
|
<textarea rows="3" class="form-control"
|
||||||
id="device-content-body-off" ng-model="device.contentBodyOff"
|
id="device-content-body-off" ng-model="device.contentBodyOff"
|
||||||
placeholder="Content Body Off for specific GET/PUT/POST type"></textarea>
|
placeholder="Content Body Off for specific GET/PUT/POST type"></textarea>
|
||||||
</div>
|
</td>
|
||||||
<div class="clearfix visible-xs"></div>
|
</tr>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user