bring back reboot button

This commit is contained in:
Girish Ramakrishnan
2020-03-17 22:09:34 -07:00
parent a7e2c74158
commit c278d0c5d4
4 changed files with 68 additions and 2 deletions

View File

@@ -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;
});
}]);