2018-05-24 20:59:32 +02:00
< modal id = "editDevice" status = "default" icon = "{{editingExisting ? 'fas fa-pencil-alt' : 'fas fa-desktop'}}" heading = "{{editingExisting ? 'Edit Device' : 'Add Device' | translate}}" large = "yes" closeable = "yes" >
2016-06-12 14:06:48 +00:00
< div class = "modal-body" >
< form role = "form" name = "deviceEditor" >
2018-08-25 11:36:10 +01:00
< ul class = "nav nav-tabs" ng-init = "loadFormIntoScope(deviceEditor)" >
2018-08-23 13:45:28 +02:00
< li class = "active" >< a data-toggle = "tab" href = "#device-general" >< span class = "fas fa-cog" ></ span > < span translate > General</ span ></ a ></ li >
< li >< a data-toggle = "tab" href = "#device-sharing" >< span class = "fas fa-share-alt" ></ span > < span translate > Sharing</ span ></ a ></ li >
< li >< a data-toggle = "tab" href = "#device-advanced" >< span class = "fas fa-cogs" ></ span > < span translate > Advanced</ span ></ a ></ li >
2018-06-07 22:01:19 +02:00
</ ul >
< div class = "tab-content" >
< div id = "device-general" class = "tab-pane in active" >
< div 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 = "!editingExisting" >
2018-12-25 14:26:46 +01:00
< 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" />
2018-06-07 22:01:19 +02:00
< datalist id = "discovery-list" >
2018-12-25 14:26:46 +01:00
< option ng-repeat = "id in discovery" value = "{{id}}" />
2018-06-07 22:01:19 +02:00
</ datalist >
2019-11-19 22:15:27 +01:00
< p class = "help-block" ng-if = "discovery && discovery.length !== 0" >
2018-06-07 22:01:19 +02:00
< span translate > You can also select one of these nearby devices:</ span >
< ul >
2019-11-19 22:15:27 +01:00
< li ng-repeat = "id in discovery" >< a href = "#" ng-click = "currentDevice.deviceID = id" > {{id}}</ a ></ li >
2018-06-07 22:01:19 +02:00
</ ul >
</ p >
< 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 >
< 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 ng-if = "editingExisting" class = "well well-sm text-monospace" select-on-click > {{currentDevice.deviceID}}</ div >
</ div >
2017-12-07 07:08:24 +00:00
< div class = "form-group" >
< label translate for = "name" > Device Name</ label >
2018-12-25 14:26:46 +01:00
< input id = "name" class = "form-control" type = "text" ng-model = "currentDevice.name" />
2017-12-07 07:08:24 +00:00
< 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 >
2018-11-13 08:57:45 +01:00
< div id = "device-sharing" class = "tab-pane" >
2018-06-07 22:01:19 +02:00
< div class = "row" >
< div class = "col-md-6" >
< div class = "form-group" >
< div class = "checkbox" >
< label >
< input type = "checkbox" ng-model = "currentDevice.introducer" >
< span translate > Introducer</ span >
< p translate class = "help-block" > Add devices from the introducer to our device list, for mutually shared folders.</ p >
</ label >
</ div >
</ div >
</ div >
< div class = "col-md-6" >
< div class = "form-group" >
< div class = "checkbox" >
< label >
< input type = "checkbox" ng-model = "currentDevice.autoAcceptFolders" >
< span translate > Auto Accept</ span >
< p translate class = "help-block" > Automatically create or share folders that this device advertises at the default path.</ p >
</ label >
</ div >
</ div >
</ div >
2017-12-07 07:08:24 +00:00
</ div >
2018-06-07 22:01:19 +02:00
< div class = "row" >
< div class = "col-md-12" >
< div class = "form-group" >
< label translate for = "folders" > Share Folders With Device</ label >
2018-11-07 11:44:52 +03:00
< p class = "help-block" >
< span translate > Select the folders to share with this device.</ span >  
< small >< a href = "#" ng-click = "selectAllFolders()" translate > Select All</ a >  
< a href = "#" ng-click = "deSelectAllFolders()" translate > Deselect All</ a ></ small >
</ p >
2018-06-07 22:01:19 +02:00
< div class = "row" >
< div class = "col-md-4" ng-repeat = "folder in folderList()" >
< div class = "checkbox" >
< label ng-if = "folder.label.length == 0" >
< input type = "checkbox" ng-model = "currentDevice.selectedFolders[folder.id]" > {{folder.id}}
</ label >
< label ng-if = "folder.label.length != 0" >
< input type = "checkbox" ng-model = "currentDevice.selectedFolders[folder.id]" > < span tooltip data-original-title = "{{folder.id}}" > {{folder.label}}</ span >
</ label >
</ div >
</ div >
</ div >
</ div >
2017-12-07 07:08:24 +00:00
</ div >
</ div >
</ div >
2018-11-13 08:57:45 +01:00
< div id = "device-advanced" class = "tab-pane" >
2018-06-07 22:01:19 +02:00
< div class = "row form-group" >
< div class = "col-md-6" >
< 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 >
2018-12-25 14:26:46 +01:00
< 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 >
2018-06-07 22:01:19 +02:00
</ div >
</ div >
< div class = "col-md-6" >
< 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 >
2017-12-07 07:08:24 +00:00
</ div >
</ div >
2018-06-07 22:01:19 +02:00
< div class = "row form-group" >
< div class = "col-md-12" >
< label translate > Device rate limits</ label >
< div class = "row" >
< div class = "col-md-6" ng-class = "{'has-error': deviceEditor.maxRecvKbps.$invalid && deviceEditor.maxRecvKbps.$dirty}" >
< div class = "row" >
2018-08-06 23:08:17 +01:00
< span class = "col-md-8" translate > Incoming Rate Limit (KiB/s)</ span >
2018-06-07 22:01:19 +02:00
< div class = "col-md-4" >
2018-12-25 14:26:46 +01:00
< input name = "maxRecvKbps" id = "maxRecvKbps" class = "form-control" type = "number" pattern = "\d+" ng-model = "currentDevice.maxRecvKbps" min = "0" />
2018-06-07 22:01:19 +02:00
</ div >
</ div >
< p class = "help-block" ng-if = "!deviceEditor.maxRecvKbps.$valid && deviceEditor.maxRecvKbps.$dirty" translate > The rate limit must be a non-negative number (0: no limit)</ p >
2015-08-02 08:27:05 +02:00
</ div >
2018-11-22 10:59:04 +01:00
< div class = "col-md-6" ng-class = "{'has-error': deviceEditor.maxSendKbps.$invalid && deviceEditor.maxSendKbps.$dirty}" >
< div class = "row" >
< span class = "col-md-8" translate > Outgoing Rate Limit (KiB/s)</ span >
< div class = "col-md-4" >
2018-12-25 14:26:46 +01:00
< input name = "maxSendKbps" id = "maxSendKbps" class = "form-control" type = "number" pattern = "\d+" ng-model = "currentDevice.maxSendKbps" min = "0" />
2018-11-22 10:59:04 +01:00
</ div >
</ div >
< p class = "help-block" ng-if = "!deviceEditor.maxSendKbps.$valid && deviceEditor.maxSendKbps.$dirty" translate > The rate limit must be a non-negative number (0: no limit)</ p >
</ div >
2015-08-02 08:27:05 +02:00
</ div >
</ div >
</ div >
2016-06-12 14:06:48 +00:00
</ div >
2015-08-02 08:27:05 +02:00
</ div >
2016-06-12 14:06:48 +00:00
</ form >
</ div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-primary btn-sm" ng-click = "saveDevice()" ng-disabled = "deviceEditor.$invalid" >
2018-05-24 20:59:32 +02:00
< span class = "fas fa-check" ></ span > < span translate > Save</ span >
2016-06-12 14:06:48 +00:00
</ button >
< button type = "button" class = "btn btn-default btn-sm" data-toggle = "modal" data-target = "#idqr" ng-if = "editingExisting || deviceEditor.deviceID.$valid" >
2018-05-24 20:59:32 +02:00
< span class = "fas fa-qrcode" ></ span > < span translate > Show QR</ span >
2016-06-12 14:06:48 +00:00
</ button >
< button type = "button" class = "btn btn-default btn-sm" data-dismiss = "modal" >
2018-05-24 20:59:32 +02:00
< span class = "fas fa-times" ></ span > < span translate > Close</ span >
2016-06-12 14:06:48 +00:00
</ button >
2016-12-02 21:07:02 +00:00
< div ng-if = "editingExisting" class = "pull-left" >
< button type = "button" class = "btn btn-warning btn-sm disabled" ng-if = "willBeReintroducedBy" tooltip data-original-title = "This device will be reintroduced by {{ willBeReintroducedBy }}" >
2018-05-24 20:59:32 +02:00
< span class = "fas fa-minus-circle" ></ span > < span translate > Remove</ span >
2016-12-02 21:07:02 +00:00
</ button >
2017-12-02 11:28:06 +00:00
< button type = "button" class = "btn btn-warning btn-sm" data-toggle = "modal" data-target = "#remove-device-confirmation" ng-if = "!willBeReintroducedBy" >
2018-05-24 20:59:32 +02:00
< span class = "fas fa-minus-circle" ></ span > < span translate > Remove</ span >
2016-12-02 21:07:02 +00:00
</ button >
</ div >
2015-08-02 08:27:05 +02:00
</ div >
2016-06-12 14:06:48 +00:00
</ modal >