mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
Fixed issue #239 Saving an unchanged config does not prompt for reboot
This commit is contained in:
parent
358862c7ad
commit
8a5a573851
File diff suppressed because one or more lines are too long
12
gui/app.js
12
gui/app.js
@ -10,6 +10,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
var prevDate = 0;
|
var prevDate = 0;
|
||||||
var getOK = true;
|
var getOK = true;
|
||||||
var restarting = false;
|
var restarting = false;
|
||||||
|
var oldOptions = {};
|
||||||
|
|
||||||
$scope.connections = {};
|
$scope.connections = {};
|
||||||
$scope.config = {};
|
$scope.config = {};
|
||||||
@ -251,13 +252,18 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.editSettings = function () {
|
$scope.editSettings = function () {
|
||||||
|
oldOptions = angular.copy($scope.config.Options);
|
||||||
$('#settings').modal({backdrop: 'static', keyboard: true});
|
$('#settings').modal({backdrop: 'static', keyboard: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.saveSettings = function () {
|
$scope.saveSettings = function () {
|
||||||
$scope.configInSync = false;
|
// Make sure something changed
|
||||||
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); });
|
if(! angular.equals(oldOptions, $scope.config.Options)){
|
||||||
$http.post(urlbase + '/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}});
|
$scope.configInSync = false;
|
||||||
|
$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'}});
|
||||||
|
}
|
||||||
|
|
||||||
$('#settings').modal("hide");
|
$('#settings').modal("hide");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user