Show restarting notification instead of network error (fixes #129)

This commit is contained in:
Jakob Borg
2014-04-16 15:16:44 +02:00
parent 116203aef8
commit 1ca7e47fd6
3 changed files with 35 additions and 5 deletions

View File

@@ -6,8 +6,9 @@
var syncthing = angular.module('syncthing', []);
syncthing.controller('SyncthingCtrl', function ($scope, $http) {
var prevDate = 0,
getOK = true;
var prevDate = 0;
var getOK = true;
var restarting = false;
$scope.connections = {};
$scope.config = {};
@@ -44,9 +45,16 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$('#networkError').modal('hide');
getOK = true;
}
if (restarting) {
$('#restarting').modal('hide');
restarting = false;
}
}
function getFailed() {
if (restarting) {
return;
}
if (getOK) {
$('#networkError').modal({backdrop: 'static', keyboard: false});
getOK = false;
@@ -234,6 +242,8 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
};
$scope.restart = function () {
restarting = true;
$('#restarting').modal('show');
$http.post('/rest/restart');
$scope.configInSync = true;
};