1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

adding inventory button

This commit is contained in:
John Mitchell 2015-05-05 17:01:30 -04:00 committed by Jared Tabor
parent 1b2cce19cd
commit 5d12240af6
4 changed files with 33 additions and 8 deletions

View File

@ -895,18 +895,29 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
// you need this so that the event doesn't bubble to the watcher above
// for the host list
e.stopPropagation();
if (selection.length > 0) {
$scope.hostsSelected = true;
// $scope.adhocButtonTipContents = "Launch adhoc command for the "
// + "selected groups and hosts.";
} else {
if (selection.length === 0) {
$scope.hostsSelected = false;
// $scope.adhocButtonTipContents = "Launch adhoc command for the "
// + "inventory.";
} else if (selection.length === 1) {
$scope.systemTrackingTooltip = "Compare host over time";
$scope.hostsSelected = true;
$scope.systemTrackingDisabled = false;
} else if (selection.length === 2) {
$scope.systemTrackingTooltip = "Compare hosts against each other";
$scope.hostsSelected = true;
$scope.systemTrackingDisabled = false;
} else {
$scope.hostsSelected = true;
$scope.systemTrackingDisabled = true;
}
$scope.hostsSelectedItems = selection.selectedItems;
});
$scope.systemTracking = function() {
$location.path('/inventories/' + $scope.inventory.id +
'/system-tracking/' +
_.pluck($scope.hostsSelectedItems, "id").join(","));
};
// populates host patterns based on selected hosts/groups
$scope.populateAdhocForm = function() {
var host_patterns = "all";

View File

@ -87,6 +87,16 @@ export default
},
actions: {
system_tracking: {
label: 'System Tracking',
ngClick: 'systemTracking()', //'editInventoryProperties(inventory.id)',
awToolTip: "{{ systemTrackingTooltip }}",
dataTipWatch: "systemTrackingTooltip",
dataPlacement: 'top',
awFeature: 'system_tracking',
ngDisabled: 'systemTrackingDisabled',
ngShow: 'hostsSelected'
},
create: {
mode: 'all',
ngClick: "createHost()",
@ -103,7 +113,7 @@ export default
awToolTip: "View Activity Stream",
mode: 'all',
awFeature: 'activity_streams'
}
},
}
});

View File

@ -103,6 +103,9 @@ angular.module('GeneratorHelpers', [systemStatus.name])
action = params.action,
size = params.size;
switch (action) {
case 'system_tracking':
icon = "fa-crosshairs";
break;
case 'help':
icon = "fa-question-circle";
break;

View File

@ -12,6 +12,7 @@
class="options.class"
data-title="{{options.dataTitle}}"
icon-size="{{options.iconSize}}"
ng-disabled="{{options.ngDisabled}}"
ng-click="$eval(options.ngClick)"
ng-hide="isHiddenByOptions(options) ||
hiddenOnCurrentPage(options.basePaths) ||