diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 3d1b74e8b1..845e5ea5c5 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -21,7 +21,7 @@ import './lists'; import './widgets'; import './help'; import './filters'; -import {Home, HomeGroups} from './controllers/Home'; +import {Home} from './controllers/Home'; import {SocketsController} from './controllers/Sockets'; import {CredentialsAdd, CredentialsEdit, CredentialsList} from './controllers/Credentials'; import {JobsListController} from './controllers/Jobs'; @@ -173,7 +173,6 @@ var tower = angular.module('Tower', [ 'InventoryGroupsHelpDefinition', 'CredentialsHelper', 'StreamListDefinition', - 'HomeGroupListDefinition', 'ActivityDetailDefinition', 'VariablesHelper', 'SchedulesListDefinition', @@ -256,16 +255,6 @@ var tower = angular.module('Tower', [ } }). - state('dashboardGroups', { - url: '/home/groups?id&name&has_active_failures&status&source&has_external_source&inventory_source__id', - templateUrl: urlPrefix + 'partials/subhome.html', - controller: HomeGroups, - ncyBreadcrumb: { - parent: 'dashboard', - label: "GROUPS" - } - }). - state('jobs', { url: '/jobs', templateUrl: urlPrefix + 'partials/jobs.html', diff --git a/awx/ui/client/src/controllers/Home.js b/awx/ui/client/src/controllers/Home.js index d7f3847be9..bbaa7d02ad 100644 --- a/awx/ui/client/src/controllers/Home.js +++ b/awx/ui/client/src/controllers/Home.js @@ -140,378 +140,3 @@ export function Home($scope, $compile, $stateParams, $rootScope, $location, $log Home.$inject = ['$scope', '$compile', '$stateParams', '$rootScope', '$location', '$log','Wait', 'ClearScope', 'Rest', 'GetBasePath', 'ProcessErrors', '$window', 'graphData' ]; - - -/** - * @ngdoc method - * @name controllers.function:Home#HomeGroups - * @methodOf controllers.function:Home - * @description This controls the 'home/groups' page that is loaded from the dashboard - * -*/ -export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $location, $stateParams, HomeGroupList, GenerateList, ProcessErrors, ReturnToCaller, ClearScope, - GetBasePath, SearchInit, PaginateInit, FormatDate, GetHostsStatusMsg, GetSyncStatusMsg, ViewUpdateStatus, GroupsEdit, Wait, - Alert, Rest, Empty, InventoryUpdate, Find, GroupsCancelUpdate, Store) { - - ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior - //scope. - var generator = GenerateList, - list = HomeGroupList, - defaultUrl = GetBasePath('groups'), - scope = $scope, - opt, PreviousSearchParams; - - generator.inject(list, { mode: 'edit', scope: scope }); - - function ellipsis(a) { - if (a.length > 20) { - return a.substr(0,20) + '...'; - } - return a; - } - - function attachElem(event, html, title) { - var elem = $(event.target).parent(); - try { - elem.tooltip('hide'); - elem.popover('destroy'); - } - catch(err) { - //ignore - } - $('.popover').each(function() { - // remove lingering popover
| Status | "; - html += "Finished | "; - html += "Name | "; - html += "
|---|---|---|
| \n"; - html += " | " + ($filter('longDate')(row.finished)).replace(/ /,' ') + " | ";
- html += "" + ellipsis(row.name) + " | "; - html += "
No recent job data available for this inventory.
\n"; - } - attachElem(event, html, title); - }); - - scope.showHostSummary = function(event, id) { - var url, jobs = []; - if (!Empty(id)) { - Wait('start'); - url = GetBasePath('hosts') + "?groups__id=" + id + "&last_job__isnull=false&order_by=-last_job&page_size=5"; - Rest.setUrl(url); - Rest.get() - .success( function(data) { - data.results.forEach(function(host) { - var found = false; - jobs.every(function(existing_job) { - if (host.last_job === existing_job.id) { - found = true; - return false; - } - return true; - }); - if (!found) { - jobs.push({ - id: host.last_job, - status: host.summary_fields.last_job.status, - name: host.summary_fields.last_job.name, - finished: host.summary_fields.last_job.finished - }); - } - }); - scope.$emit('HostSummaryReady', event, jobs); - }) - .error( function(data, status) { - ProcessErrors( scope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + ' failed. GET returned: ' + status - }); - }); - } - }; - - scope.cancelUpdate = function(id) { - var group = Find({ list: scope.home_groups, key: 'id', val: id }); - GroupsCancelUpdate({ scope: scope, group: group }); - }; - - -} - -HomeGroups.$inject = ['$rootScope', '$log', '$scope', '$filter', '$compile', '$location', '$stateParams', 'HomeGroupList', 'generateList', 'ProcessErrors', 'ReturnToCaller', - 'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'GetHostsStatusMsg', 'GetSyncStatusMsg', 'ViewUpdateStatus', - 'GroupsEdit', 'Wait', 'Alert', 'Rest', 'Empty', 'InventoryUpdate', 'Find', 'GroupsCancelUpdate', 'Store', 'Socket' -]; - -/** - * @ngdoc method - * @name controllers.function:Home#HomeHosts - * @methodOf controllers.function:Home - * @description This loads the page for 'home/hosts' - * -*/ diff --git a/awx/ui/client/src/lists.js b/awx/ui/client/src/lists.js index f36cd3f687..545c3189fb 100644 --- a/awx/ui/client/src/lists.js +++ b/awx/ui/client/src/lists.js @@ -9,7 +9,6 @@ import CompletedJobs from "./lists/CompletedJobs"; import AllJobs from "./lists/AllJobs"; import Credentials from "./lists/Credentials"; import Groups from "./lists/Groups"; -import HomeGroups from "./lists/HomeGroups"; import Hosts from "./lists/Hosts"; import Inventories from "./lists/Inventories"; import InventoryGroups from "./lists/InventoryGroups"; @@ -35,7 +34,6 @@ export AllJobs, Credentials, Groups, - HomeGroups, Hosts, Inventories, InventoryGroups, diff --git a/awx/ui/client/src/lists/HomeGroups.js b/awx/ui/client/src/lists/HomeGroups.js deleted file mode 100644 index ad7180dff0..0000000000 --- a/awx/ui/client/src/lists/HomeGroups.js +++ /dev/null @@ -1,170 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - - -export default - angular.module('HomeGroupListDefinition', []) - .value('HomeGroupList', { - - name: 'home_groups', - iterator: 'group', - editTitle: 'Groups', - index: false, - hover: true, - well: true, - - fields: { - status: { - label: '', - columnClass: 'List-staticColumn--mediumStatus', - searchable: false, - nosort: true, - ngClick: "null", - iconOnly: true, - icons: [{ - icon: "{{ 'icon-cloud-' + group.status_class }}", - awToolTip: "{{ group.status_tooltip }}", - dataTipWatch: "group.launch_tooltip", - awTipPlacement: "right", - ngClick: "viewUpdateStatus(group.id)", - ngClass: "group.launch_class" - },{ - icon: "{{ 'icon-job-' + group.hosts_status_class }}", - awToolTip: "{{ group.hosts_status_tip }}", - awTipPlacement: "right", - ngClick: "showHostSummary($event, group.id)", - ngClass: "" - }] - }, - name: { - key: true, - label: 'Group', - ngClick: "editGroup(group.id, group.inventory)", - columnClass: 'col-lg-6 col-md-5 col-sm-5 col-xs-8 ellipsis List-staticColumnAdjacent' - }, - inventory_name: { - label: 'Inventory', - sourceModel: 'inventory', - sourceField: 'name', - columnClass: 'col-lg-4 col-md-5 col-sm-3 hidden-xs elllipsis', - linkTo: "{{ '/#/inventories/' + group.inventory + '/' }}" - }, - source: { - label: 'Source', - searchType: 'select', - searchOptions: [{ - name: "Amazon Web Services", - value: "ec2" - }, { - name: "none", - value: "" - }, { - name: "Rackspace", - value: "rax" - },{ - name: "VMware", - value: "vmware" - },{ - name: "Google Compute Engine", - value: "gce" - },{ - name: "Microsoft Azure", - value: "azure" - },{ - name: "OpenStack", - value: "openstack" - }], - sourceModel: 'inventory_source', - sourceField: 'source', - searchOnly: true - }, - has_external_source: { - label: 'Has external source?', - searchType: 'in', - searchValue: 'ec2,rax,vmware,azure,gce,openstack', - searchOnly: true, - sourceModel: 'inventory_source', - sourceField: 'source' - }, - has_active_failures: { - label: 'Has failed hosts?', - searchSingleValue: true, - searchType: 'boolean', - searchValue: 'true', - searchOnly: true - }, - last_update_failed: { - label: 'Update failed?', - searchType: 'select', - searchSingleValue: true, - searchValue: 'failed', - searchOnly: true, - sourceModel: 'inventory_source', - sourceField: 'status' - }, - id: { - label: 'ID', - searchOnly: true - }, - inventory_source: { - label: 'Source ID', - searchType: 'int', - searchOnly: true - } - }, - - fieldActions: { - - columnClass: 'col-lg-2 col-md-2 col-sm-4 col-xs-4', - - /* - sync_status: { - mode: 'all', - ngClick: "viewUpdateStatus(group.id, group.group_id)", - awToolTip: "{{ group.status_tooltip }}", - ngClass: "group.status_class", - dataPlacement: "top" - }, - failed_hosts: { - mode: 'all', - awToolTip: "{{ group.hosts_status_tip }}", - dataPlacement: "top", - ngHref: "/#/inventories/{{ group.inventory }}/", - iconClass: "{{ 'fa icon-failures-' + group.hosts_status_class }}" - }, - */ - group_update: { - //label: 'Sync', - mode: 'all', - ngClick: 'updateGroup(group.id)', - awToolTip: "{{ group.launch_tooltip }}", - ngShow: "(group.status !== 'running' && group.status !== 'pending' && group.status !== 'updating')", - ngClass: "group.launch_class", - dataPlacement: "top" - }, - cancel: { - //label: 'Cancel', - mode: 'all', - ngClick: "cancelUpdate(group.id)", - awToolTip: "Cancel sync process", - 'class': 'red-txt', - ngShow: "(group.status == 'running' || group.status == 'pending' || group.status == 'updating')", - dataPlacement: "top" - }, - edit: { - label: 'Edit', - mode: 'all', - ngClick: "editGroup(group.id, group.inventory)", - awToolTip: 'Edit group', - dataPlacement: "top" - } - }, - - actions: { - - } - - }); diff --git a/awx/ui/client/src/widgets/Stream.js b/awx/ui/client/src/widgets/Stream.js index 021db4df98..3e3eed8842 100644 --- a/awx/ui/client/src/widgets/Stream.js +++ b/awx/ui/client/src/widgets/Stream.js @@ -47,10 +47,12 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti .factory('BuildUrl', [ function () { - return function (obj) { + return function (obj, inventory) { var url = '/#/'; switch (obj.base) { case 'group': + url += 'inventories/' + inventory.id + '/manage?group=' + obj.id; + break; case 'host': url += 'home/' + obj.base + 's/?id=' + obj.id; break; @@ -175,7 +177,7 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti // user to a unknown location. obj1_obj.name = $filter('sanitize')(obj1_obj.name); obj1_obj.name = $sce.getTrustedHtml(obj1_obj.name); - descr += obj1 + " " + obj1_obj.name + ''; + descr += obj1 + " " + obj1_obj.name + ''; descr_nolink += obj1 + ' ' + obj1_obj.name; } else if (obj1) { name = '';