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

Split node ID's into multiple parts/chunks for readability
This commit is contained in:
Jakob Borg 2014-05-14 01:53:20 +02:00
commit 1f996afa21
3 changed files with 12 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -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',

View File

@ -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">