Reload configuration after lost connection or restart.

This commit is contained in:
Jakob Borg 2014-05-11 14:43:38 -03:00
parent 1a1f118f1a
commit a91eb701bf
2 changed files with 25 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@ -44,10 +44,12 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
function getSucceeded() {
if (!getOK) {
$scope.init();
$('#networkError').modal('hide');
getOK = true;
}
if (restarting) {
$scope.init();
$('#restarting').modal('hide');
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'}});
};
$scope.init = function() {
$http.get(urlbase + '/version').success(function (data) {
$scope.version = data;
});
@ -446,7 +449,9 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$http.get(urlbase + '/config/sync').success(function (data) {
$scope.configInSync = data.configInSync;
});
};
$scope.init();
setInterval($scope.refresh, 10000);
});