Add support for multiple announce servers (fixes #677)
Somebody owes me a beer.
This commit is contained in:
committed by
Jakob Borg
parent
78981862be
commit
fd2d2c035e
@@ -245,7 +245,8 @@ angular.module('syncthing.core')
|
||||
var hasConfig = !isEmptyObject($scope.config);
|
||||
|
||||
$scope.config = config;
|
||||
$scope.config.Options.ListenStr = $scope.config.Options.ListenAddress.join(', ');
|
||||
$scope.config.Options.ListenAddressStr = $scope.config.Options.ListenAddress.join(', ');
|
||||
$scope.config.Options.GlobalAnnServersStr = $scope.config.Options.GlobalAnnServers.join(', ');
|
||||
|
||||
$scope.devices = $scope.config.Devices;
|
||||
$scope.devices.forEach(function (deviceCfg) {
|
||||
@@ -272,6 +273,14 @@ angular.module('syncthing.core')
|
||||
$http.get(urlbase + '/system').success(function (data) {
|
||||
$scope.myID = data.myID;
|
||||
$scope.system = data;
|
||||
$scope.announceServersTotal = Object.keys(data.extAnnounceOK).length;
|
||||
var failed = [];
|
||||
for (var server in data.extAnnounceOK) {
|
||||
if (!data.extAnnounceOK[server]) {
|
||||
failed.push(server);
|
||||
}
|
||||
}
|
||||
$scope.announceServersFailed = failed;
|
||||
console.log("refreshSystem", data);
|
||||
});
|
||||
}
|
||||
@@ -599,8 +608,11 @@ angular.module('syncthing.core')
|
||||
$scope.thisDevice().Name = $scope.tmpOptions.DeviceName;
|
||||
$scope.config.Options = angular.copy($scope.tmpOptions);
|
||||
$scope.config.GUI = angular.copy($scope.tmpGUI);
|
||||
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) {
|
||||
return x.trim();
|
||||
|
||||
['ListenAddress', 'GlobalAnnServers'].forEach(function (key) {
|
||||
$scope.config.Options[key] = $scope.config.Options[key + "Str"].split(/[ ,]+/).map(function (x) {
|
||||
return x.trim();
|
||||
});
|
||||
});
|
||||
|
||||
$scope.saveConfig();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
angular.module('syncthing.core')
|
||||
.directive('popover', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attributes) {
|
||||
$(element).popover();
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user