From cde035f06d517ac89c708f8d03368ac754279cea Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Mon, 2 Sep 2013 01:29:51 -0400 Subject: [PATCH] AC-378 applied new sort routine to inventory groups page. --- awx/ui/static/js/forms/InventoryHosts.js | 2 + awx/ui/static/js/forms/Jobs.js | 8 ++-- awx/ui/static/js/helpers/Hosts.js | 55 +++++++++++++++++------- awx/ui/static/js/lists/JobEvents.js | 2 +- awx/ui/static/js/lists/Jobs.js | 2 +- 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index 50c05907c3..29c85b0be9 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -39,6 +39,8 @@ angular.module('InventoryHostsFormDefinition', []) "class": "btn-sm", //ngDisabled: 'host.last_job == null', options: [ + { ngClick: 'allJobs()', label: 'All jobs', ngShow: 'host.last_job' }, + { ngClick: 'allSummaries()', label: 'All host summaries', ngShow: 'host.last_job' }, { ngClick: 'viewJobs(\{\{ host.last_job \}\})', label: 'Latest job', ngShow: 'host.last_job' }, { ngClick: "viewLastEvents(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " + "'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest job events', ngShow: 'host.last_job' }, diff --git a/awx/ui/static/js/forms/Jobs.js b/awx/ui/static/js/forms/Jobs.js index d96d373a6e..62fada96d2 100644 --- a/awx/ui/static/js/forms/Jobs.js +++ b/awx/ui/static/js/forms/Jobs.js @@ -281,15 +281,15 @@ angular.module('JobFormDefinition', []) label: 'Refresh', icon: 'icon-refresh', ngClick: "refresh()", - "class": 'btn-small btn-success', + "class": 'btn-sm btn-success', awToolTip: 'Refresh job status & output', mode: 'all' }, summary: { label: 'Hosts', - icon: 'icon-th-large', + icon: 'icon-laptop', ngClick: "jobSummary()", - "class": 'btn btn-default btn-small', + "class": 'btn btn-default btn-sm', awToolTip: 'View host summary', mode: 'all' }, @@ -297,7 +297,7 @@ angular.module('JobFormDefinition', []) label: 'Events', icon: 'icon-list-ul', ngClick: "jobEvents()", - "class": 'btn btn-default btn-small', + "class": 'btn btn-default btn-sm', awToolTip: 'Edit job events', mode: 'all' } diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index ec6649e623..8349b4a88b 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -468,20 +468,39 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H var inventory_id = params.inventory_id; var html = ''; + function sortNodes(data) { + //Sort nodes by name + var names = []; + var newData = []; + for (var i=0; i < data.length; i++) { + names.push(data[i].name); + } + names.sort(); + for (var j=0; j < names.length; j++) { + for (i=0; i < data.length; i++) { + if (data[i].name == names[j]) { + newData.push(data[i]); + } + } + } + return newData; + } + function buildHTML(tree_data) { - html += (tree_data.length > 0) ? "