diff --git a/src/index.html b/src/index.html index 77c999104..dcd978909 100644 --- a/src/index.html +++ b/src/index.html @@ -143,7 +143,7 @@
  • Settings
  • Support
  • -
  • System Info
  • +
  • System
  • Logout
  • diff --git a/src/views/notifications.js b/src/views/notifications.js index b58f299e3..1439cf31a 100644 --- a/src/views/notifications.js +++ b/src/views/notifications.js @@ -111,5 +111,5 @@ angular.module('Application').controller('NotificationsController', ['$scope', ' Client.onReconnect(function () { $scope.notifications.refresh(); - }) + }); }]); diff --git a/src/views/system.html b/src/views/system.html index 1f63d72c2..15111e6cb 100644 --- a/src/views/system.html +++ b/src/views/system.html @@ -35,6 +35,24 @@ + + +
    @@ -141,4 +159,28 @@
    + +
    +

    Server

    +
    + +
    +
    +
    +

    + This server requires a reboot to finalize Ubuntu security updates. +

    +

    + Use this only when you experience unexpected behavior. All services and apps will be automatically started. +

    +
    +
    +
    +
    + Show Logs + +
    +
    +
    + diff --git a/src/views/system.js b/src/views/system.js index 3d61122e1..0f778a86f 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -126,6 +126,25 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati } }; + $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); + }); + } + }; function updateDiskGraphs() { // https://graphite.readthedocs.io/en/latest/render_api.html#paths-and-wildcards @@ -232,4 +251,9 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati }); }); }); + + Client.onReconnect(function () { + $scope.reboot.busy = false; + }); + }]);