78 lines
5.2 KiB
HTML
78 lines
5.2 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 translate ng-show="!editingExisting" class="modal-title">Add Device</h4>
|
||
|
|
<h4 translate ng-show="editingExisting" class="modal-title">Edit Device</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,address) in discovery" value="{{ id }}" />
|
||
|
|
</datalist>
|
||
|
|
<div ng-if="editingExisting" class="well well-sm text-monospace">{{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>
|
||
|
|
</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 "ip:port" addresses or "dynamic" to perform automatic discovery of the address.</p>
|
||
|
|
</div>
|
||
|
|
<div ng-if="!editingSelf" 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 ng-if="!editingSelf" 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" ng-if="!editingSelf">
|
||
|
|
<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="three-columns">
|
||
|
|
<div class="checkbox" ng-repeat="folder in folderList()">
|
||
|
|
<label>
|
||
|
|
<input type="checkbox" ng-model="currentDevice.selectedFolders[folder.id]"> {{folder.id}}
|
||
|
|
</label>
|
||
|
|
</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="glyphicon glyphicon-ok"></span> <span translate>Save</span></button>
|
||
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> <span translate>Close</span></button>
|
||
|
|
<button ng-if="editingExisting && !editingSelf" type="button" class="btn btn-danger pull-left btn-sm" ng-click="deleteDevice()"><span class="glyphicon glyphicon-minus"></span> <span translate>Delete</span></button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|