92 lines
5.8 KiB
HTML
92 lines
5.8 KiB
HTML
<div id="editDevice" class="modal fade" tabindex="-1">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">
|
|
<span ng-show="!editingExisting"><span class="fa fa-desktop"></span><span translate>Add Device</span></span>
|
|
<span ng-show="editingExisting"><span class="fa fa-pencil"></span><span translate>Edit Device</span></span>
|
|
</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form role="form" name="deviceEditor">
|
|
<div class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}">
|
|
<label translate for="deviceID">Device ID</label>
|
|
<input ng-if="!editingExisting" name="deviceID" id="deviceID" class="form-control text-monospace" type="text" ng-model="currentDevice.deviceID" required valid-deviceid list="discovery-list" />
|
|
<datalist id="discovery-list" ng-if="!editingExisting">
|
|
<option ng-repeat="(id, data) in discovery" value="{{id}}" />
|
|
</datalist>
|
|
<div ng-if="editingExisting" class="well well-sm text-monospace" select-on-click>{{currentDevice.deviceID}}</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 "Edit > Show ID" dialog on the other device. Spaces and dashes are optional (ignored).</span>
|
|
<span translate ng-show="!editingExisting && (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>
|
|
<span translate ng-if="deviceEditor.deviceID.$error.required && deviceEditor.deviceID.$dirty">The device ID cannot be blank.</span>
|
|
<span translate ng-if="deviceEditor.deviceID.$error.validDeviceid && deviceEditor.deviceID.$dirty">The entered device ID does not look valid. It should be a 52 or 56 character string consisting of letters and numbers, with spaces and dashes being optional.</span>
|
|
<span translate ng-if="deviceEditor.deviceID.$error.unique && deviceEditor.deviceID.$dirty">A device with that ID is already added.</span>
|
|
</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label translate for="name">Device Name</label>
|
|
<input id="name" class="form-control" type="text" ng-model="currentDevice.name"></input>
|
|
<p translate ng-if="currentDevice.deviceID == myID" class="help-block">Shown instead of Device ID in the cluster status. Will be advertised to other devices as an optional default name.</p>
|
|
<p translate ng-if="currentDevice.deviceID != myID" class="help-block">Shown instead of Device ID in the cluster status. Will be updated to the name the device advertises if left empty.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label translate for="addresses">Addresses</label>
|
|
<input ng-disabled="currentDevice.deviceID == myID" id="addresses" class="form-control" type="text" ng-model="currentDevice._addressesStr"></input>
|
|
<p translate class="help-block">Enter comma separated ("tcp://ip:port", "tcp://host:port") addresses or "dynamic" to perform automatic discovery of the address.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label translate>Compression</label>
|
|
<select class="form-control" ng-model="currentDevice.compression">
|
|
<option value="always" translate>All Data</option>
|
|
<option value="metadata" translate>Metadata Only</option>
|
|
<option value="never" translate>Off</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" ng-model="currentDevice.introducer"> <span translate>Introducer</span>
|
|
</label>
|
|
<p translate class="help-block">Any devices configured on an introducer device will be added to this device as well.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<label translate for="folders">Share Folders With Device</label>
|
|
<p translate class="help-block">Select the folders to share with this device.</p>
|
|
<div class="row">
|
|
<div class="col-md-4" ng-repeat="folder in folderList()">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" ng-model="currentDevice.selectedFolders[folder.id]"> {{folder.id}}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-sm" ng-click="saveDevice()" ng-disabled="deviceEditor.$invalid">
|
|
<span class="fa fa-check"></span> <span translate>Save</span>
|
|
</button>
|
|
<button type="button" class="btn btn-default btn-sm" ng-click="idDevice(currentDevice)" ng-if="editingExisting || deviceEditor.deviceID.$valid">
|
|
<span class="fa fa-qrcode"></span> <span translate>Show QR</span>
|
|
</button>
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
|
<span class="fa fa-times"></span> <span translate>Close</span>
|
|
</button>
|
|
<button type="button" class="btn btn-warning pull-left btn-sm" ng-click="deleteDevice()" ng-if="editingExisting">
|
|
<span class="fa fa-minus-circle"></span> <span translate>Remove</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|