Inventory refactoring: added All Hosts, group delete now works, view inventory sync status works, group add now refreshes the group view correctly.

This commit is contained in:
Chris Houseknecht
2014-01-08 23:38:00 +00:00
parent 255dead521
commit 9930c6d356
9 changed files with 263 additions and 202 deletions

View File

@@ -23,12 +23,13 @@ angular.module('InventoryGroupsDefinition', [])
fields: {
name: {
label: 'Group',
label: 'Groups',
key: true,
ngClick: "\{\{ 'showHosts(' + group.id + ',' + group.group_id + ')' \}\}",
ngClass: "group.selected_class",
hasChildren: true,
columnClass: 'col-lg-9'
columnClass: 'col-lg-9',
nosort: true
},
source: {
label: 'Source',
@@ -87,7 +88,7 @@ angular.module('InventoryGroupsDefinition', [])
refresh: {
mode: 'all',
awToolTip: "Refresh the page",
ngClick: "refresh()"
ngClick: "refreshGroups()"
},
stream: {
ngClick: "showActivity()",
@@ -110,6 +111,7 @@ angular.module('InventoryGroupsDefinition', [])
sync_status: {
mode: 'all',
ngClick: "viewUpdateStatus(\{\{ group.id \}\})",
ngShow: "group.id > 1", // hide for all hosts
awToolTip: "\{\{ group.status_tooltip \}\}",
ngClass: "group.status_class",
dataPlacement: "top"
@@ -117,6 +119,7 @@ angular.module('InventoryGroupsDefinition', [])
failed_hosts: {
mode: 'all',
awToolTip: "\{\{ group.hosts_status_tip \}\}",
ngShow: "group.id > 1", // hide for all hosts
dataPlacement: "top",
ngClick: "viewFailedHosts(\{\{ group.id \}\})",
iconClass: "\{\{ 'fa icon-failures-' + group.hosts_status_class \}\}"
@@ -125,6 +128,7 @@ angular.module('InventoryGroupsDefinition', [])
//label: 'Sync',
ngClick: 'updateGroup(\{\{ group.id \}\})',
awToolTip: "\{\{ group.launch_tooltip \}\}",
ngShow: "group.id > 1", // hide for all hosts
ngClass: "group.launch_class",
dataPlacement: "top"
},
@@ -133,19 +137,21 @@ angular.module('InventoryGroupsDefinition', [])
ngClick: "cancelUpdate(\{\{ group.id \}\}, '\{\{ group.name \}\}')",
awToolTip: "Cancel sync process",
ngClass: "group.cancel_class",
ngShow: "group.status == 'running' || group.status == 'pending'",
ngShow: "group.id > 1 && (group.status == 'running' || group.status == 'pending')",
dataPlacement: "top"
},
edit: {
//label: 'Edit',
ngClick: "editGroup(\{\{ group.group_id \}\})",
awToolTip: 'Edit group',
ngShow: "group.id > 1", // hide for all hosts
dataPlacement: "top"
},
"delete": {
//label: 'Delete',
ngClick: "deleteGroup(\{\{ group.group_id \}\},'\{\{ group.name \}\}')",
ngClick: "deleteGroup(\{\{ group.id \}\})",
awToolTip: 'Delete group',
ngShow: "group.id != 1", // hide for all hosts
dataPlacement: "top"
}
}

View File

@@ -23,7 +23,7 @@ angular.module('InventoryHostsDefinition', [])
fields: {
name: {
key: true,
label: 'Name',
label: 'Hosts',
ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
searchPlaceholder: "search_place_holder"
},
@@ -51,14 +51,14 @@ angular.module('InventoryHostsDefinition', [])
searchable: false,
showValue: false
},
groups: {
/*groups: {
label: 'Groups',
searchable: true,
sourceModel: 'groups',
sourceField: 'name',
nosort: true,
searchPlaceholder: "search_place_holder"
},
},*/
enabled: {
label: 'Disabled?',
searchSingleValue: true,
@@ -72,27 +72,28 @@ angular.module('InventoryHostsDefinition', [])
searchType: 'boolean',
searchValue: 'true',
searchOnly: true
},
}
/* ,
has_inventory_sources: {
label: 'Has external source?',
searchSingleValue: true,
searchType: 'boolean',
searchValue: 'true',
searchOnly: true
}
}*/
},
fieldActions: {
edit: {
label: 'Edit',
ngClick: "editGroup(\{\{ group.id \}\})",
ngClick: "editGroup(\{\{ host.id \}\})",
icon: 'icon-edit',
"class": 'btn-xs btn-primary',
awToolTip: 'Edit host'
},
"delete": {
label: 'Delete',
ngClick: "deleteGroup(\{\{ group.id \}\},'\{\{ group.name \}\}')",
ngClick: "deleteHoust(\{\{ host.id \}\},'\{\{ host.name \}\}')",
icon: 'icon-trash',
"class": 'btn-xs btn-primary',
awToolTip: 'Delete host'