Move reboot server dialog and logic to main view

This commit is contained in:
Johannes Zellner
2020-11-05 16:45:45 +01:00
parent 61c1622cbf
commit 93a7137d10
6 changed files with 43 additions and 83 deletions
-24
View File
@@ -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,