js.dashboard.dashboardController.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openmuc-webui-base Show documentation
Show all versions of openmuc-webui-base Show documentation
WebUI base for the OpenMUC framework.
(function(){
var injectParams = ['$scope', '$state', '$alert', '$translate', 'AvailableAppsService', 'AuthService'];
var DashboardController = function($scope, $state, $alert, $translate, AvailableAppsService, AuthService) {
$translate('LOADING_APP_DEPENDENCES_ERROR').then(function(text) {
$scope.loadingAppDependencesErrorText = text;
});
$translate('SESSION_EXPIRED').then(function(text) {
$scope.sessionExpiredText = text;
});
var appsAliases = [];
$scope.availableApps = [];
AvailableAppsService.getAll().then(function(response){
$scope.availableApps = response;
angular.forEach(response, function(index, value){
appsAliases.push(value.alias);
});
}, function(error) {
if (error.status == 401) {
AuthService.logout();
$alert({content: $scope.sessionExpiredText, type: 'warning'});
$state.go('home');
} else {
$alert({content: $scope.loadingAppDependencesErrorText, type: 'warning'});
}
});
};
DashboardController.$inject = injectParams;
angular.module('openmuc.dashboard').controller('DashboardController', DashboardController);
})();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy