AC-931: Fixed typo. AC-925 clickin on failed inventory sync icon works again. Inventory Refactor: consolidated actions and status fields to a single column and simplified tool-tip text. Made 'sync' labeling more consistent, I think.

This commit is contained in:
chris Houseknecht
2014-01-15 04:31:11 -05:00
parent 298e55017f
commit ef324f2397
17 changed files with 75 additions and 78 deletions

View File

@@ -108,7 +108,7 @@ function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, Proce
var base = $location.path().replace(/^\//,'').split('/')[0]; var base = $location.path().replace(/^\//,'').split('/')[0];
if (scope.removePostRefresh) { if (scope.removePostRefresh) {
scope.removePostRefresh(); scope.removePostRefresh();
} }
scope.removePostRefresh = scope.$on('PostRefresh', function() { scope.removePostRefresh = scope.$on('PostRefresh', function() {
var msg, update_status, last_update; var msg, update_status, last_update;

View File

@@ -76,34 +76,25 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
for (var i=0; i < scope.inventories.length; i++) { for (var i=0; i < scope.inventories.length; i++) {
// Set values for Failed Hosts column // Set values for Failed Hosts column
scope.inventories[i].failed_hosts = scope.inventories[i].hosts_with_active_failures + ' / ' + scope.inventories[i].total_hosts; //scope.inventories[i].failed_hosts = scope.inventories[i].hosts_with_active_failures + ' / ' + scope.inventories[i].total_hosts;
if (scope.inventories[i].hosts_with_active_failures > 0) { if (scope.inventories[i].hosts_with_active_failures > 0) {
scope.inventories[i].failed_hosts_tip = "Contains " + scope.inventories[i].hosts_with_active_failures + scope.inventories[i].failed_hosts_tip = scope.inventories[i].hosts_with_active_failures +
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ] + ' with job failures. Click to view the offending ' + ( (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ) + ' with job failures. Click to view details.';
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ] + '.'; scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts?has_active_failures=true';
scope.inventories[i].failed_hosts_class = 'true'; scope.inventories[i].failed_hosts_class = 'true';
} }
else { else {
if (scope.inventories[i].total_hosts == 0) { if (scope.inventories[i].total_hosts == 0) {
// no hosts // no hosts
scope.inventories[i].failed_hosts_tip = "There are no hosts in this inventory. It's a sad empty shell. Click to view the hosts page " + scope.inventories[i].failed_hosts_tip = "No hosts defined. Click to add.";
"and add a host."; scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
scope.inventories[i].failed_hosts_class = 'na'; scope.inventories[i].failed_hosts_class = 'na';
} }
else if (scope.inventories[i].total_hosts == 1) {
// on host with 0 failures
scope.inventories[i].failed_hosts_tip = "The 1 host found in this inventory is happy! There are no job failures." +
" Click to view the host.";
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
scope.inventories[i].failed_hosts_class = 'false';
}
else { else {
// many hosts with 0 failures // many hosts with 0 failures
scope.inventories[i].failed_hosts_tip = "All " + scope.inventories[i].total_hosts + " hosts are happy! There are no" + scope.inventories[i].failed_hosts_tip = "No job failures. Click to view details.";
" job failures. Click to view the hosts."; scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
scope.inventories[i].failed_hosts_class = 'false'; scope.inventories[i].failed_hosts_class = 'false';
} }
} }
@@ -111,33 +102,25 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
// Set values for Status column // Set values for Status column
scope.inventories[i].status = scope.inventories[i].inventory_sources_with_failures + ' / ' + scope.inventories[i].total_inventory_sources; scope.inventories[i].status = scope.inventories[i].inventory_sources_with_failures + ' / ' + scope.inventories[i].total_inventory_sources;
if (scope.inventories[i].inventory_sources_with_failures > 0) { if (scope.inventories[i].inventory_sources_with_failures > 0) {
scope.inventories[i].status_tip = "Contains " + scope.inventories[i].inventory_sources_with_failures + scope.inventories[i].status_tip = scope.inventories[i].inventory_sources_with_failures + ' cloud ' +
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' group' : ' groups' ] + ' with inventory update failures. ' + ( (scope.inventories[i].inventory_sources_with_failures == 1) ? 'source' : 'sources' ) +
'Click to view the ' + ' with failures. Click to view details.';
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' offending group.' : ' groups.' ]; scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?status=failed';
scope.inventories[i].status_class = 'failed'; scope.inventories[i].status_class = 'failed';
} }
else { else {
if (scope.inventories[i].total_inventory_sources == 0) { if (scope.inventories[i].total_inventory_sources == 0) {
// no groups are reporting a source // no groups are reporting a source
scope.inventories[i].status_tip = "Does not have an external inventory source. Click to view groups and " + scope.inventories[i].status_tip = "Not synced with a cloud source. Click to edit.";
"and add an inventory source."; scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups';
scope.inventories[i].status_class = 'na'; scope.inventories[i].status_class = 'na';
} }
else if (scope.inventories[i].total_inventory_sources == 1) {
// on host with 0 failures
scope.inventories[i].status_tip = "The 1 group with an inventory source is happy!. No updates have failed." +
" Click to view the group.";
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?has_external_source=true';
scope.inventories[i].status_class = 'successful';
}
else { else {
// many hosts with 0 failures // many hosts with 0 failures
scope.inventories[i].status_tip = scope.inventories[i].total_inventory_sources + " groups external inventory sources are happy! " + scope.inventories[i].status_tip = 'Contains ' + scope.inventories[i].total_inventory_sources +
" No updates have failed. Click to view the groups."; ' cloud ' + ( (scope.inventories[i].total_inventory_sources > 0) ? 'sources' : 'source' ) +
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?has_external_source=true'; ' and no failures. Click to view details.';
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/';
scope.inventories[i].status_class = 'successful'; scope.inventories[i].status_class = 'successful';
} }
} }

View File

@@ -91,7 +91,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
var tree_id = params.tree_id; var tree_id = params.tree_id;
var group_id = params.group_id; var group_id = params.group_id;
var found = false; var found = false;
var group = Find({ list: scope.group, key: 'id', val: tree_id }); var group = Find({ list: scope.groups, key: 'id', val: tree_id });
scope.showHosts(tree_id, group_id, false); scope.showHosts(tree_id, group_id, false);
@@ -274,8 +274,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
Rest.post() Rest.post()
.success( function(data, status, headers, config) { .success( function(data, status, headers, config) {
Wait('stop'); Wait('stop');
Alert('Inventory Sync Cancelled', 'Your request to cancel the update was submitted to the task maanger. ' + Alert('Inventory Sync Cancelled', 'Your request to cancel the sync process was submitted to the task manger. ' +
'Click the <i class="fa fa-refresh fa-lg"></i> to check the sync status.', 'alert-info'); 'Click the <i class="fa fa-refresh fa-lg"></i> button to monitor the status.', 'alert-info');
}) })
.error( function(data, status, headers, config) { .error( function(data, status, headers, config) {
Wait('stop'); Wait('stop');
@@ -299,8 +299,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
} }
else { else {
Wait('stop'); Wait('stop');
Alert('Cancel Inventory Sync', 'Either you do not have access or the sync process completed. ' + Alert('Cancel Inventory Sync', 'Either you do not have access or the sync process completed.<br /> ' +
'Click the <i class="fa fa-refresh fa-lg"></i> to view the latest status.', 'alert-info'); 'Click the <i class="fa fa-refresh fa-lg"></i> button to view the latest status.', 'alert-info');
} }
}) })
.error( function(data, status, headers, config) { .error( function(data, status, headers, config) {
@@ -1080,8 +1080,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
if (last_update == undefined || last_update == null || last_update == ''){ if (last_update == undefined || last_update == null || last_update == ''){
Wait('stop'); Wait('stop');
Alert('Missing Configuration', 'The selected group is not configured for inventory updates. ' + Alert('Missing Configuration', 'The selected group is not configured for inventory sync. ' +
'You must first edit the group, provide Source settings, and then run an update.', 'alert-info'); 'Edit the group and provide Source information.', 'alert-info');
} }
else { else {
// Retrieve detail record and prepopulate the form // Retrieve detail record and prepopulate the form
@@ -1110,12 +1110,12 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
scope.formModalActionLabel = 'OK'; scope.formModalActionLabel = 'OK';
scope.formModalCancelShow = false; scope.formModalCancelShow = false;
scope.formModalInfo = false; scope.formModalInfo = false;
scope.formModalHeader = group_name + '<span class="subtitle"> - Inventory Update</span>'; scope.formModalHeader = group_name + '<span class="subtitle"> - Inventory Sync</span>';
$('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none');
$('#form-modal').addClass('skinny-modal');
if (!scope.$$phase) { if (!scope.$$phase) {
scope.$digest(); scope.$digest();
} }
}) })
.error( function(data, status, headers, config) { .error( function(data, status, headers, config) {
Wait('stop'); Wait('stop');

View File

@@ -421,7 +421,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
} }
scope.removeHostReloadComplete = scope.$on('HostReloadComplete', function(e) { scope.removeHostReloadComplete = scope.$on('HostReloadComplete', function(e) {
Wait('stop'); Wait('stop');
Alert('Update Started', 'The request to start the inventory update process was submitted. Monitor progress of the update process ' + Alert('Update Started', 'Your request to start the inventory sync process was submitted. Monitor progress ' +
'by clicking the <i class="fa fa-refresh fa-lg"></i> button.', 'alert-info'); 'by clicking the <i class="fa fa-refresh fa-lg"></i> button.', 'alert-info');
scope.removeHostReloadComplete(); scope.removeHostReloadComplete();
}); });

View File

@@ -59,7 +59,7 @@ angular.module('CloudCredentialsListDefinition', [])
icon: 'fa-edit', icon: 'fa-edit',
label: 'Edit', label: 'Edit',
"class": 'btn-sm', "class": 'btn-sm',
awToolTip: 'View/Edit credential', awToolTip: 'Edit credential',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -73,7 +73,7 @@ angular.module('CredentialsListDefinition', [])
icon: 'fa-edit', icon: 'fa-edit',
label: 'Edit', label: 'Edit',
"class": 'btn-sm', "class": 'btn-sm',
awToolTip: 'View/Edit credential', awToolTip: 'Edit credential',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -44,7 +44,7 @@ angular.module('GroupListDefinition', [])
ngClick: "editGroup(\{\{ group.id \}\})", ngClick: "editGroup(\{\{ group.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs', "class": 'btn-xs',
awToolTip: 'View/Edit group', awToolTip: 'Edit group',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -44,7 +44,7 @@ angular.module('HostListDefinition', [])
ngClick: "editHost(\{\{ host.id \}\})", ngClick: "editHost(\{\{ host.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs', "class": 'btn-xs',
awToolTip: 'View/Edit host', awToolTip: 'Edit host',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -31,8 +31,8 @@ angular.module('InventoriesListDefinition', [])
sourceField: 'name', sourceField: 'name',
excludeModal: true excludeModal: true
}, },
failed_hosts: { /*failed_hosts: {
label: 'Failed Hosts', label: 'Failures',
ngHref: "\{\{ inventory.failed_hosts_link \}\}", ngHref: "\{\{ inventory.failed_hosts_link \}\}",
badgeIcon: "\{\{ 'fa icon-failures-' + inventory.failed_hosts_class \}\}", badgeIcon: "\{\{ 'fa icon-failures-' + inventory.failed_hosts_class \}\}",
badgeNgHref: "\{\{ inventory.failed_hosts_link \}\}", badgeNgHref: "\{\{ inventory.failed_hosts_link \}\}",
@@ -48,7 +48,7 @@ angular.module('InventoriesListDefinition', [])
status: { status: {
label: 'Status', label: 'Status',
ngHref: "\{\{ inventory.status_link \}\}", ngHref: "\{\{ inventory.status_link \}\}",
badgeIcon: "\{\{ 'fa icon-cloud-' + inventory.status_class \}\}", badgeIcon: "\{\{ 'fa fa-cloud icon-cloud-' + inventory.status_class \}\}",
badgeNgHref: "\{\{ inventory.status_link \}\}", badgeNgHref: "\{\{ inventory.status_link \}\}",
badgePlacement: 'left', badgePlacement: 'left',
badgeTipPlacement: 'top', badgeTipPlacement: 'top',
@@ -58,24 +58,25 @@ angular.module('InventoriesListDefinition', [])
searchable: false, searchable: false,
excludeModal: true, excludeModal: true,
sortField: "inventory_sources_with_failures" sortField: "inventory_sources_with_failures"
}, },*/
has_inventory_sources: { has_inventory_sources: {
label: 'Has external sources?', label: 'Cloud sourced',
searchSingleValue: true, searchSingleValue: true,
searchType: 'boolean', searchType: 'boolean',
searchValue: 'true', searchValue: 'true',
searchOnly: true searchOnly: true
}, },
has_active_failures: { has_active_failures: {
label: 'Has failed hosts?', label: 'Failed hosts',
searchSingleValue: true, searchSingleValue: true,
searchType: 'boolean', searchType: 'boolean',
searchValue: 'true', searchValue: 'true',
searchOnly: true searchOnly: true
}, },
inventory_sources_with_failures: { inventory_sources_with_failures: {
label: 'Has inventory update failures?', label: 'Sync failures',
searchType: 'gtzero', searchType: 'gtzero',
searchValue: 'true',
searchOnly: true searchOnly: true
} }
}, },
@@ -96,22 +97,33 @@ angular.module('InventoriesListDefinition', [])
}, },
fieldActions: { fieldActions: {
status: {
//label: 'Status',
ngHref: "\{\{ inventory.status_link \}\}",
iconClass: "\{\{ 'fa fa-cloud icon-cloud-' + inventory.status_class \}\}",
awToolTip: "\{\{ inventory.status_tip \}\}",
dataPlacement: "top"
},
failed_hosts: {
//label: 'Failures',
ngHref: "\{\{ inventory.failed_hosts_link \}\}",
iconClass: "\{\{ 'fa icon-failures-' + inventory.failed_hosts_class \}\}",
awToolTip: "\{\{ inventory.failed_hosts_tip \}\}",
dataPlacement: "top",
},
edit: { edit: {
label: 'Edit', label: 'Edit',
ngClick: "editInventory(\{\{ inventory.id \}\})", ngClick: "editInventory(\{\{ inventory.id \}\})",
icon: 'icon-edit',
"class": 'btn-xs btn-default',
awToolTip: 'Edit inventory', awToolTip: 'Edit inventory',
dataPlacement: 'top' dataPlacement: 'top'
}, },
"delete": { "delete": {
label: 'Delete', label: 'Delete',
ngClick: "deleteInventory(\{\{ inventory.id \}\},'\{\{ inventory.name \}\}')", ngClick: "deleteInventory(\{\{ inventory.id \}\},'\{\{ inventory.name \}\}')",
icon: 'icon-trash',
"class": 'btn-xs btn-danger',
awToolTip: 'Delete inventory', awToolTip: 'Delete inventory',
dataPlacement: 'top' dataPlacement: 'top'
}, }
/*,
dropdown: { dropdown: {
type: 'DropDown', type: 'DropDown',
label: 'Jobs', label: 'Jobs',
@@ -122,5 +134,6 @@ angular.module('InventoriesListDefinition', [])
{ ngClick: "viewFailedJobs(\{\{ inventory.id \}\})", label: 'Failed' } { ngClick: "viewFailedJobs(\{\{ inventory.id \}\})", label: 'Failed' }
] ]
} }
*/
} }
}); });

