Allow node IDs with spaces/dashes in config. Use dashes in GUI. (ref #230)

This commit is contained in:
Jakob Borg
2014-05-18 12:05:17 +02:00
parent 729b0143e1
commit bbefcef53b
5 changed files with 74 additions and 8 deletions

View File

@@ -460,7 +460,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.init();
setInterval($scope.refresh, refreshInterval);
setInterval(heartbeat, 450);
setInterval(heartbeat, 650);
});
function nodeCompare(a, b) {
@@ -581,7 +581,7 @@ syncthing.filter('chunkID', function () {
var parts = input.match(/.{1,6}/g);
if (!parts)
return "";
return parts.join(' ');
return parts.join('-');
}
});

View File

@@ -368,10 +368,10 @@
<form role="form" name="nodeEditor">
<div class="form-group" ng-class="{'has-error': nodeEditor.nodeID.$invalid && nodeEditor.nodeID.$dirty}">
<label for="nodeID">Node ID</label>
<input ng-if="!editingExisting" name="nodeID" id="nodeID" class="form-control" type="text" ng-model="currentNode.NodeID" required></input>
<div ng-if="editingExisting" class="well well-sm">{{currentNode.NodeID | chunkID}}</div>
<input ng-if="!editingExisting" name="nodeID" id="nodeID" class="form-control text-monospace" type="text" ng-model="currentNode.NodeID" required></input>
<div ng-if="editingExisting" class="well well-sm text-monospace">{{currentNode.NodeID | chunkID}}</div>
<p class="help-block">
<span ng-if="nodeEditor.nodeID.$valid || nodeEditor.nodeID.$pristine">The node ID to enter here can be found in the "Add Node" dialog on the other node. Spaces are ignored.</span>
<span ng-if="nodeEditor.nodeID.$valid || nodeEditor.nodeID.$pristine">The node ID to enter here can be found in the "Add Node" dialog on the other node. Spaces and dashes are optional (ignored).</span>
<span ng-if="nodeEditor.nodeID.$error.required && nodeEditor.nodeID.$dirty">The node ID cannot be blank.</span>
</p>
</div>
@@ -388,7 +388,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 | chunkID}}</pre>
<div class="well well-sm text-monospace">{{myID | chunkID}}</div>
</div>
</div>
<div class="modal-footer">