Handle UI in restart/shutdown

This commit is contained in:
Jakob Borg 2014-07-29 11:59:11 +02:00
parent 6115631746
commit 51e9839237
2 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -55,10 +55,10 @@ syncthing.controller('EventCtrl', function ($scope, $http) {
online = false; online = false;
} }
setTimeout(function () { setTimeout(function () {
$http.get(urlbase + '/events?since=' + lastID) $http.get(urlbase + '/events?limit=1')
.success(successFn) .success(successFn)
.error(errorFn); .error(errorFn);
}, 500); }, 1000);
}; };
$http.get(urlbase + '/events?limit=1') $http.get(urlbase + '/events?limit=1')
@ -118,13 +118,16 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
} }
$scope.$on('UIOnline', function (event, arg) { $scope.$on('UIOnline', function (event, arg) {
console.log('UIOnline');
$scope.init(); $scope.init();
restarting = false;
$('#networkError').modal('hide'); $('#networkError').modal('hide');
$('#restarting').modal('hide'); $('#restarting').modal('hide');
$('#shutdown').modal('hide'); $('#shutdown').modal('hide');
}); });
$scope.$on('UIOffline', function (event, arg) { $scope.$on('UIOffline', function (event, arg) {
console.log('UIOffline');
if (!restarting) { if (!restarting) {
$('#networkError').modal({backdrop: 'static', keyboard: false}); $('#networkError').modal({backdrop: 'static', keyboard: false});
} }