Initial commit
This commit is contained in:
commit
880e39de2e
511 files changed
+38363
No files matched your search
@@ -0,0 +1,130 @@
|
||||
var portal = angular.module('portal', [
|
||||
'ui.bootstrap',
|
||||
'ui.router',
|
||||
'ui.grid',
|
||||
'ui.grid.saveState',
|
||||
'ui.grid.selection',
|
||||
'ui.grid.edit',
|
||||
'ui.grid.resizeColumns',
|
||||
'ui.grid.moveColumns',
|
||||
'ui.grid.expandable',
|
||||
'ui.grid.pinning',
|
||||
'ui.grid.autoResize',
|
||||
'ui.grid.exporter',
|
||||
'ui.grid.cellNav',
|
||||
'ui.grid.pagination',
|
||||
'ui.grid.treeView',
|
||||
'ui.tinymce',
|
||||
'ngResource',
|
||||
'ngCookies',
|
||||
'ngSanitize',
|
||||
'ngAnimate',
|
||||
'ngMessages',
|
||||
'ngMaterial',
|
||||
'ngMaterialDatePicker',
|
||||
'debounce',
|
||||
'portal.login',
|
||||
'portal.dashboard',
|
||||
'portal.dashboard.gitBank',
|
||||
'portal.dashboard.userBank',
|
||||
'portal.dashboard.credBank',
|
||||
'portal.dashboard.logBank',
|
||||
'portal.dashboard.scriptBank',
|
||||
'portal.dashboard.emailBank',
|
||||
'portal.dashboard.envBank',
|
||||
'portal.dashboard.permissionBank',
|
||||
'portal.common.constants',
|
||||
'portal.common.factories.pubsub',
|
||||
'portal.common.services.map',
|
||||
'portal.common.services.model.cache',
|
||||
'portal.common.services.model.rest',
|
||||
'portal.common.services.portalUtils',
|
||||
'portal.common.services.authorize',
|
||||
'portal.common.services.triggers',
|
||||
'portal.common.directives.portalTabset',
|
||||
'portal.common.directives.compareTo',
|
||||
'portal.common.directives.portalWebsocket',
|
||||
'portal.common.directives.permissions',
|
||||
'portal.common.partials.sessionEnd',
|
||||
'portal.common.partials.uploadpatchfile',
|
||||
'portal.common.partials.addGit',
|
||||
'portal.common.partials.addUser',
|
||||
'portal.common.partials.addDirectory',
|
||||
'portal.common.partials.addCreds',
|
||||
'portal.common.partials.addScript',
|
||||
'portal.common.partials.addEnvVars',
|
||||
'portal.common.partials.configuration',
|
||||
'portal.common.partials.fileinfo',
|
||||
'portal.common.partials.filevalidate',
|
||||
'portal.common.partials.addPermission',
|
||||
'portal.common.partials.viewScriptStatus',
|
||||
'portal.common.partials.loggerinfo',
|
||||
'portal.common.partials.smtpinfo',
|
||||
'portal.common.partials.addEmailTmpl',
|
||||
'portal.common.partials.seedinfo'
|
||||
]);
|
||||
|
||||
angular.module('portal').config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
|
||||
$urlRouterProvider.otherwise('/dashboard');
|
||||
/* Add New States Above, or else in the module, but not in both */
|
||||
$urlRouterProvider.when('', 'dashboard');
|
||||
|
||||
$httpProvider.defaults.useXDomain = true;
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With'];
|
||||
|
||||
$stateProvider.state('main', {
|
||||
url: '/main',
|
||||
pageTitle: 'Main',
|
||||
templateUrl: 'main/main.html',
|
||||
resolve: {
|
||||
authorize: ['authorize',
|
||||
function (authorize) {
|
||||
return authorize.validate({
|
||||
authorities: {
|
||||
account: ['USER', 'ADMIN']
|
||||
},
|
||||
redirect: 'dashboard'
|
||||
});
|
||||
}
|
||||
],
|
||||
}
|
||||
}).state('login', {
|
||||
url: '/login',
|
||||
pageTitle: 'Login',
|
||||
templateUrl: 'login/login.html'
|
||||
}).state('prohibited', {
|
||||
url: '/prohibited',
|
||||
pageTitle: 'Access Denied',
|
||||
templateUrl: 'prohibited/prohibited.html'
|
||||
}).state('main.prohibited', {
|
||||
url: '/prohibited',
|
||||
pageTitle: 'Access Denied',
|
||||
templateUrl: 'prohibited/prohibited.html'
|
||||
});
|
||||
|
||||
}); //end angular.module.config
|
||||
|
||||
angular.module('portal').run(function($rootScope, $state, $animate, $window, $location, $transitions) {
|
||||
$transitions.onSuccess({to: 'dashboard.**' }, function(trans){
|
||||
$rootScope.$broadcast('$stateChangeSuccess', trans.router.globals.$current.name);
|
||||
});
|
||||
|
||||
$rootScope.$on('$locationChangeSuccess', function(){
|
||||
$rootScope.actualLocation = $location.path();
|
||||
});
|
||||
|
||||
// Allows easy unregistering of listener callbacks
|
||||
// See https://stackoverflow.com/a/14898930
|
||||
$rootScope.$off = function (name, listener) {
|
||||
var namedListeners = $rootScope.$$listeners[name];
|
||||
if (namedListeners) {
|
||||
// Loop through the array of named listeners and remove them from the array.
|
||||
for (var i = 0; i < namedListeners.length; i++) {
|
||||
if (namedListeners[i] === listener) {
|
||||
return namedListeners.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});//end angular.module.run
|
||||
|
||||
Reference in new issue
Block a user