Node IDs are always upper case (ref #269)

This commit is contained in:
Jakob Borg
2014-05-24 21:01:21 +02:00
parent 217f29de76
commit e2cb0219c7
3 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -191,6 +191,7 @@ func Load(rd io.Reader, myID string) (Configuration, error) {
// Strip spaces and dashes // Strip spaces and dashes
node.NodeID = strings.Replace(node.NodeID, "-", "", -1) node.NodeID = strings.Replace(node.NodeID, "-", "", -1)
node.NodeID = strings.Replace(node.NodeID, " ", "", -1) node.NodeID = strings.Replace(node.NodeID, " ", "", -1)
node.NodeID = strings.ToUpper(node.NodeID)
} }
// Check for missing, bad or duplicate repository ID:s // Check for missing, bad or duplicate repository ID:s

View File

@@ -273,7 +273,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); }); $scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); });
$http.post(urlbase + '/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}}); $http.post(urlbase + '/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}});
} }
$('#settings').modal("hide"); $('#settings').modal("hide");
}; };
@@ -340,7 +340,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.configInSync = false; $scope.configInSync = false;
$('#editNode').modal('hide'); $('#editNode').modal('hide');
nodeCfg = $scope.currentNode; nodeCfg = $scope.currentNode;
nodeCfg.NodeID = nodeCfg.NodeID.replace(/ /g, '').replace(/-/g, '').trim(); nodeCfg.NodeID = nodeCfg.NodeID.replace(/ /g, '').replace(/-/g, '').toUpperCase().trim();
nodeCfg.Addresses = nodeCfg.AddressesStr.split(',').map(function (x) { return x.trim(); }); nodeCfg.Addresses = nodeCfg.AddressesStr.split(',').map(function (x) { return x.trim(); });
done = false; done = false;