editDeviceModalView.html 5.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <div id="editDevice" class="modal fade" tabindex="-1">
  2. <div class="modal-dialog modal-lg">
  3. <div class="modal-content">
  4. <div class="modal-header">
  5. <h4 class="modal-title">
  6. <span ng-show="!editingExisting"><span class="fa fa-desktop"></span><span translate>Add Device</span></span>
  7. <span ng-show="editingExisting"><span class="fa fa-pencil"></span><span translate>Edit Device</span></span>
  8. </h4>
  9. </div>
  10. <div class="modal-body">
  11. <form role="form" name="deviceEditor">
  12. <div class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}">
  13. <label translate for="deviceID">Device ID</label>
  14. <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" />
  15. <datalist id="discovery-list" ng-if="!editingExisting">
  16. <option ng-repeat="(id, data) in discovery" value="{{id}}" />
  17. </datalist>
  18. <div ng-if="editingExisting" class="well well-sm text-monospace" select-on-click>{{currentDevice.deviceID}}</div>
  19. <p class="help-block">
  20. <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>
  21. <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>
  22. <span translate ng-if="deviceEditor.deviceID.$error.required && deviceEditor.deviceID.$dirty">The device ID cannot be blank.</span>
  23. <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>
  24. <span translate ng-if="deviceEditor.deviceID.$error.unique && deviceEditor.deviceID.$dirty">A device with that ID is already added.</span>
  25. </p>
  26. </div>
  27. <div class="form-group">
  28. <label translate for="name">Device Name</label>
  29. <input id="name" class="form-control" type="text" ng-model="currentDevice.name"></input>
  30. <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>
  31. <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>
  32. </div>
  33. <div class="form-group">
  34. <label translate for="addresses">Addresses</label>
  35. <input ng-disabled="currentDevice.deviceID == myID" id="addresses" class="form-control" type="text" ng-model="currentDevice._addressesStr"></input>
  36. <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>
  37. </div>
  38. <div class="form-group">
  39. <label translate>Compression</label>
  40. <select class="form-control" ng-model="currentDevice.compression">
  41. <option value="always" translate>All Data</option>
  42. <option value="metadata" translate>Metadata Only</option>
  43. <option value="never" translate>Off</option>
  44. </select>
  45. </div>
  46. <div class="form-group">
  47. <div class="checkbox">
  48. <label>
  49. <input type="checkbox" ng-model="currentDevice.introducer"> <span translate>Introducer</span>
  50. </label>
  51. <p translate class="help-block">Any devices configured on an introducer device will be added to this device as well.</p>
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="col-md-12">
  56. <div class="form-group">
  57. <label translate for="folders">Share Folders With Device</label>
  58. <p translate class="help-block">Select the folders to share with this device.</p>
  59. <div class="row">
  60. <div class="col-md-4" ng-repeat="folder in folderList()">
  61. <div class="checkbox">
  62. <label>
  63. <input type="checkbox" ng-model="currentDevice.selectedFolders[folder.id]"> {{folder.id}}
  64. </label>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. <div class="modal-footer">
  74. <button type="button" class="btn btn-primary btn-sm" ng-click="saveDevice()" ng-disabled="deviceEditor.$invalid">
  75. <span class="fa fa-check"></span>&nbsp;<span translate>Save</span>
  76. </button>
  77. <button type="button" class="btn btn-default btn-sm" ng-click="idDevice(currentDevice)" ng-if="editingExisting || deviceEditor.deviceID.$valid">
  78. <span class="fa fa-qrcode"></span>&nbsp;<span translate>Show QR</span>
  79. </button>
  80. <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
  81. <span class="fa fa-times"></span>&nbsp;<span translate>Close</span>
  82. </button>
  83. <button type="button" class="btn btn-warning pull-left btn-sm" ng-click="deleteDevice()" ng-if="editingExisting">
  84. <span class="fa fa-minus-circle"></span>&nbsp;<span translate>Remove</span>
  85. </button>
  86. </div>
  87. </div>
  88. </div>
  89. </div>