Files
redash/client/app/pages/admin/status/index.js
Arik Fraimovich b5e2234234 Set title
2016-11-27 15:49:17 +02:00

41 lines
873 B
JavaScript

import template from './status.html';
// TODO: switch to $ctrl instead of $scope.
function AdminStatusCtrl($scope, $http, $timeout, currentUser, Events) {
Events.record('view', 'page', 'admin/status');
const refresh = () => {
$http.get('/status.json').success((data) => {
$scope.workers = data.workers;
delete data.workers;
$scope.manager = data.manager;
delete data.manager;
$scope.status = data;
});
const timer = $timeout(refresh, 59 * 1000);
$scope.$on('$destroy', () => {
if (timer) {
$timeout.cancel(timer);
}
});
};
refresh();
}
export default function (ngModule) {
ngModule.component('statusPage', {
template,
controller: AdminStatusCtrl,
});
return {
'/admin/status': {
template: '<status-page></status-page>',
title: 'System Status',
},
};
}