editDeviceModalView.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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,address) in discovery" value="{{ id }}" />
  17. </datalist>
  18. <div ng-if="editingExisting" class="well well-sm text-monospace">{{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. </p>
  25. </div>
  26. <div class="form-group">
  27. <label translate for="name">Device Name</label>
  28. <input id="name" class="form-control" type="text" ng-model="currentDevice.name"></input>
  29. <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>
  30. <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>
  31. </div>
  32. <div class="form-group">
  33. <label translate for="addresses">Addresses</label>
  34. <input ng-disabled="currentDevice.deviceID == myID" id="addresses" class="form-control" type="text" ng-model="currentDevice._addressesStr"></input>
  35. <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>
  36. </div>
  37. <div class="form-group">
  38. <label translate>Compression</label>
  39. <select class="form-control" ng-model="currentDevice.compression">
  40. <option value="always" translate>All Data</option>
  41. <option value="metadata" translate>Metadata Only</option>
  42. <option value="never" translate>Off</option>
  43. </select>
  44. </div>
  45. <div class="form-group">
  46. <div class="checkbox">
  47. <label>
  48. <input type="checkbox" ng-model="currentDevice.introducer"> <span translate>Introducer</span>
  49. </label>
  50. <p translate class="help-block">Any devices configured on an introducer device will be added to this device as well.</p>
  51. </div>
  52. </div>
  53. <div class="row">
  54. <div class="col-md-12">
  55. <div class="form-group">
  56. <label translate for="folders">Share Folders With Device</label>
  57. <p translate class="help-block">Select the folders to share with this device.</p>
  58. <div class="row">
  59. <div class="col-md-4" ng-repeat="folder in folderList()">
  60. <div class="checkbox">
  61. <label>
  62. <input type="checkbox" ng-model="currentDevice.selectedFolders[folder.id]"> {{folder.id}}
  63. </label>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </form>
  71. </div>
  72. <div class="modal-footer">
  73. <button type="button" class="btn btn-primary btn-sm" ng-click="saveDevice()" ng-disabled="deviceEditor.$invalid">
  74. <span class="fa fa-check"></span>&nbsp;<span translate>Save</span>
  75. </button>
  76. <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
  77. <span class="fa fa-times"></span>&nbsp;<span translate>Close</span>
  78. </button>
  79. <button type="button" class="btn btn-warning pull-left btn-sm" ng-click="deleteDevice()" ng-if="editingExisting">
  80. <span class="fa fa-minus-circle"></span>&nbsp;<span translate>Remove</span>
  81. </button>
  82. </div>
  83. </div>
  84. </div>
  85. </div>