Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
define(function (require) {
'use strict';
// create the alien4cloud-admin module for angular
var modules = require('modules');
var states = require('states');
// register admin root state
states.state('admin', {
url: '/admin',
templateUrl: 'views/_ref/admin/admin.html',
controller: 'LayoutCtrl',
menu: {
id: 'menu.admin',
state: 'admin',
key: 'NAVBAR.MENU_ADMIN',
icon: 'fa fa-wrench',
priority: 10000,
roles: ['ADMIN']
}
});
// register admin default home page
states.state('admin.home', {
url: '/',
templateUrl: 'views/_ref/admin/admin_home.html',
$scope.isAdmin = false;
var isAdmin = authService.hasRole('ADMIN');
if (_.defined(isAdmin.then)) {
authService.hasRole('ADMIN').then(function(result) {
$scope.isAdmin = result;
});
} else {
$scope.isAdmin = isAdmin;
}
$scope.adminTour = function() {
$state.go('admin');
hopscotchService.startTour('admin.home');
};
}]
});
states.state('restricted', {
url: '/restricted',
templateUrl: 'views/authentication/restricted.html'
});
require('scripts/common/services/rest_technical_error_interceptor');
var templateInjector = require('a4c-templates');
alien4cloud.startup = function(configuration) {
// Path initialization for ace ide so it find modules after minification
var config = window.ace.require('ace/config');
config.set('basePath', 'bower_components/ace-builds/src-min-noconflict');
// add requirements to alien4cloud
modules.link(alien4cloud);
alien4cloud.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider', '$qProvider',
// register admin root state
states.state('admin', {
url: '/admin',
templateUrl: 'views/_ref/admin/admin.html',
controller: 'LayoutCtrl',
menu: {
id: 'menu.admin',
state: 'admin',
key: 'NAVBAR.MENU_ADMIN',
icon: 'fa fa-wrench',
priority: 10000,
roles: ['ADMIN']
}
});
// register admin default home page
states.state('admin.home', {
url: '/',
templateUrl: 'views/_ref/admin/admin_home.html',
controller: 'LayoutCtrl'
});
states.forward('admin', 'admin.home');
var admin = modules.get('alien4cloud-admin');
// require admin modules
require('scripts/_ref/admin/controllers/admin_plugins');
require('scripts/_ref/admin/controllers/admin_server');
require('scripts/_ref/admin/controllers/admin_audit');
require('scripts/meta-props/controllers/meta_props_list');
require('scripts/_ref/admin/controllers/admin_repositories');
return admin;
define(function (require) {
'use strict';
var modules = require('modules');
var states = require('states');
var _ = require('lodash');
require('scripts/users/directives/groups');
require('scripts/users/directives/users');
require('scripts/common/directives/delete_confirm');
// register state for user management.
states.state('admin.users', {
url: '/users',
templateUrl: 'views/users/user_list.html',
controller: 'UsersCtrl',
menu: {
id: 'am.admin.users',
state: 'admin.users',
key: 'NAVADMIN.MENU_USERS',
icon: 'fa fa-users',
priority: 100
}
});
modules.get('a4c-security', ['a4c-common']).controller('UsersCtrl', ['$scope', '$rootScope', 'userServices', 'groupServices',
function($scope, $rootScope, userServices, groupServices) {
$scope.tabSelected = function(tabName) {
}
});
}],
params: {
// optional deploymentDTO object related to this state. Will save a backend request
deploymentDTO: null
}
});
states.forward(detailState, detailState + '.info');
/*
* detail info state
*/
var detailInfoState = detailState + '.info';
states.state(detailInfoState, {
url: '/info',
templateUrl: 'views/_ref/applications/deployment_history/deployment_detail_info.html',
controller: 'DeploymentDetailInfoCtrl',
menu: {
id: detailInfoState,
state: detailInfoState,
key: 'NAVAPPLICATIONS.MENU_DEPLOY_CURRENT_INFO',
icon: 'fa fa-info',
priority: 100
}
});
};
});
'use strict';
var modules = require('modules');
var states = require('states');
require('scripts/common/services/resize_services');
// make sure that required directives are loaded
require('scripts/components/directives/search_node_type');
require('scripts/common/directives/upload');
// load other locations to manage components
require('scripts/components/controllers/component_details');
require('scripts/components/controllers/csar_list');
// register components root state
states.state('components', {
url: '/components',
templateUrl: 'views/layout/vertical_menu_layout.html',
controller: 'LayoutCtrl',
menu: {
id: 'menu.components',
state: 'components',
key: 'NAVBAR.MENU_COMPONENTS',
icon: 'fa fa-cubes',
priority: 30,
roles: ['COMPONENTS_MANAGER', 'COMPONENTS_BROWSER']
}
});
states.state('components.components', {
url: '/components/list',
templateUrl: 'views/components/component_list.html',
controller: 'SearchComponentCtrl',
'use strict';
var states = require('states');
require('scripts/_ref/common/directives/breadcrumbs');
require('scripts/_ref/common/services/breadcrumbs_service');
// load other locations to manage catalog contain
require('scripts/_ref/catalog/controllers/archives/archives');
require('scripts/_ref/catalog/controllers/components/components');
require('scripts/_ref/catalog/controllers/components/policies');
require('scripts/_ref/catalog/controllers/topologies/topologies');
// register catalog root state
states.state('catalog', {
url: '/catalog',
templateUrl: 'views/_ref/layout/tab_menu_with_breadcrumbs_layout.html',
controller: 'LayoutCtrl',
menu: {
id: 'menu.catalog',
state: 'catalog',
key: 'NAVBAR.MENU_CATALOG',
icon: 'fa fa-cubes',
priority: 60,
}
});
states.forward('catalog', 'catalog.components');
});
'ui.router',
'pascalprecht.translate',
'xeditable',
'angularMoment'
]);
require(['clipboard'], function(Clipboard) {
new Clipboard('.btn-cb', {
text: function(trigger) {
return trigger.getAttribute("uib-tooltip");
}
});
});
// bootstrap angular js application
states.state('home', {
url: '/',
templateUrl: 'views/main.html',
controller: ['$scope', 'authService', 'hopscotchService', '$state', function($scope, authService, hopscotchService, $state) {
$scope.isAdmin = false;
var isAdmin = authService.hasRole('ADMIN');
if (_.defined(isAdmin.then)) {
authService.hasRole('ADMIN').then(function(result) {
$scope.isAdmin = result;
});
} else {
$scope.isAdmin = isAdmin;
}
$scope.adminTour = function() {
$state.go('admin');
hopscotchService.startTour('admin.home');
};
return function(prefix, getSearchParam) {
/*
* list state
*/
states.state(prefix+'.list', {
url: '',
templateUrl: 'views/_ref/applications/deployment_history/deployment_history_list.html',
controller: 'DeploymentHistoryCtrl',
resolve: {
historyConf: ['$stateParams',
function($stateParams) {
return {
rootState: prefix,
searchParam: getSearchParam($stateParams)
};
}
]
}
});
states.forward(prefix, prefix + '.list');
return function(prefix, menuOverrides) {
states.state(prefix + '.editor', {
url: '/editor',
templateUrl: 'views/topology/topology_editor.html',
controller: 'TopologyCtrl',
resolve: {
defaultFilters: [function(){return {};}],
badges: [function(){return[];}]
},
menu: override(menuOverrides, 'editor',{
id: 'am.' + prefix + '.editor',
state: prefix + '.editor',
key: 'EDITOR.MENU_TOPOLOGY',
icon: 'fa fa-sitemap',
show: true,
priority: 10
})
});