View File

@@ -47,7 +47,7 @@ angular.module('OrganizationListDefinition', [])
ngClick: "editOrganization(\{\{ organization.id \}\})", ngClick: "editOrganization(\{\{ organization.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs btn-default', "class": 'btn-xs btn-default',
awToolTip: 'View/Edit organization', awToolTip: 'Edit organization',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -62,7 +62,7 @@ angular.module('PermissionListDefinition', [])
ngClick: "editPermission(\{\{ permission.id \}\})", ngClick: "editPermission(\{\{ permission.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs btn-default', "class": 'btn-xs btn-default',
awToolTip: 'View/Edit permission', awToolTip: 'Edit permission',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -95,7 +95,7 @@ angular.module('ProjectsListDefinition', [])
ngClick: "editProject(\{\{ project.id \}\})", ngClick: "editProject(\{\{ project.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs btn-default', "class": 'btn-xs btn-default',
awToolTip: 'View/edit project properties', awToolTip: 'Edit project properties',
dataPlacement: 'top' dataPlacement: 'top'
}, },
scm_update: { scm_update: {

View File

@@ -54,7 +54,7 @@ angular.module('TeamsListDefinition', [])
ngClick: "editTeam(\{\{ team.id \}\})", ngClick: "editTeam(\{\{ team.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs btn-default', "class": 'btn-xs btn-default',
awToolTip: 'View/Edit team', awToolTip: 'Edit team',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -56,7 +56,7 @@ angular.module('UserListDefinition', [])
ngClick: "editUser(\{\{ user.id \}\})", ngClick: "editUser(\{\{ user.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
"class": 'btn-xs btn-default', "class": 'btn-xs btn-default',
awToolTip: 'View/Edit user', awToolTip: 'Edit user',
dataPlacement: 'top' dataPlacement: 'top'
}, },

