Browse Source

Merge pull request #202 from veeti/node-id-readability

Split node ID's into multiple parts/chunks for readability
Jakob Borg 11 years ago
parent
commit
1f996afa21
3 changed files with 10 additions and 3 deletions
  1. 0 0
      auto/gui.files.go
  2. 7 0
      gui/app.js
  3. 3 3
      gui/index.html

File diff suppressed because it is too large
+ 0 - 0
auto/gui.files.go


+ 7 - 0
gui/app.js

@@ -309,6 +309,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
         $scope.configInSync = false;
         $('#editNode').modal('hide');
         nodeCfg = $scope.currentNode;
+        nodeCfg.NodeID = nodeCfg.NodeID.replace(/ /g, '').trim();
         nodeCfg.Addresses = nodeCfg.AddressesStr.split(',').map(function (x) { return x.trim(); });
 
         done = false;
@@ -537,6 +538,12 @@ syncthing.filter('alwaysNumber', function () {
     };
 });
 
+syncthing.filter('chunkID', function () {
+    return function (input) {
+        return input.match(/.{1,6}/g).join(' ');
+    }
+});
+
 syncthing.directive('optionEditor', function () {
     return {
         restrict: 'C',

+ 3 - 3
gui/index.html

@@ -362,8 +362,8 @@
             <div class="form-group">
               <label for="nodeID">Node ID</label>
               <input ng-if="!editingExisting" id="nodeID" class="form-control" type="text" ng-model="currentNode.NodeID"></input>
-              <div ng-if="editingExisting" class="well well-sm">{{currentNode.NodeID}}</div>
-              <p class="help-block">The node ID can be found in the "Add Node" dialog on the other node.</p>
+              <div ng-if="editingExisting" class="well well-sm">{{currentNode.NodeID | chunkID}}</div>
+              <p class="help-block">The node ID can be found in the "Add Node" dialog on the other node. Spaces are ignored.</p>
             </div>
             <div class="form-group">
               <label for="name">Name</label>
@@ -378,7 +378,7 @@
           </form>
           <div ng-show="!editingExisting">
             When adding a new node, keep in mind that <em>this node</em> must be added on the other side too. The Node ID of this node is:
-            <pre>{{myID}}</pre>
+            <pre>{{myID | chunkID}}</pre>
           </div>
         </div>
         <div class="modal-footer">

Some files were not shown because too many files changed in this diff