|
|
@@ -10,19 +10,20 @@
|
|
|
<div id="device-general" class="tab-pane in active">
|
|
|
<div ng-if="!editingDeviceDefaults()" class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}" ng-init="loadFormIntoScope(deviceEditor)">
|
|
|
<label translate for="deviceID">Device ID</label>
|
|
|
- <div ng-if="!editingDeviceExisting()">
|
|
|
- <div class="input-group">
|
|
|
- <input name="deviceID" id="deviceID" class="form-control text-monospace" type="text" ng-model="currentDevice.deviceID" required="" valid-deviceid list="discovery-list" aria-required="true" />
|
|
|
- <div class="input-group-btn">
|
|
|
- <button type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr" ng-disabled="!deviceEditor.deviceID.$valid">
|
|
|
- <span class="fas fa-qrcode"></span> <span translate>Show QR</span>
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ <div class="input-group">
|
|
|
+ <input ng-if="editingDeviceNew()" name="deviceID" id="deviceID" class="form-control text-monospace" type="text" ng-model="currentDevice.deviceID" required="" valid-deviceid list="discovery-list" aria-required="true" />
|
|
|
+ <div ng-if="!editingDeviceNew()" class="well well-sm form-control text-monospace" style="height: auto;" select-on-click>{{currentDevice.deviceID}}</div>
|
|
|
+ <div class="input-group-btn">
|
|
|
+ <button type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid">
|
|
|
+ <span class="fas fa-qrcode"></span> <span translate>Show QR</span>
|
|
|
+ </button>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <div ng-if="editingDeviceNew()">
|
|
|
<datalist id="discovery-list">
|
|
|
<option ng-repeat="id in discovery" value="{{id}}" />
|
|
|
</datalist>
|
|
|
- <p class="help-block" ng-if="discovery && discovery.length !== 0">
|
|
|
+ <div class="help-block" ng-if="discovery && discovery.length !== 0">
|
|
|
<span translate>You can also select one of these nearby devices:</span>
|
|
|
<ul>
|
|
|
<li ng-repeat="id in discovery" style="list-style-type: none;">
|
|
|
@@ -31,7 +32,7 @@
|
|
|
</a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- </p>
|
|
|
+ </div>
|
|
|
<p class="help-block">
|
|
|
<span translate ng-if="deviceEditor.deviceID.$valid || deviceEditor.deviceID.$pristine">The device ID to enter here can be found in the "Actions > Show ID" dialog on the other device. Spaces and dashes are optional (ignored).</span>
|
|
|
<span translate ng-show="deviceEditor.deviceID.$valid || deviceEditor.deviceID.$pristine">When adding a new device, keep in mind that this device must be added on the other side too.</span>
|
|
|
@@ -40,14 +41,6 @@
|
|
|
<span translate ng-if="deviceEditor.deviceID.$error.unique && deviceEditor.deviceID.$dirty">A device with that ID is already added.</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div ng-if="editingDeviceExisting()" class="input-group">
|
|
|
- <div class="well well-sm text-monospace form-control" style="height: auto;" select-on-click>{{currentDevice.deviceID}}</div>
|
|
|
- <div class="input-group-btn">
|
|
|
- <button type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr">
|
|
|
- <span class="fas fa-qrcode"></span> <span translate>Show QR</span>
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label translate for="name">Device Name</label>
|
|
|
@@ -172,7 +165,7 @@
|
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
|
|
<span class="fas fa-times"></span> <span translate>Close</span>
|
|
|
</button>
|
|
|
- <div ng-if="has(['existing', 'defaults'], currentDevice._editing)" class="pull-left">
|
|
|
+ <div ng-if="editingDeviceExisting()" class="pull-left">
|
|
|
<button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#remove-device-confirmation">
|
|
|
<span class="fas fa-minus-circle"></span> <span translate>Remove</span>
|
|
|
</button>
|