mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 23:08:27 +00:00
Reload configuration after lost connection or restart.
This commit is contained in:
parent
1a1f118f1a
commit
a91eb701bf
File diff suppressed because one or more lines are too long
@ -44,10 +44,12 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
|
|
||||||
function getSucceeded() {
|
function getSucceeded() {
|
||||||
if (!getOK) {
|
if (!getOK) {
|
||||||
|
$scope.init();
|
||||||
$('#networkError').modal('hide');
|
$('#networkError').modal('hide');
|
||||||
getOK = true;
|
getOK = true;
|
||||||
}
|
}
|
||||||
if (restarting) {
|
if (restarting) {
|
||||||
|
$scope.init();
|
||||||
$('#restarting').modal('hide');
|
$('#restarting').modal('hide');
|
||||||
restarting = false;
|
restarting = false;
|
||||||
}
|
}
|
||||||
@ -421,6 +423,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
$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'}});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.init = function() {
|
||||||
$http.get(urlbase + '/version').success(function (data) {
|
$http.get(urlbase + '/version').success(function (data) {
|
||||||
$scope.version = data;
|
$scope.version = data;
|
||||||
});
|
});
|
||||||
@ -446,7 +449,9 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
$http.get(urlbase + '/config/sync').success(function (data) {
|
$http.get(urlbase + '/config/sync').success(function (data) {
|
||||||
$scope.configInSync = data.configInSync;
|
$scope.configInSync = data.configInSync;
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.init();
|
||||||
setInterval($scope.refresh, 10000);
|
setInterval($scope.refresh, 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user