View File

@@ -106,11 +106,11 @@ a:focus {
.actions { .actions {
a { a {
font-size: 14px; font-size: 14px;
margin-left: 15px; margin-right: 15px;
} }
a:first-child { /*a:first-child {
margin-left: 0; margin-left: 0;
} }*/
a:hover { a:hover {
cursor: pointer; cursor: pointer;
} }
@@ -843,12 +843,12 @@ input[type="checkbox"].checkbox-no-label {
content: "\f111"; content: "\f111";
} }
.icon-failures-none, /*.icon-failures-none,
.icon-failures-na, .icon-failures-na,
.icon-failures-true, .icon-failures-true,
.icon-failures-false { .icon-failures-false {
font-size: 12px; font-size: 12px;
} }*/
.badge { .badge {
padding: 2px 3px 3px 4px; padding: 2px 3px 3px 4px;

View File

@@ -190,8 +190,8 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P
// Start our tree object with All Hosts // Start our tree object with All Hosts
var children = []; var children = [];
var sorted = SortNodes(tree_data); var sorted = SortNodes(tree_data);
for (var j=0; j < sorted[j].length; i++) { for (var j=0; j < sorted.length; j++) {
push(sorted[j].id); children.push(sorted[j].id);
} }
var all_hosts = { var all_hosts = {
name: 'All Hosts', id: 1, group_id: null, parent: 0, description: '', show: true, ngicon: null, name: 'All Hosts', id: 1, group_id: null, parent: 0, description: '', show: true, ngicon: null,

View File

@@ -346,6 +346,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
var fAction = list.fieldActions[action]; var fAction = list.fieldActions[action];
html += "<a "; html += "<a ";
html += (fAction.href) ? "href=\"" + fAction.href + "\" " : ""; html += (fAction.href) ? "href=\"" + fAction.href + "\" " : "";
html += (fAction.ngHref) ? "ng-href=\"" + fAction.ngHref + "\" " : "";
html += (action == 'cancel') ? " class=\"red-txt\" " : ""; html += (action == 'cancel') ? " class=\"red-txt\" " : "";
for (itm in fAction) { for (itm in fAction) {
if (itm != 'href' && itm != 'label' && itm != 'icon' && itm != 'class' && itm != 'iconClass') { if (itm != 'href' && itm != 'label' && itm != 'icon' && itm != 'class' && itm != 'iconClass') {