editDeviceModalView.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <modal id="editDevice" status="default" icon="{{editDeviceModalIcon()}}" heading="{{editDeviceModalTitle()}}" large="yes" closeable="yes">
  2. <div class="modal-body">
  3. <form role="form" name="deviceEditor">
  4. <ul class="nav nav-tabs" ng-init="loadFormIntoScope(deviceEditor)">
  5. <li class="active"><a data-toggle="tab" href="#device-general"><span class="fas fa-cog"></span> <span translate>General</span></a></li>
  6. <li ng-if="!editingDeviceDefaults()"><a data-toggle="tab" href="#device-sharing"><span class="fas fa-share-alt"></span> <span translate>Sharing</span></a></li>
  7. <li><a data-toggle="tab" href="#device-advanced"><span class="fas fa-cogs"></span> <span translate>Advanced</span></a></li>
  8. </ul>
  9. <div class="tab-content">
  10. <div id="device-general" class="tab-pane in active">
  11. <div ng-if="!editingDeviceDefaults()" class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}" ng-init="loadFormIntoScope(deviceEditor)">
  12. <label translate for="deviceID">Device ID</label>
  13. <div class="input-group">
  14. <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" />
  15. <div ng-if="!editingDeviceNew()" class="well well-sm form-control text-monospace" style="height: auto;" select-on-click>{{currentDevice.deviceID}}</div>
  16. <div class="input-group-btn">
  17. <button type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid">
  18. <span class="fas fa-qrcode"></span>&nbsp;<span translate>Show QR</span>
  19. </button>
  20. </div>
  21. </div>
  22. <div ng-if="editingDeviceNew()">
  23. <datalist id="discovery-list">
  24. <option ng-repeat="id in discoveryUnknown" value="{{id}}" />
  25. </datalist>
  26. <div class="help-block" ng-if="discoveryUnknown && discoveryUnknown.length !== 0">
  27. <span translate>You can also select one of these nearby devices:</span>
  28. <ul>
  29. <li ng-repeat="id in discoveryUnknown.slice(0, 5)" style="list-style-type: none;">
  30. <a href="#" ng-click="currentDevice.deviceID = id">
  31. <identicon data-value="id"></identicon>&nbsp;&nbsp;{{id}}
  32. </a>
  33. </li>
  34. </ul>
  35. </div>
  36. <p class="help-block">
  37. <span translate ng-if="deviceEditor.deviceID.$valid || deviceEditor.deviceID.$pristine">The device ID to enter here can be found in the "Actions &gt; Show ID" dialog on the other device. Spaces and dashes are optional (ignored).</span>
  38. <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>
  39. <span translate ng-if="deviceEditor.deviceID.$error.required && deviceEditor.deviceID.$dirty">The device ID cannot be blank.</span>
  40. <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>
  41. <span translate ng-if="deviceEditor.deviceID.$error.unique && deviceEditor.deviceID.$dirty">A device with that ID is already added.</span>
  42. </p>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label translate for="name">Device Name</label>
  47. <input id="name" class="form-control" type="text" ng-model="currentDevice.name" />
  48. <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>
  49. <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>
  50. </div>
  51. </div>
  52. <div ng-if="!editingDeviceDefaults()" id="device-sharing" class="tab-pane">
  53. <div class="row">
  54. <div class="col-md-6">
  55. <div class="form-group">
  56. <div class="checkbox">
  57. <label>
  58. <input type="checkbox" ng-model="currentDevice.introducer">
  59. <span translate>Introducer</span>
  60. <p translate class="help-block">Add devices from the introducer to our device list, for mutually shared folders.</p>
  61. </label>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="col-md-6">
  66. <div class="form-group">
  67. <div class="checkbox">
  68. <label>
  69. <input type="checkbox" ng-model="currentDevice.autoAcceptFolders">
  70. <span translate>Auto Accept</span>
  71. <p translate class="help-block">Automatically create or share folders that this device advertises at the default path.</p>
  72. </label>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <div class="form-horizontal" ng-if="currentSharing.shared.length">
  79. <label translate for="folders">Shared Folders</label>
  80. <p class="help-block">
  81. <span translate>Deselect folders to stop sharing with this device.</span>&emsp;
  82. <small><a href="#" ng-click="selectAllSharedFolders(true)" translate>Select All</a>&emsp;
  83. <a href="#" ng-click="selectAllSharedFolders(false)" translate>Deselect All</a></small>
  84. </p>
  85. <div class="form-group" ng-repeat="folder in currentSharing.shared">
  86. <share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabelMarkRemoteState(folder.id, currentDevice.deviceID)}}" folder-type="{{folder.type}}" untrusted="currentDevice.untrusted" />
  87. </div>
  88. <p class="help-block" ng-if="deviceHasUnacceptedFolders(currentDevice)">
  89. <sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
  90. </p>
  91. <p class="help-block" ng-if="deviceHasPausedFolders(currentDevice)">
  92. <sup>2</sup> <span translate>The remote device has paused this folder.</span>
  93. </p>
  94. </div>
  95. <div class="form-horizontal" ng-if="currentSharing.unrelated.length">
  96. <label translate for="folders">Unshared Folders</label>
  97. <p class="help-block" ng-if="folderList().length > 0">
  98. <span translate>Select additional folders to share with this device.</span>&emsp;
  99. <small><a href="#" ng-click="selectAllUnrelatedFolders(true)" translate>Select All</a>&emsp;
  100. <a href="#" ng-click="selectAllUnrelatedFolders(false)" translate>Deselect All</a></small>
  101. </p>
  102. <p class="help-block" ng-if="folderList().length == 0">
  103. <span translate>There are no folders to share with this device.</span>
  104. </p>
  105. <div class="form-group" ng-repeat="folder in currentSharing.unrelated">
  106. <share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabel(folder.id)}}" folder-type="{{folder.type}}" untrusted="currentDevice.untrusted" />
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div id="device-advanced" class="tab-pane">
  112. <div class="row form-group">
  113. <div class="col-md-6">
  114. <div class="form-group">
  115. <label translate for="addresses">Addresses</label>
  116. <input ng-disabled="currentDevice.deviceID == myID" id="addresses" class="form-control" type="text" ng-model="currentDevice._addressesStr"></input>
  117. <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>
  118. </div>
  119. </div>
  120. <div class="col-md-6">
  121. <div class="form-group">
  122. <label translate>Compression</label>
  123. <select class="form-control" ng-model="currentDevice.compression">
  124. <option value="always" translate>All Data</option>
  125. <option value="metadata" translate>Metadata Only</option>
  126. <option value="never" translate>Off</option>
  127. </select>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="row form-group">
  132. <div class="col-md-12">
  133. <label translate>Device rate limits</label>
  134. <div class="row">
  135. <div class="col-md-6" ng-class="{'has-error': deviceEditor.maxRecvKbps.$invalid && deviceEditor.maxRecvKbps.$dirty}">
  136. <div class="row">
  137. <span class="col-md-8" translate>Incoming Rate Limit (KiB/s)</span>
  138. <div class="col-md-4">
  139. <input name="maxRecvKbps" id="maxRecvKbps" class="form-control" type="number" pattern="\d+" ng-model="currentDevice.maxRecvKbps" min="0" />
  140. </div>
  141. </div>
  142. <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>
  143. </div>
  144. <div class="col-md-6" ng-class="{'has-error': deviceEditor.maxSendKbps.$invalid && deviceEditor.maxSendKbps.$dirty}">
  145. <div class="row">
  146. <span class="col-md-8" translate>Outgoing Rate Limit (KiB/s)</span>
  147. <div class="col-md-4">
  148. <input name="maxSendKbps" id="maxSendKbps" class="form-control" type="number" pattern="\d+" ng-model="currentDevice.maxSendKbps" min="0" />
  149. </div>
  150. </div>
  151. <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>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="row">
  157. <div class="form-group col-md-6">
  158. <input type="checkbox" id="untrusted" ng-model="currentDevice.untrusted" />
  159. <label for="untrusted" translate>Untrusted</label>
  160. <p translate class="help-block">All folders shared with this device must be protected by a password, such that all sent data is unreadable without the given password.</p>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </form>
  166. </div>
  167. <div class="modal-footer">
  168. <button type="button" class="btn btn-primary btn-sm" ng-click="saveDevice()" ng-disabled="deviceEditor.$invalid">
  169. <span class="fas fa-check"></span>&nbsp;<span translate>Save</span>
  170. </button>
  171. <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
  172. <span class="fas fa-times"></span>&nbsp;<span translate>Close</span>
  173. </button>
  174. <div ng-if="editingDeviceExisting()" class="pull-left">
  175. <button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#remove-device-confirmation">
  176. <span class="fas fa-minus-circle"></span>&nbsp;<span translate>Remove</span>
  177. </button>
  178. </div>
  179. </div>
  180. </modal>