mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-18 00:10:20 +00:00
Add lock id to device, adding download of backups
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>5.2.next_c</version>
|
<version>5.2.next_d</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -86,7 +86,10 @@ public class DeviceDescriptor{
|
|||||||
@SerializedName("onWhenDimPresent")
|
@SerializedName("onWhenDimPresent")
|
||||||
@Expose
|
@Expose
|
||||||
private boolean onWhenDimPresent;
|
private boolean onWhenDimPresent;
|
||||||
|
@SerializedName("lockDeviceId")
|
||||||
|
@Expose
|
||||||
|
private boolean lockDeviceId;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@@ -333,4 +336,12 @@ public class DeviceDescriptor{
|
|||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLockDeviceId() {
|
||||||
|
return lockDeviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLockDeviceId(boolean lockDeviceId) {
|
||||||
|
this.lockDeviceId = lockDeviceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,8 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
if (light.getOnUrl() != null)
|
if (light.getOnUrl() != null)
|
||||||
callItems = aGsonBuilder.fromJson(light.getOnUrl(), CallItem[].class);
|
callItems = aGsonBuilder.fromJson(light.getOnUrl(), CallItem[].class);
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
log.warn("Could not decode Json for url items to get Hue state for device: {}", light.getName());
|
log.warn("Could not decode Json for url items to get Hue state for device: {}",
|
||||||
|
light.getName());
|
||||||
callItems = null;
|
callItems = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
List<DeviceDescriptor> list = new ArrayList<DeviceDescriptor>(devices.values());
|
List<DeviceDescriptor> list = new ArrayList<DeviceDescriptor>(devices.values());
|
||||||
Iterator<DeviceDescriptor> deviceIterator = list.iterator();
|
Iterator<DeviceDescriptor> deviceIterator = list.iterator();
|
||||||
Map<String, DeviceDescriptor> newdevices = new HashMap<String, DeviceDescriptor>();
|
Map<String, DeviceDescriptor> newdevices = new HashMap<String, DeviceDescriptor>();
|
||||||
;
|
|
||||||
nextId = seedId;
|
nextId = seedId;
|
||||||
String hexValue;
|
String hexValue;
|
||||||
Integer newValue;
|
Integer newValue;
|
||||||
@@ -209,17 +210,19 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
log.debug("Renumber devices with seed: {}", seedId);
|
log.debug("Renumber devices with seed: {}", seedId);
|
||||||
while (deviceIterator.hasNext()) {
|
while (deviceIterator.hasNext()) {
|
||||||
theDevice = deviceIterator.next();
|
theDevice = deviceIterator.next();
|
||||||
theDevice.setId(String.valueOf(nextId));
|
if (!theDevice.isLockDeviceId()) {
|
||||||
newValue = nextId % 256;
|
theDevice.setId(String.valueOf(nextId));
|
||||||
if (newValue <= 0)
|
newValue = nextId % 256;
|
||||||
newValue = 1;
|
if (newValue <= 0)
|
||||||
else if (newValue > 255)
|
newValue = 1;
|
||||||
newValue = 255;
|
else if (newValue > 255)
|
||||||
hexValue = HexLibrary.encodeUsingBigIntegerToString(newValue.toString());
|
newValue = 255;
|
||||||
|
hexValue = HexLibrary.encodeUsingBigIntegerToString(newValue.toString());
|
||||||
|
|
||||||
theDevice.setUniqueid("00:17:88:5E:D3:" + hexValue + "-" + hexValue);
|
theDevice.setUniqueid("00:17:88:5E:D3:" + hexValue + "-" + hexValue);
|
||||||
|
nextId++;
|
||||||
|
}
|
||||||
newdevices.put(theDevice.getId(), theDevice);
|
newdevices.put(theDevice.getId(), theDevice);
|
||||||
nextId++;
|
|
||||||
}
|
}
|
||||||
devices = newdevices;
|
devices = newdevices;
|
||||||
String jsonValue = gson.toJson(findAll());
|
String jsonValue = gson.toJson(findAll());
|
||||||
|
|||||||
@@ -385,6 +385,22 @@ public class DeviceResource {
|
|||||||
return deviceRepository.getBackups();
|
return deviceRepository.getBackups();
|
||||||
}, new JsonTransformer());
|
}, new JsonTransformer());
|
||||||
|
|
||||||
|
// http://ip_address:port/api/devices/backup/download CORS request
|
||||||
|
options(API_CONTEXT + "/backup/download", "application/json", (request, response) -> {
|
||||||
|
response.status(HttpStatus.SC_OK);
|
||||||
|
response.header("Access-Control-Allow-Origin", request.headers("Origin"));
|
||||||
|
response.header("Access-Control-Allow-Methods", "PUT");
|
||||||
|
response.header("Access-Control-Allow-Headers", request.headers("Access-Control-Request-Headers"));
|
||||||
|
response.header("Content-Type", "text/html; charset=utf-8");
|
||||||
|
return "";
|
||||||
|
});
|
||||||
|
put (API_CONTEXT + "/backup/download", "application/json", (request, response) -> {
|
||||||
|
log.debug("Create download: {}", request.body());
|
||||||
|
BackupFilename aFilename = new Gson().fromJson(request.body(), BackupFilename.class);
|
||||||
|
String backupContent = deviceRepository.downloadBackup(aFilename.getFilename());
|
||||||
|
return backupContent;
|
||||||
|
}, new JsonTransformer());
|
||||||
|
|
||||||
// http://ip_address:port/api/devices/backup/create CORS request
|
// http://ip_address:port/api/devices/backup/create CORS request
|
||||||
options(API_CONTEXT + "/backup/create", "application/json", (request, response) -> {
|
options(API_CONTEXT + "/backup/create", "application/json", (request, response) -> {
|
||||||
response.status(HttpStatus.SC_OK);
|
response.status(HttpStatus.SC_OK);
|
||||||
|
|||||||
@@ -92,4 +92,21 @@ public abstract class BackupHandler {
|
|||||||
return theFilenames;
|
return theFilenames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String downloadBackup(String aFilename) {
|
||||||
|
Path filePath = FileSystems.getDefault().getPath(repositoryPath.getParent().toString(), aFilename);
|
||||||
|
|
||||||
|
String content = null;
|
||||||
|
if (Files.notExists(filePath) || !Files.isReadable(filePath)) {
|
||||||
|
log.warn("Error reading the file: {} - Does not exist or is not readable. continuing...", aFilename);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
content = new String(Files.readAllBytes(filePath));
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("Error reading the file: {} message: {}", aFilename, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1279,6 +1279,22 @@ app.service('bridgeService', function ($rootScope, $http, $base64, $location, ng
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.downloadBackup = function (afilename) {
|
||||||
|
return $http.put(this.state.base + "/backup/download", {
|
||||||
|
filename: afilename
|
||||||
|
}).then(
|
||||||
|
function (response) {
|
||||||
|
self.state.backupContent = response.data;
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
if (error.status === 401)
|
||||||
|
$rootScope.$broadcast('securityReinit', 'done');
|
||||||
|
else
|
||||||
|
self.displayWarn("Download Backup Db File Error:", error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
this.checkForBridge = function () {
|
this.checkForBridge = function () {
|
||||||
return $http.get(this.state.bridgelocation + "/description.xml").then(
|
return $http.get(this.state.bridgelocation + "/description.xml").then(
|
||||||
function (response) {
|
function (response) {
|
||||||
@@ -2256,6 +2272,7 @@ app.controller('ViewingController', function ($scope, $location, bridgeService,
|
|||||||
bridgeService.viewBackups();
|
bridgeService.viewBackups();
|
||||||
$scope.bridge = bridgeService.state;
|
$scope.bridge = bridgeService.state;
|
||||||
$scope.optionalbackupname = "";
|
$scope.optionalbackupname = "";
|
||||||
|
$scope.bridge.backupContent = undefined;
|
||||||
$scope.visible = false;
|
$scope.visible = false;
|
||||||
$scope.imgUrl = "glyphicon glyphicon-plus";
|
$scope.imgUrl = "glyphicon glyphicon-plus";
|
||||||
$scope.visibleBk = false;
|
$scope.visibleBk = false;
|
||||||
@@ -2320,6 +2337,9 @@ app.controller('ViewingController', function ($scope, $location, bridgeService,
|
|||||||
$scope.deleteBackup = function (backupname) {
|
$scope.deleteBackup = function (backupname) {
|
||||||
bridgeService.deleteBackup(backupname);
|
bridgeService.deleteBackup(backupname);
|
||||||
};
|
};
|
||||||
|
$scope.downloadBackup = function (backupname) {
|
||||||
|
bridgeService.downloadBackup(backupname);
|
||||||
|
};
|
||||||
$scope.toggle = function () {
|
$scope.toggle = function () {
|
||||||
$scope.visible = !$scope.visible;
|
$scope.visible = !$scope.visible;
|
||||||
if ($scope.visible)
|
if ($scope.visible)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<ul class="nav nav-pills" role="tablist">
|
<ul class="nav nav-pills" role="tablist">
|
||||||
<li role="presentation" class="active"><a href="#!/">Bridge Devices</a></li>
|
<li role="presentation" class="active"><a href="#!/">Bridge Devices</a></li>
|
||||||
<li role="presentation"><a href="#!/system">Bridge Control</a></li>
|
<li role="presentation"><a href="#!/system">Bridge Control</a></li>
|
||||||
@@ -25,94 +24,97 @@
|
|||||||
<li ng-if="bridge.showHomeGenie" role="presentation"><a href="#!/homegeniedevices">HomeGenie Devices</a></li>
|
<li ng-if="bridge.showHomeGenie" role="presentation"><a href="#!/homegeniedevices">HomeGenie Devices</a></li>
|
||||||
<li role="presentation"><a href="#!/editdevice">Add/Edit</a></li>
|
<li role="presentation"><a href="#!/editdevice">Add/Edit</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div postrender-action="goToRow()">
|
<div postrender-action="goToRow()">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h1 class="panel-title">Current devices ({{bridge.devices.length}})</h1>
|
<h1 class="panel-title">Current devices ({{bridge.devices.length}})</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button class="btn btn-primary" type="submit" ng-click="renumberDevices()">Renumber Devices</button>
|
<button class="btn btn-primary" type="submit" ng-click="renumberDevices()">Renumber Devices</button>
|
||||||
<button ng-if="bridge.securityInfo.useLinkButton" class="btn btn-primary" type="submit" ng-click="pushLinkButton()">Link</button>
|
<button ng-if="bridge.securityInfo.useLinkButton" class="btn btn-primary" type="submit"
|
||||||
|
ng-click="pushLinkButton()">Link</button>
|
||||||
<button class="btn btn-primary" type="submit" ng-click="manageLinksButton()">Manage Links</button>
|
<button class="btn btn-primary" type="submit" ng-click="manageLinksButton()">Manage Links</button>
|
||||||
<label for="device-ip-filter">Show devices visible to: </label>
|
<label for="device-ip-filter">Show devices visible to: </label>
|
||||||
<input type="text" id="device-ip-filter" style="width:150px"
|
<input type="text" id="device-ip-filter" style="width:150px"
|
||||||
ng-model="bridge.state.filterDevicesByIpAddress" placeholder="">
|
ng-model="bridge.state.filterDevicesByIpAddress" placeholder="">
|
||||||
<input type="checkbox" id="device-ip-filter-mode" ng-model="bridge.state.filterDevicesOnlyFiltered" ng-true-value=true ng-false-value=false style="margin-right: 3px">Must contain filter
|
<input type="checkbox" id="device-ip-filter-mode" ng-model="bridge.state.filterDevicesOnlyFiltered"
|
||||||
|
ng-true-value=true ng-false-value=false style="margin-right: 3px">Must contain filter
|
||||||
<label for="device-type-filter" style="margin-left:50px">Filter device type: </label>
|
<label for="device-type-filter" style="margin-left:50px">Filter device type: </label>
|
||||||
<select name="device-type" id="device-type-filter"
|
<select name="device-type" id="device-type-filter" ng-model="bridge.state.filterDeviceType">
|
||||||
ng-model="bridge.state.filterDeviceType">
|
<option value="">---No Filter---</option>
|
||||||
<option value="">---No Filter---</option>
|
<!-- not selected / blank option -->
|
||||||
<!-- not selected / blank option -->
|
<option value="custom">Custom</option>
|
||||||
<option value="custom">Custom</option>
|
<option value="UDP">UDP</option>
|
||||||
<option value="UDP">UDP</option>
|
<option value="TCP">TCP</option>
|
||||||
<option value="TCP">TCP</option>
|
<option value="exec">Execute Script/Program</option>
|
||||||
<option value="exec">Execute Script/Program</option>
|
<option value="switch">Switch</option>
|
||||||
<option value="switch">Switch</option>
|
<option value="scene">Scene</option>
|
||||||
<option value="scene">Scene</option>
|
<option value="macro">Macro</option>
|
||||||
<option value="macro">Macro</option>
|
<option value="group">Group</option>
|
||||||
<option value="group">Group</option>
|
<option value="activity">Activity</option>
|
||||||
<option value="activity">Activity</option>
|
<option value="button">Button</option>
|
||||||
<option value="button">Button</option>
|
<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>
|
</div>
|
||||||
|
|
||||||
<scrollable-table watch="bridge.devices">
|
<scrollable-table watch="bridge.devices">
|
||||||
<table class="table table-bordered table-striped table-hover">
|
<table class="table table-bordered table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Row</th>
|
<th>Row</th>
|
||||||
<th sortable-header col="id" comparator-fn="comparatorUniqueId">ID</th>
|
<th sortable-header col="id" comparator-fn="comparatorUniqueId">ID</th>
|
||||||
<th sortable-header col="name">Name</th>
|
<th sortable-header col="name">Name</th>
|
||||||
<th sortable-header col="description">Description</th>
|
<th sortable-header col="description">Description</th>
|
||||||
<th sortable-header col="devicestate">Device State</th>
|
<th sortable-header col="devicestate">Device State</th>
|
||||||
<th sortable-header col="deviceType">Type</th>
|
<th sortable-header col="deviceType">Type</th>
|
||||||
<th sortable-header col="targetDevice">Target</th>
|
<th sortable-header col="targetDevice">Target</th>
|
||||||
<th sortable-header col="inactive">Inactive</th>
|
<th sortable-header col="inactive">Inactive</th>
|
||||||
<th sortable-header col="noState">No State</th>
|
<th sortable-header col="noState">No State</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="device in bridge.devices | filterDevicesByRequester:bridge.state.filterDevicesByIpAddress:bridge.state.filterDevicesOnlyFiltered:bridge.state.filterDeviceType" row-id="{{device.id}}" ng-class="{info: bridge.viewDevId == device.id}" >
|
<tr ng-repeat="device in bridge.devices | filterDevicesByRequester:bridge.state.filterDevicesByIpAddress:bridge.state.filterDevicesOnlyFiltered:bridge.state.filterDeviceType"
|
||||||
<td>{{$index+1}}</td>
|
row-id="{{device.id}}" ng-class="{info: bridge.viewDevId == device.id}">
|
||||||
<td>{{device.id}}</td>
|
<td>{{$index+1}}</td>
|
||||||
<td>{{device.name}}</td>
|
<td>{{device.id}}</td>
|
||||||
<td class="cr">{{device.description}}</td>
|
<td>{{device.name}}</td>
|
||||||
<td class="cr">on={{device.deviceState.on}},bri={{device.deviceState.bri}},hue={{device.deviceState.hue}},sat={{device.deviceState.sat}},effect={{device.deviceState.effect}},ct={{device.deviceState.ct}},alert={{device.deviceState.alert}},colormode={{device.deviceState.colormode}},reachable={{device.deviceState.reachable}},XYList={{device.deviceState.xy}}</td>
|
<td class="cr">{{device.description}}</td>
|
||||||
<td>{{device.deviceType}}</td>
|
<td class="cr">
|
||||||
<td>{{device.targetDevice}}</td>
|
on={{device.deviceState.on}},bri={{device.deviceState.bri}},hue={{device.deviceState.hue}},sat={{device.deviceState.sat}},effect={{device.deviceState.effect}},ct={{device.deviceState.ct}},alert={{device.deviceState.alert}},colormode={{device.deviceState.colormode}},reachable={{device.deviceState.reachable}},XYList={{device.deviceState.xy}}
|
||||||
<td>{{device.inactive}}</td>
|
</td>
|
||||||
<td>{{device.noState}}</td>
|
<td>{{device.deviceType}}</td>
|
||||||
<td>
|
<td>{{device.targetDevice}}</td>
|
||||||
<p>
|
<td>{{device.inactive}}</td>
|
||||||
<button class="btn btn-info" type="submit"
|
<td>{{device.noState}}</td>
|
||||||
ng-click="testUrl(device, 'on')">Test ON</button>
|
<td>
|
||||||
<button class="btn btn-info" type="submit"
|
<p>
|
||||||
ng-click="testUrl(device, 'dim')">Test Dim</button>
|
<button class="btn btn-info" type="submit" ng-click="testUrl(device, 'on')">Test
|
||||||
<button class="btn btn-info" type="submit"
|
ON</button>
|
||||||
ng-click="testUrl(device, 'off')">Test OFF</button>
|
<button class="btn btn-info" type="submit" ng-click="testUrl(device, 'dim')">Test
|
||||||
<button class="btn btn-info" type="submit"
|
Dim</button>
|
||||||
ng-click="testUrl(device, 'color')">Test Color</button>
|
<button class="btn btn-info" type="submit" ng-click="testUrl(device, 'off')">Test
|
||||||
<button class="btn btn-warning" type="submit"
|
OFF</button>
|
||||||
ng-click="editDevice(device)">Edit/Copy</button>
|
<button class="btn btn-info" type="submit" ng-click="testUrl(device, 'color')">Test
|
||||||
<button class="btn btn-danger" type="submit"
|
Color</button>
|
||||||
ng-click="deleteDevice(device)">Delete</button>
|
<button class="btn btn-warning" type="submit"
|
||||||
</p>
|
ng-click="editDevice(device)">Edit/Copy</button>
|
||||||
</td>
|
<button class="btn btn-danger" type="submit"
|
||||||
</tr>
|
ng-click="deleteDevice(device)">Delete</button>
|
||||||
</table>
|
</p>
|
||||||
</scrollable-table>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</scrollable-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h1 class="panel-title">
|
<h1 class="panel-title">
|
||||||
Bridge Device DB Backup <a ng-click="toggleBk()"><span
|
Bridge Device DB Backup <a ng-click="toggleBk()"><span class={{imgBkUrl}} aria-hidden="true"></span></a>
|
||||||
class={{imgBkUrl}} aria-hidden="true"></span></a>
|
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="visibleBk" class="panel-body">
|
<div ng-if="visibleBk" class="panel-body">
|
||||||
@@ -123,11 +125,10 @@
|
|||||||
File Name</label>
|
File Name</label>
|
||||||
|
|
||||||
<div class="col-xs-8 col-sm-7">
|
<div class="col-xs-8 col-sm-7">
|
||||||
<input id="backup-name" class="form-control" type="text"
|
<input id="backup-name" class="form-control" type="text" ng-model="optionalbackupname"
|
||||||
ng-model="optionalbackupname" placeholder="Optional">
|
placeholder="Optional">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary"
|
<button type="submit" class="btn btn-primary" ng-click="backupDeviceDb(optionalbackupname)">Backup
|
||||||
ng-click="backupDeviceDb(optionalbackupname)">Backup
|
|
||||||
Device DB</button>
|
Device DB</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -139,12 +140,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="backup in bridge.backups">
|
<tr ng-repeat="backup in bridge.backups">
|
||||||
<td>{{backup}}</td>
|
<td><button type="button" ng-click="downloadBackup(backup)">{{backup}}</button></td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-danger" type="submit"
|
<button class="btn btn-danger" type="submit" ng-click="restoreBackup(backup)">Restore</button>
|
||||||
ng-click="restoreBackup(backup)">Restore</button>
|
<button class="btn btn-warning" type="submit" ng-click="deleteBackup(backup)">Delete</button>
|
||||||
<button class="btn btn-warning" type="submit"
|
|
||||||
ng-click="deleteBackup(backup)">Delete</button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -152,7 +151,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/ng-template" id="valueDialog">
|
<script type="text/ng-template" id="valueDialog">
|
||||||
<div class="ngdialog-message">
|
<div class="ngdialog-message">
|
||||||
<h2>Select value</h2>
|
<h2>Select value</h2>
|
||||||
<p>
|
<p>
|
||||||
<input type="radio" ng-model="valueType" value="percentage" ng-change="changeScale()"> Percentage
|
<input type="radio" ng-model="valueType" value="percentage" ng-change="changeScale()"> Percentage
|
||||||
@@ -167,7 +166,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/ng-template" id="colorDialog">
|
<script type="text/ng-template" id="colorDialog">
|
||||||
<div class="ngdialog-message">
|
<div class="ngdialog-message">
|
||||||
<h2>Select Color</h2>
|
<h2>Select Color</h2>
|
||||||
<p>
|
<p>
|
||||||
<input colorpicker="rgb" ng-model="rgbPicker.color" type="text">
|
<input colorpicker="rgb" ng-model="rgbPicker.color" type="text">
|
||||||
@@ -178,7 +177,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/ng-template" id="deleteDialog">
|
<script type="text/ng-template" id="deleteDialog">
|
||||||
<div class="ngdialog-message">
|
<div class="ngdialog-message">
|
||||||
<h2>Device to Delete?</h2>
|
<h2>Device to Delete?</h2>
|
||||||
<p>{{device.name}}</p>
|
<p>{{device.name}}</p>
|
||||||
<p>Are you Sure?</p>
|
<p>Are you Sure?</p>
|
||||||
@@ -186,4 +185,4 @@
|
|||||||
<div class="ngdialog-buttons mt">
|
<div class="ngdialog-buttons mt">
|
||||||
<button type="button" class="ngdialog-button ngdialog-button-error" ng-click="deleteDevice(device)">Delete</button>
|
<button type="button" class="ngdialog-button ngdialog-button-error" ng-click="deleteDevice(device)">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
@@ -78,6 +78,12 @@
|
|||||||
<td><input type="text" class="form-control" id="device-comments"
|
<td><input type="text" class="form-control" id="device-comments"
|
||||||
ng-model="device.comments" placeholder="Device Comments"></td>
|
ng-model="device.comments" placeholder="Device Comments"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label>Lock Device ID</label></td>
|
||||||
|
<td><input type="checkbox"
|
||||||
|
ng-model="device.lockDeviceId" ng-true-value=true
|
||||||
|
ng-false-value=false> {{device.lockDeviceId}}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label>Inactive</label></td>
|
<td><label>Inactive</label></td>
|
||||||
<td><input type="checkbox"
|
<td><input type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user