diff --git a/src/index.html b/src/index.html index 44a409d3d..51462c767 100644 --- a/src/index.html +++ b/src/index.html @@ -107,6 +107,25 @@ {{ 'main.offline' | tr }} + + +
diff --git a/src/js/main.js b/src/js/main.js index 83fa64bbb..1294bf5d9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -13,6 +13,28 @@ angular.module('Application').controller('MainController', ['$scope', '$route', $scope.notifications = []; $scope.hideNavBarActions = $location.path() === '/logs'; + $scope.reboot = { + busy: false, + + show: function () { + $scope.reboot.busy = false; + $('#rebootModal').modal('show'); + }, + + submit: function () { + $scope.reboot.busy = true; + + Client.reboot(function (error) { + if (error) return Client.error(error); + + $('#rebootModal').modal('hide'); + + // trigger refetch to show offline banner + $timeout(function () { Client.getStatus(function () {}); }, 5000); + }); + } + }; + $scope.isActive = function (url) { if (!$route.current) return false; return $route.current.$$route.originalPath.indexOf(url) === 0; diff --git a/src/views/notifications.html b/src/views/notifications.html index aac43dce4..310987edf 100644 --- a/src/views/notifications.html +++ b/src/views/notifications.html @@ -1,21 +1,3 @@ - - -
@@ -44,7 +26,7 @@

{{ notification.messageJson | json }}
- +
diff --git a/src/views/notifications.js b/src/views/notifications.js index 4067a84c5..fbfb19b6c 100644 --- a/src/views/notifications.js +++ b/src/views/notifications.js @@ -2,34 +2,10 @@ /* global async */ /* global angular */ -/* global $ */ angular.module('Application').controller('NotificationsController', ['$scope', '$timeout', 'Client', function ($scope, $timeout, Client) { - $scope.clearAllBusy = false; - $scope.reboot = { - busy: false, - - show: function () { - $scope.reboot.busy = false; - $('#rebootModal').modal('show'); - }, - - submit: function () { - $scope.reboot.busy = true; - - Client.reboot(function (error) { - if (error) return Client.error(error); - - $('#rebootModal').modal('hide'); - - // trigger refetch to show offline banner - $timeout(function () { Client.getStatus(function () {}); }, 5000); - }); - } - }; - $scope.notifications = { notifications: [], activeNotification: null, diff --git a/src/views/system.html b/src/views/system.html index 4d51e3f15..4f6a3d803 100644 --- a/src/views/system.html +++ b/src/views/system.html @@ -1,29 +1,10 @@ - - -

{{ 'system.title' | tr }} Show Logs - +

diff --git a/src/views/system.js b/src/views/system.js index 9387f6f32..36a83918d 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -29,26 +29,6 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati return getRandomColor(); } - $scope.reboot = { - busy: false, - show: function () { - $scope.reboot.busy = false; - $('#rebootModal').modal('show'); - }, - submit: function () { - $scope.reboot.busy = true; - - Client.reboot(function (error) { - if (error) return Client.error(error); - - $('#rebootModal').modal('hide'); - - // trigger refetch to show offline banner - $timeout(function () { Client.getStatus(function () {}); }, 8000); - }); - } - }; - $scope.disks = { busy: true, errorMessage: '',