diff --git a/awx/ui/static/js/forms/Inventories.js b/awx/ui/static/js/forms/Inventories.js index 1ffa95cb65..cbb0bcfe91 100644 --- a/awx/ui/static/js/forms/Inventories.js +++ b/awx/ui/static/js/forms/Inventories.js @@ -104,6 +104,7 @@ angular.module('InventoryFormDefinition', []) type: 'treeview', title: "groupTitle", iterator: 'host', + actions: { }, @@ -111,50 +112,19 @@ angular.module('InventoryFormDefinition', []) name: { key: true, label: 'Host Name', - ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')" + ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')", + badgeShow: "\{\{ host.has_active_failures \}\}", + badgeIcon: 'icon-exclamation-sign', + badgeToolTip: 'Most recent job failed', + badgePlacement: 'bottom' }, description: { label: 'Description', ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')" - }, - has_active_failures: { - label: 'Failed jobs?', - showValue: false, - ngClick: "showEvents('\{\{ host.name \}\}', '\{\{ host.related.last_job \}\}')", - ngShow: "\{\{ host.has_active_failures \}\}", - icon: 'icon-exclamation-sign', - "class": 'active-failures-\{\{ host.has_active_failures \}\}', - text: 'View failures', - searchField: 'has_active_failures', - searchType: 'boolean', - searchOptions: [{ name: "No", value: 0 }, { name: "Yes", value: 1 }] } }, - fieldActions: { - edit: { - ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')", - icon: 'icon-edit', - label: 'Edit', - awToolTip: 'Edit host', - 'class': 'btn-default' - }, - "remove": { - ngClick: "removeHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')", - icon: 'icon-minus-sign', - label: 'Remove', - "class": 'btn-success', - ngHide: "group_id === null || group_id === undefined", - awToolTip: 'Remove this host from the group, but leave it as part of the inventory under All Hosts' - }, - "delete": { - ngClick: "deleteHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')", - icon: 'icon-trash', - label: 'Delete', - "class": 'btn-danger', - awToolTip: 'Permanently remove this host from the inventory' - } - } + } } } diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index d690421115..b2fd2b4b90 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -448,7 +448,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H var relatedSets = { hosts: { url: url, iterator: 'host' } }; RelatedSearchInit({ scope: params.scope, form: InventoryForm, relatedSets: relatedSets }); - RelatedPaginateInit({ scope: params.scope, relatedSets: relatedSets }); + RelatedPaginateInit({ scope: params.scope, relatedSets: relatedSets, pageSize: 40 }); if (scope['hostFailureFilter']) { // If the user checked 'show only hosts with failures', filter for hosts with failed jobs diff --git a/awx/ui/static/js/helpers/inventory.js b/awx/ui/static/js/helpers/inventory.js index 14c60fe97d..29ca4fafef 100644 --- a/awx/ui/static/js/helpers/inventory.js +++ b/awx/ui/static/js/helpers/inventory.js @@ -42,9 +42,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi Rest.get() .success( function(data, status, headers, config) { for (var i=0; i < data.results.length; i++) { - title = data.results[i].name; - title += (data.results[i].has_active_failures) ? ' ' + - '' : ''; + title = data.results[i].name; treeData[0].children.push({ data: { title: title @@ -147,9 +145,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi var title; var filter = (scope.inventoryFailureFilter) ? "has_active_failures=true&" : ""; for (var i=0; i < data.results.length; i++) { - title = data.results[i].name; - title += (data.results[i].has_active_failures) ? ' ' + - '' : ''; + title = data.results[i].name; response.push({ data: { title: title diff --git a/awx/ui/static/js/helpers/related-paginate.js b/awx/ui/static/js/helpers/related-paginate.js index a067aa134d..c72f4bd673 100644 --- a/awx/ui/static/js/helpers/related-paginate.js +++ b/awx/ui/static/js/helpers/related-paginate.js @@ -20,6 +20,7 @@ angular.module('RelatedPaginateHelper', ['RefreshRelatedHelper', 'ngCookies']) var scope = params.scope; var relatedSets = params.relatedSets; + var pageSize = (params.pageSize) ? params.pageSize : 10; for (var key in relatedSets){ cookieSize = $cookieStore.get(relatedSets[key].iterator + 'PageSize'); @@ -29,7 +30,7 @@ angular.module('RelatedPaginateHelper', ['RefreshRelatedHelper', 'ngCookies']) } else { scope[relatedSets[key].iterator + 'Page'] = 0; - scope[relatedSets[key].iterator + 'PageSize'] = 10; + scope[relatedSets[key].iterator + 'PageSize'] = pageSize; } } diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index e13c02b517..8d57bb83fe 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -176,6 +176,8 @@ a:hover { text-decoration: none; } + + .site-footer { width: 100%; padding-top: 20px; @@ -184,6 +186,33 @@ a:hover { color: @grey; text-align: center; background-color: @black; + + .inner-container { + max-width: 1170px; + margin: 0 auto; + padding: 0 10px; + } + + a, + a:active, + a:hover, + a:visited { + margin-right: 15px; + font-size: 18px; + color: @grey; + } + + .social { + display: inline-block; + } + + .logo { + display: inline-block; + } + + .logo img { + max-width: 125px; + } } .copyright { @@ -193,28 +222,9 @@ a:hover { text-align: center; } -.site-footer a, -.site-footer a:active, -.site-footer a:hover, -.site-footer a:visited { - margin-right: 15px; - font-size: 18px; - color: @grey; -} -.site-footer .social { - display: inline-block; - margin-left: 50px; -} -.site-footer .logo { - display: inline-block; - margin-right: 35px; -} -.site-footer .logo img { - max-width: 125px; -} .login-header { text-align: center; @@ -602,7 +612,7 @@ input[type="text"].job-successful { } - .tree-badge { + .host-badge { color: @red; font-size: 12px; } diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 0c9ac0c834..4b62fd4d28 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -477,7 +477,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos /* For reasons unknown calling Rest fails. It just dies with no errors or any info */ $.ajax({ - url: url, + url: url + '?order_by=name', headers: { 'Authorization': 'Token ' + token }, dataType: 'json', success: function(data) { @@ -494,11 +494,17 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos html += "data-name=\"" + data.results[i].name + "\" "; html += "data-group-id=\"" + data.results[i].id + "\">"; html += " "; - html += "" + data.results[i].name + "\n"; + html += "" + data.results[i].name + " "; + html += "" + + "\n"; } html = (html !== '') ? "
| # | \n"; + //html += "# | \n"; html += "\n"; - for (var fld in form.related[itm].fields) { html += " | " + @@ -1018,12 +1017,12 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += " | |
|---|---|---|---|---|
| {{ $index + (" + form.related[itm].iterator + "Page * " + - form.related[itm].iterator + "PageSize) + 1 }}. | \n"; + //html += "{{ $index + (" + form.related[itm].iterator + "Page * " + + // form.related[itm].iterator + "PageSize) + 1 }}. | \n"; // Select checkbox html += ""; - + var cnt = 1; var rfield; var base = (form.related[itm].base) ? form.related[itm].base : itm; @@ -1035,6 +1034,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) } // Row level actions + + /* html += " | "; for (action in form.related[itm].fieldActions) { html += " | "; + */ + + html += "";
+ html += " \n";
+ html += "\n";
+ html += "\n";
+ html += " \n";
+ html += " | \n";
+
html += "\n" : ""; + + // Badge + if (field.badgeIcon) { + if (field.badgeToolTip) { + html += ""; + html += " \n"; + } + else { + html += " \n"; + } + } return html += " | \n"; diff --git a/awx/ui/static/lib/ansible/list-generator.js b/awx/ui/static/lib/ansible/list-generator.js index bae6ea027b..f48867f26e 100644 --- a/awx/ui/static/lib/ansible/list-generator.js +++ b/awx/ui/static/lib/ansible/list-generator.js @@ -85,18 +85,18 @@ angular.module('ListGenerator', ['GeneratorHelpers']) this.scope[list.name] = null; this.scope[list.iterator] = null; - // Remove any lingering tooltip