diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index bd07b7d3e9..a56746f3d3 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -38,7 +38,6 @@ import breadcrumbs from './shared/breadcrumbs/main'; // modules import setupMenu from './setup-menu/main'; import mainMenu from './main-menu/main'; -import breadCrumb from './bread-crumb/main'; import browserData from './browser-data/main'; import dashboard from './dashboard/main'; import moment from './shared/moment/main'; @@ -78,11 +77,11 @@ __deferLoadIfEnabled(); var tower = angular.module('Tower', [ // 'ngAnimate', - 'ngRoute', + // 'ngRoute', 'ngSanitize', 'ngCookies', RestServices.name, - routeExtensions.name, + // routeExtensions.name, browserData.name, breadcrumbs.name, systemTracking.name, @@ -91,7 +90,6 @@ var tower = angular.module('Tower', [ managementJobs.name, setupMenu.name, mainMenu.name, - breadCrumb.name, dashboard.name, moment.name, templateUrl.name, @@ -185,7 +183,8 @@ var tower = angular.module('Tower', [ 'PortalJobsListDefinition', 'features', 'longDateFilter', - 'pendolytics' + 'pendolytics', + 'ui.router' ]) .constant('AngularScheduler.partials', urlPrefix + 'lib/angular-scheduler/lib/') @@ -195,636 +194,709 @@ var tower = angular.module('Tower', [ .config(['$pendolyticsProvider', function($pendolyticsProvider) { $pendolyticsProvider.doNotAutoStart(); }]) - .config(['$routeProvider', - function ($routeProvider) { - $routeProvider. + .config(['$stateProvider', '$urlRouterProvider', + function($stateProvider, $urlRouterProvider){ - when('/jobs', { - name: 'jobs', - templateUrl: urlPrefix + 'partials/jobs.html', - controller: JobsListController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). + $urlRouterProvider.otherwise("/home"); - when('/portal', { - name: 'portal', - templateUrl: urlPrefix + 'partials/portal.html', - controller: PortalController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/jobs/:id', { - name: 'jobDetail', - templateUrl: urlPrefix + 'partials/job_detail.html', - controller: JobDetailController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }], - jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { - if (!$rootScope.event_socket) { - $rootScope.event_socket = Socket({ - scope: $rootScope, - endpoint: "job_events" - }); - $rootScope.event_socket.init(); - return true; - } else { - return true; + $stateProvider + .state('signIn', { + url: '/login', + templateUrl: urlPrefix + 'login/loginBackDrop.partial.html', + controller: ['$rootScope', 'Authorization', function($rootScope, Authorization) { + if (Authorization.isUserLoggedIn()) { + Authorization.logout(); } + $(".LoginModal-dialog").remove(); }] - } - }). - - when('/jobs/:id/stdout', { - name: 'jobsStdout', - templateUrl: urlPrefix + 'partials/job_stdout.html', - controller: JobStdoutController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }], - jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { - if (!$rootScope.event_socket) { - $rootScope.event_socket = Socket({ - scope: $rootScope, - endpoint: "job_events" - }); - $rootScope.event_socket.init(); - return true; - } else { - return true; - } + }) + .state('signOut', { + url: '/logout', + templateUrl: urlPrefix + 'partials/blank.html', + controller: ['Authorization', '$location', function(Authorization, $location) { + Authorization.logout(); + // $state.go('signIn'); + $location.url('/login'); }] - } - }). - - when('/ad_hoc_commands/:id', { - name: 'adHocJobStdout', - templateUrl: urlPrefix + 'partials/job_stdout_adhoc.html', - controller: JobStdoutController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }], - adhocEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { - if (!$rootScope.adhoc_event_socket) { - $rootScope.adhoc_event_socket = Socket({ - scope: $rootScope, - endpoint: "ad_hoc_command_events" - }); - $rootScope.adhoc_event_socket.init(); - return true; - } else { - return true; - } - }] - } - }). - - when('/job_templates', { - name: 'jobTemplates', - templateUrl: urlPrefix + 'partials/job_templates.html', - controller: JobTemplatesList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/job_templates/add', { - name: 'jobTemplateAdd', - templateUrl: urlPrefix + 'partials/job_templates.html', - controller: JobTemplatesAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/job_templates/:template_id', { - name: 'jobTemplateEdit', - templateUrl: urlPrefix + 'partials/job_templates.html', - controller: JobTemplatesEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/job_templates/:id/schedules', { - name: 'jobTemplateSchedules', - templateUrl: urlPrefix + 'partials/schedule_detail.html', - controller: ScheduleEditController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects', { - name: 'projects', - templateUrl: urlPrefix + 'partials/projects.html', - controller: ProjectsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects/add', { - name: 'projectAdd', - templateUrl: urlPrefix + 'partials/projects.html', - controller: ProjectsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects/:id', { - name: 'projectEdit', - templateUrl: urlPrefix + 'partials/projects.html', - controller: ProjectsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects/:id/schedules', { - name: 'projectSchedules', - templateUrl: urlPrefix + 'partials/schedule_detail.html', - controller: ScheduleEditController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects/:project_id/organizations', { - name: 'projectOrganizations', - templateUrl: urlPrefix + 'partials/projects.html', - controller: OrganizationsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/projects/:project_id/organizations/add', { - name: 'projectOrganizationAdd', - templateUrl: urlPrefix + 'partials/projects.html', - controller: OrganizationsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories', { - name: 'inventories', - templateUrl: urlPrefix + 'partials/inventories.html', - controller: InventoriesList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories/add', { - name: 'inventoryAdd', - templateUrl: urlPrefix + 'partials/inventories.html', - controller: InventoriesAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories/:inventory_id', { - name: 'inventoryEdit', - templateUrl: urlPrefix + 'partials/inventories.html', - controller: InventoriesEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories/:inventory_id/job_templates/add', { - name: 'inventoryJobTemplateAdd', - templateUrl: urlPrefix + 'partials/job_templates.html', - controller: JobTemplatesAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories/:inventory_id/job_templates/', { - redirectTo: '/inventories/:inventory_id' - }). - - when('/inventories/:inventory_id/job_templates/:template_id', { - name: 'inventoryJobTemplateEdit', - templateUrl: urlPrefix + 'partials/job_templates.html', - controller: JobTemplatesEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/inventories/:inventory_id/manage', { - name: 'inventoryManage', - templateUrl: urlPrefix + 'partials/inventory-manage.html', - controller: InventoriesManage, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations', { - name: 'organizations', - templateUrl: urlPrefix + 'partials/organizations.html', - controller: OrganizationsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/add', { - name: 'organizationAdd', - templateUrl: urlPrefix + 'partials/organizations.html', - controller: OrganizationsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/:organization_id', { - name: 'organizationEdit', - templateUrl: urlPrefix + 'partials/organizations.html', - controller: OrganizationsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/:organization_id/admins', { - name: 'organizationAdmins', - templateUrl: urlPrefix + 'partials/organizations.html', - controller: AdminsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/:organization_id/users', { - name: 'organizationUsers', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/:organization_id/users/add', { - name: 'organizationUserAdd', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/organizations/:organization_id/users/:user_id', { - name: 'organizationUserEdit', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams', { - name: 'teams', - templateUrl: urlPrefix + 'partials/teams.html', - controller: TeamsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/add', { - name: 'teamsAdd', - templateUrl: urlPrefix + 'partials/teams.html', - controller: TeamsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id', { - name: 'teamEdit', - templateUrl: urlPrefix + 'partials/teams.html', - controller: TeamsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/users', { - name: 'teamUsers', - templateUrl: urlPrefix + 'partials/teams.html', - controller: UsersList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/users/:user_id', { - name: 'teamUserEdit', - templateUrl: urlPrefix + 'partials/teams.html', - controller: UsersEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/projects', { - name: 'teamProjects', - templateUrl: urlPrefix + 'partials/teams.html', - controller: ProjectsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/projects/add', { - name: 'teamProjectAdd', - templateUrl: urlPrefix + 'partials/teams.html', - controller: ProjectsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/projects/:project_id', { - name: 'teamProjectEdit', - templateUrl: urlPrefix + 'partials/teams.html', - controller: ProjectsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/credentials', { - name: 'teamCredentials', - templateUrl: urlPrefix + 'partials/teams.html', - controller: CredentialsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/credentials/add', { - name: 'teamCredentialAdd', - templateUrl: urlPrefix + 'partials/teams.html', - controller: CredentialsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:team_id/credentials/:credential_id', { - name: 'teamCredentialEdit', - templateUrl: urlPrefix + 'partials/teams.html', - controller: CredentialsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/credentials', { - name: 'credentials', - templateUrl: urlPrefix + 'partials/credentials.html', - controller: CredentialsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/credentials/add', { - name: 'credentialAdd', - templateUrl: urlPrefix + 'partials/credentials.html', - controller: CredentialsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/credentials/:credential_id', { - name: 'credentialEdit', - templateUrl: urlPrefix + 'partials/credentials.html', - controller: CredentialsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/users', { - name: 'users', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/users/add', { - name: 'userAdd', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/users/:user_id', { - name: 'userEdit', - templateUrl: urlPrefix + 'partials/users.html', - controller: UsersEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/users/:user_id/credentials', { - name: 'userCredentials', - templateUrl: urlPrefix + 'partials/users.html', - controller: CredentialsList, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/users/:user_id/credentials/add', { - name: 'userCredentialAdd', - templateUrl: urlPrefix + 'partials/teams.html', - controller: CredentialsAdd, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/teams/:user_id/credentials/:credential_id', { - name: 'teamUserCredentialEdit', - templateUrl: urlPrefix + 'partials/teams.html', - controller: CredentialsEdit, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/home', { - name: 'dashboard', - templateUrl: urlPrefix + 'partials/home.html', - controller: Home, - resolve: { - graphData: ['$q', 'jobStatusGraphData', 'FeaturesService', function($q, jobStatusGraphData, FeaturesService) { - return $q.all({ - jobStatus: jobStatusGraphData.get("month", "all"), - features: FeaturesService.get() - }); - }] - } - }). - - when('/home/groups', { - name: 'dashboardGroups', - templateUrl: urlPrefix + 'partials/subhome.html', - controller: HomeGroups, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/home/hosts', { - name: 'dashboardHosts', - templateUrl: urlPrefix + 'partials/subhome.html', - controller: HomeHosts, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/license', { - name: 'license', - templateUrl: urlPrefix + 'partials/license.html', - controller: LicenseController, - resolve: { - features: ['FeaturesService', function(FeaturesService) { - return FeaturesService.get(); - }] - } - }). - - when('/sockets', { - name: 'sockets', - templateUrl: urlPrefix + 'partials/sockets.html', - controller: SocketsController - }). - - otherwise({ - redirectTo: '/home' - }); + }) + .state('dashboard', { + url: "/home", + templateUrl: urlPrefix + "partials/home.html", + controller: Home, + resolve: { + graphData: ['$q', 'jobStatusGraphData', 'FeaturesService', function($q, jobStatusGraphData, FeaturesService) { + return $q.all({ + jobStatus: jobStatusGraphData.get("month", "all"), + features: FeaturesService.get() + }); + }] + } + }) + .state('inventories', { + url: "/inventories", + templateUrl: urlPrefix + "partials/inventories.html", + controller: InventoriesList + }) + .state('inventories.add', { + url: "/add", + templateUrl: urlPrefix + "partials/inventory-add.html", + controller: InventoriesAdd + }) + .state('inventoriesManage', { + url: "/inventories/:inventory_id/manage?groups", + templateUrl: urlPrefix + 'partials/inventory-manage.html', + controller: InventoriesManage + }); + // .state('state1.list', { + // url: "/list", + // templateUrl: "partials/state1.list.html", + // controller: function($scope) { + // $scope.items = ["A", "List", "Of", "Items"]; + // } + // }) + // .state('state2', { + // url: "/state2", + // templateUrl: "partials/state2.html" + // }) + // .state('state2.list', { + // url: "/list", + // templateUrl: "partials/state2.list.html", + // controller: function($scope) { + // $scope.things = ["A", "Set", "Of", "Things"]; + // } + // }); } ]) + // .config(['$routeProvider', + // function ($routeProvider) { + // $routeProvider. + // + // when('/jobs', { + // name: 'jobs', + // templateUrl: urlPrefix + 'partials/jobs.html', + // controller: JobsListController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/portal', { + // name: 'portal', + // templateUrl: urlPrefix + 'partials/portal.html', + // controller: PortalController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/jobs/:id', { + // name: 'jobDetail', + // templateUrl: urlPrefix + 'partials/job_detail.html', + // controller: JobDetailController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }], + // jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + // if (!$rootScope.event_socket) { + // $rootScope.event_socket = Socket({ + // scope: $rootScope, + // endpoint: "job_events" + // }); + // $rootScope.event_socket.init(); + // return true; + // } else { + // return true; + // } + // }] + // } + // }). + // + // when('/jobs/:id/stdout', { + // name: 'jobsStdout', + // templateUrl: urlPrefix + 'partials/job_stdout.html', + // controller: JobStdoutController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }], + // jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + // if (!$rootScope.event_socket) { + // $rootScope.event_socket = Socket({ + // scope: $rootScope, + // endpoint: "job_events" + // }); + // $rootScope.event_socket.init(); + // return true; + // } else { + // return true; + // } + // }] + // } + // }). + // + // when('/ad_hoc_commands/:id', { + // name: 'adHocJobStdout', + // templateUrl: urlPrefix + 'partials/job_stdout_adhoc.html', + // controller: JobStdoutController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }], + // adhocEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + // if (!$rootScope.adhoc_event_socket) { + // $rootScope.adhoc_event_socket = Socket({ + // scope: $rootScope, + // endpoint: "ad_hoc_command_events" + // }); + // $rootScope.adhoc_event_socket.init(); + // return true; + // } else { + // return true; + // } + // }] + // } + // }). + // + // when('/job_templates', { + // name: 'jobTemplates', + // templateUrl: urlPrefix + 'partials/job_templates.html', + // controller: JobTemplatesList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/job_templates/add', { + // name: 'jobTemplateAdd', + // templateUrl: urlPrefix + 'partials/job_templates.html', + // controller: JobTemplatesAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/job_templates/:template_id', { + // name: 'jobTemplateEdit', + // templateUrl: urlPrefix + 'partials/job_templates.html', + // controller: JobTemplatesEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/job_templates/:id/schedules', { + // name: 'jobTemplateSchedules', + // templateUrl: urlPrefix + 'partials/schedule_detail.html', + // controller: ScheduleEditController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects', { + // name: 'projects', + // templateUrl: urlPrefix + 'partials/projects.html', + // controller: ProjectsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects/add', { + // name: 'projectAdd', + // templateUrl: urlPrefix + 'partials/projects.html', + // controller: ProjectsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects/:id', { + // name: 'projectEdit', + // templateUrl: urlPrefix + 'partials/projects.html', + // controller: ProjectsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects/:id/schedules', { + // name: 'projectSchedules', + // templateUrl: urlPrefix + 'partials/schedule_detail.html', + // controller: ScheduleEditController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects/:project_id/organizations', { + // name: 'projectOrganizations', + // templateUrl: urlPrefix + 'partials/projects.html', + // controller: OrganizationsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/projects/:project_id/organizations/add', { + // name: 'projectOrganizationAdd', + // templateUrl: urlPrefix + 'partials/projects.html', + // controller: OrganizationsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // // when('/inventories', { + // // name: 'inventories', + // // templateUrl: urlPrefix + 'partials/inventories.html', + // // controller: InventoriesList, + // // resolve: { + // // features: ['FeaturesService', function(FeaturesService) { + // // return FeaturesService.get(); + // // }] + // // } + // // }). + // // + // // when('/inventories/add', { + // // name: 'inventoryAdd', + // // templateUrl: urlPrefix + 'partials/inventories.html', + // // controller: InventoriesAdd, + // // resolve: { + // // features: ['FeaturesService', function(FeaturesService) { + // // return FeaturesService.get(); + // // }] + // // } + // // }). + // + // when('/inventories/:inventory_id', { + // name: 'inventoryEdit', + // templateUrl: urlPrefix + 'partials/inventories.html', + // controller: InventoriesEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/inventories/:inventory_id/job_templates/add', { + // name: 'inventoryJobTemplateAdd', + // templateUrl: urlPrefix + 'partials/job_templates.html', + // controller: JobTemplatesAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/inventories/:inventory_id/job_templates/', { + // redirectTo: '/inventories/:inventory_id' + // }). + // + // when('/inventories/:inventory_id/job_templates/:template_id', { + // name: 'inventoryJobTemplateEdit', + // templateUrl: urlPrefix + 'partials/job_templates.html', + // controller: JobTemplatesEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/inventories/:inventory_id/manage', { + // name: 'inventoryManage', + // templateUrl: urlPrefix + 'partials/inventory-manage.html', + // controller: InventoriesManage, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations', { + // name: 'organizations', + // templateUrl: urlPrefix + 'partials/organizations.html', + // controller: OrganizationsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/add', { + // name: 'organizationAdd', + // templateUrl: urlPrefix + 'partials/organizations.html', + // controller: OrganizationsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/:organization_id', { + // name: 'organizationEdit', + // templateUrl: urlPrefix + 'partials/organizations.html', + // controller: OrganizationsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/:organization_id/admins', { + // name: 'organizationAdmins', + // templateUrl: urlPrefix + 'partials/organizations.html', + // controller: AdminsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/:organization_id/users', { + // name: 'organizationUsers', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/:organization_id/users/add', { + // name: 'organizationUserAdd', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/organizations/:organization_id/users/:user_id', { + // name: 'organizationUserEdit', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams', { + // name: 'teams', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: TeamsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/add', { + // name: 'teamsAdd', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: TeamsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id', { + // name: 'teamEdit', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: TeamsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/users', { + // name: 'teamUsers', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: UsersList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/users/:user_id', { + // name: 'teamUserEdit', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: UsersEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/projects', { + // name: 'teamProjects', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: ProjectsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/projects/add', { + // name: 'teamProjectAdd', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: ProjectsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/projects/:project_id', { + // name: 'teamProjectEdit', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: ProjectsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/credentials', { + // name: 'teamCredentials', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: CredentialsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/credentials/add', { + // name: 'teamCredentialAdd', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: CredentialsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:team_id/credentials/:credential_id', { + // name: 'teamCredentialEdit', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: CredentialsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/credentials', { + // name: 'credentials', + // templateUrl: urlPrefix + 'partials/credentials.html', + // controller: CredentialsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/credentials/add', { + // name: 'credentialAdd', + // templateUrl: urlPrefix + 'partials/credentials.html', + // controller: CredentialsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/credentials/:credential_id', { + // name: 'credentialEdit', + // templateUrl: urlPrefix + 'partials/credentials.html', + // controller: CredentialsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/users', { + // name: 'users', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/users/add', { + // name: 'userAdd', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/users/:user_id', { + // name: 'userEdit', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: UsersEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/users/:user_id/credentials', { + // name: 'userCredentials', + // templateUrl: urlPrefix + 'partials/users.html', + // controller: CredentialsList, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/users/:user_id/credentials/add', { + // name: 'userCredentialAdd', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: CredentialsAdd, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/teams/:user_id/credentials/:credential_id', { + // name: 'teamUserCredentialEdit', + // templateUrl: urlPrefix + 'partials/teams.html', + // controller: CredentialsEdit, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/home', { + // name: 'dashboard', + // templateUrl: urlPrefix + 'partials/home.html', + // controller: Home, + // resolve: { + // graphData: ['$q', 'jobStatusGraphData', 'FeaturesService', function($q, jobStatusGraphData, FeaturesService) { + // return $q.all({ + // jobStatus: jobStatusGraphData.get("month", "all"), + // features: FeaturesService.get() + // }); + // }] + // } + // }). + // + // when('/home/groups', { + // name: 'dashboardGroups', + // templateUrl: urlPrefix + 'partials/subhome.html', + // controller: HomeGroups, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/home/hosts', { + // name: 'dashboardHosts', + // templateUrl: urlPrefix + 'partials/subhome.html', + // controller: HomeHosts, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/license', { + // name: 'license', + // templateUrl: urlPrefix + 'partials/license.html', + // controller: LicenseController, + // resolve: { + // features: ['FeaturesService', function(FeaturesService) { + // return FeaturesService.get(); + // }] + // } + // }). + // + // when('/sockets', { + // name: 'sockets', + // templateUrl: urlPrefix + 'partials/sockets.html', + // controller: SocketsController + // }). + // + // otherwise({ + // redirectTo: '/home' + // }); + // } + // ]) .config(['$provide', function($provide) { $provide.decorator('$log', ['$delegate', function($delegate) { @@ -966,58 +1038,58 @@ var tower = angular.module('Tower', [ },2000); }); - $rootScope.$on("$routeChangeStart", function (event, next, prev) { - // this line removes the query params attached to a route - if(prev && prev.$$route && - prev.$$route.name === 'systemTracking'){ - $location.replace($location.search('').$$url); - } - - // Before navigating away from current tab, make sure the primary view is visible - if ($('#stream-container').is(':visible')) { - HideStream(); - } - - // remove any lingering intervals - if ($rootScope.jobDetailInterval) { - window.clearInterval($rootScope.jobDetailInterval); - } - if ($rootScope.jobStdOutInterval) { - window.clearInterval($rootScope.jobStdOutInterval); - } - - // On each navigation request, check that the user is logged in - if (!/^\/(login|logout)/.test($location.path())) { - // capture most recent URL, excluding login/logout - $rootScope.lastPath = $location.path(); - $rootScope.enteredPath = $location.path(); - $cookieStore.put('lastPath', $location.path()); - } - - if (Authorization.isUserLoggedIn() === false) { - if (next.templateUrl !== (urlPrefix + 'login/loginBackDrop.partial.html')) { - $location.path('/login'); - } - } else if ($rootScope && $rootScope.sessionTimer && $rootScope.sessionTimer.isExpired()) { - // gets here on timeout - if (next.templateUrl !== (urlPrefix + 'login/loginBackDrop.partial.html')) { - $rootScope.sessionTimer.expireSession('idle'); - if (sock&& sock.socket && sock.socket.socket) { - sock.socket.socket.disconnect(); - } - $location.path('/login'); - } - } else { - if ($rootScope.current_user === undefined || $rootScope.current_user === null) { - Authorization.restoreUserInfo(); //user must have hit browser refresh - } - if (next && next.$$route && (!/^\/(login|logout)/.test(next.$$route.originalPath))) { - // if not headed to /login or /logout, then check the license - CheckLicense.test(); - } - } - activateTab(); - }); + // $rootScope.$on("$routeChangeStart", function (event, next, prev) { + // // this line removes the query params attached to a route + // if(prev && prev.$$route && + // prev.$$route.name === 'systemTracking'){ + // $location.replace($location.search('').$$url); + // } + // + // // Before navigating away from current tab, make sure the primary view is visible + // if ($('#stream-container').is(':visible')) { + // HideStream(); + // } + // + // // remove any lingering intervals + // if ($rootScope.jobDetailInterval) { + // window.clearInterval($rootScope.jobDetailInterval); + // } + // if ($rootScope.jobStdOutInterval) { + // window.clearInterval($rootScope.jobStdOutInterval); + // } + // + // // On each navigation request, check that the user is logged in + // if (!/^\/(login|logout)/.test($location.path())) { + // // capture most recent URL, excluding login/logout + // $rootScope.lastPath = $location.path(); + // $rootScope.enteredPath = $location.path(); + // $cookieStore.put('lastPath', $location.path()); + // } + // + // if (Authorization.isUserLoggedIn() === false) { + // if (next.templateUrl !== (urlPrefix + 'login/loginBackDrop.partial.html')) { + // $location.path('/login'); + // } + // } else if ($rootScope && $rootScope.sessionTimer && $rootScope.sessionTimer.isExpired()) { + // // gets here on timeout + // if (next.templateUrl !== (urlPrefix + 'login/loginBackDrop.partial.html')) { + // $rootScope.sessionTimer.expireSession('idle'); + // if (sock&& sock.socket && sock.socket.socket) { + // sock.socket.socket.disconnect(); + // } + // $location.path('/login'); + // } + // } else { + // if ($rootScope.current_user === undefined || $rootScope.current_user === null) { + // Authorization.restoreUserInfo(); //user must have hit browser refresh + // } + // if (next && next.$$route && (!/^\/(login|logout)/.test(next.$$route.originalPath))) { + // // if not headed to /login or /logout, then check the license + // CheckLicense.test(); + // } + // } + // activateTab(); + // }); if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) { // User not authenticated, redirect to login page diff --git a/awx/ui/client/src/controllers/Inventories.js b/awx/ui/client/src/controllers/Inventories.js index 187a99d10e..840ee6069c 100644 --- a/awx/ui/client/src/controllers/Inventories.js +++ b/awx/ui/client/src/controllers/Inventories.js @@ -16,7 +16,7 @@ export function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream, - EditInventoryProperties, Find, Empty, LogViewer) { + EditInventoryProperties, Find, Empty, LogViewer, $state) { var list = InventoryList, defaultUrl = GetBasePath('inventory'), @@ -312,7 +312,8 @@ export function InventoriesList($scope, $rootScope, $location, $log, }; $scope.addInventory = function () { - $location.path($location.path() + '/add'); + // $location.path($location.path() + '/add'); + $state.go('inventories.add'); }; $scope.editInventory = function (id) { @@ -369,7 +370,7 @@ export function InventoriesList($scope, $rootScope, $location, $log, InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList', 'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', - 'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer' + 'GetBasePath', 'Wait', 'Stream', 'EditInventoryProperties', 'Find', 'Empty', 'LogViewer', '$state' ]; @@ -792,14 +793,14 @@ InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$lo export function InventoriesManage ($log, $scope, $rootScope, $location, - $routeParams, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert, + $state, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert, LoadBreadCrumbs, GetBasePath, ProcessErrors, Breadcrumbs, InventoryGroups, InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary, InventoryGroupsHelp, HelpDialog, ViewJob, - GroupsCopy, HostsCopy, transitionTo) { + GroupsCopy, HostsCopy, $stateParams) { var PreviousSearchParams, url, @@ -1040,7 +1041,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location, }); // Load Inventory - url = GetBasePath('inventory') + $routeParams.inventory_id + '/'; + url = GetBasePath('inventory') + $stateParams.inventory_id + '/'; Rest.setUrl(url); Rest.get() .success(function (data) { @@ -1132,7 +1133,13 @@ export function InventoriesManage ($log, $scope, $rootScope, $location, }; $scope.groupSelect = function(id) { - var group = Find({ list: $scope.groups, key: 'id', val: id }); + var groups = [], group = Find({ list: $scope.groups, key: 'id', val: id }); + if($state.params.groups){ + groups.push($state.params.groups); + } + groups.push(group.id); + groups = groups.join(); + $state.transitionTo('inventoriesManage', {inventory_id: $state.params.inventory_id, groups: groups}, { notify: false }); $scope.group_breadcrumbs.push(group); setActiveGroupBreadcrumb(); loadGroups(group.related.children, group.id); @@ -1401,7 +1408,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location, InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location', - '$routeParams', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait', + '$state', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait', 'Rest', 'Alert', 'LoadBreadCrumbs', 'GetBasePath', 'ProcessErrors', 'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload', 'SearchInit', 'PaginateInit', 'GetSyncStatusMsg', 'GetHostsStatusMsg', @@ -1409,5 +1416,5 @@ InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location', 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete', 'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'GroupsCopy', - 'HostsCopy', 'transitionTo' + 'HostsCopy', '$stateParams' ]; diff --git a/awx/ui/client/src/login/authenticationServices/timer.factory.js b/awx/ui/client/src/login/authenticationServices/timer.factory.js index 7bbc3356c4..dce6520023 100644 --- a/awx/ui/client/src/login/authenticationServices/timer.factory.js +++ b/awx/ui/client/src/login/authenticationServices/timer.factory.js @@ -22,9 +22,9 @@ * @description */ export default - ['$rootScope', '$cookieStore', 'transitionTo', 'CreateDialog', 'Authorization', + ['$rootScope', '$cookieStore', 'CreateDialog', 'Authorization', 'Store', '$interval', '$location', '$q', - function ($rootScope, $cookieStore, transitionTo, CreateDialog, Authorization, + function ($rootScope, $cookieStore, CreateDialog, Authorization, Store, $interval, $location, $q) { return { diff --git a/awx/ui/client/src/login/login.route.js b/awx/ui/client/src/login/login.route.js index cee67eebfe..badd5d90b7 100644 --- a/awx/ui/client/src/login/login.route.js +++ b/awx/ui/client/src/login/login.route.js @@ -16,4 +16,5 @@ export default { } $(".LoginModal-dialog").remove(); }] + }; diff --git a/awx/ui/client/src/login/main.js b/awx/ui/client/src/login/main.js index e4326a7d89..b3ee94f34f 100644 --- a/awx/ui/client/src/login/main.js +++ b/awx/ui/client/src/login/main.js @@ -13,7 +13,7 @@ import logoutRoute from './logout.route'; export default angular.module('login', [authentication.name, loginModal.name]) .config(['$routeProvider', function($routeProvider) { - var url = loginRoute.route; + var url = loginRoute.url; delete loginRoute.route; $routeProvider.when(url, loginRoute); url = logoutRoute.route; diff --git a/awx/ui/client/src/main-menu/main-menu.partial.html b/awx/ui/client/src/main-menu/main-menu.partial.html index 6969e8951d..a5529b507e 100644 --- a/awx/ui/client/src/main-menu/main-menu.partial.html +++ b/awx/ui/client/src/main-menu/main-menu.partial.html @@ -87,7 +87,7 @@ INVENTORIES diff --git a/awx/ui/client/src/partials/inventories.html b/awx/ui/client/src/partials/inventories.html index a3b4306a19..10c2f9a7a3 100644 --- a/awx/ui/client/src/partials/inventories.html +++ b/awx/ui/client/src/partials/inventories.html @@ -1,4 +1,5 @@
+
diff --git a/awx/ui/client/src/partials/inventory-add.html b/awx/ui/client/src/partials/inventory-add.html new file mode 100644 index 0000000000..a0eaa60be7 --- /dev/null +++ b/awx/ui/client/src/partials/inventory-add.html @@ -0,0 +1,14 @@ +
+ +
+
+
+
+ +
diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 53bc6ba1f5..9c042bcc42 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -46,7 +46,8 @@
-
+ +
@@ -171,7 +172,8 @@ save one fact scan (snapshot) per time window (frequency). For example, facts older than 30 days are purged, while one weekly fact scan is kept.
- Caution: Setting both numerical variables to "0" will delete all facts.
+ Caution: Setting both numerical variables to "0" will delete all facts.
+
- + @@ -220,7 +222,7 @@

working...

- +