1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

Inventory refactor: now all nodes in group tree have an icon. same for job events view.

This commit is contained in:
Chris Houseknecht 2014-01-10 22:44:12 +00:00
parent 8279012ffa
commit 6d205213db
7 changed files with 22 additions and 14 deletions

View File

@ -453,13 +453,17 @@ function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateLis
}
}
$scope.cancelUpdate = function(id) {
GroupsCancelUpdate({ scope: $scope, tree_id: id });
$scope.cancelUpdate = function(tree_id) {
GroupsCancelUpdate({ scope: $scope, tree_id: tree_id });
}
$scope.toggle = function(id) {
$scope.toggle = function(tree_id) {
// Expand/collapse nodes
ToggleChildren({ scope: $scope, list: list, id: id });
if (tree_id !== $scope.selected_tree_id) {
$scope.showHosts(tree_id, Find({ list: $scope.groups, key: 'id', val: tree_id }).group_id, false);
console.log('set group_id to: ' + $scope.selected_group_id);
}
ToggleChildren({ scope: $scope, list: list, id: tree_id });
}
$scope.refreshGroups = function(tree_id, group_id) {

View File

@ -136,6 +136,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
set[i]['class'] = 'parentNode';
}
else {
set[i]['ngicon'] = 'fa fa-square-o node-no-toggle';
set[i]['class'] = 'childNode';
set[i]['event_detail'] = formatJSON(set[i].event_data);
}

View File

@ -57,7 +57,7 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
// Expand: lookup and display children
expand(clicked);
}
else {
else if (/minus-square-o/.test(set[clicked]['ngicon'])) {
collapse(clicked);
}
}

View File

@ -94,12 +94,11 @@ angular.module('JobEventsListDefinition', [])
},
fieldActions: {
edit: {
view: {
label: 'View',
ngClick: "viewJobEvent(\{\{ jobevent.id \}\})",
icon: 'icon-zoom-in',
"class": 'btn-default btn-xs',
awToolTip: 'View event details'
awToolTip: 'View event details',
dataPlacement: 'top'
}
}
});

View File

@ -995,7 +995,7 @@ input[type="checkbox"].checkbox-no-label {
.level-10 { padding-left: 200px; }
.level-3-detail {
padding-left: 72px;
padding-left: 80px;
}
#job_events .control-group {
@ -1045,7 +1045,7 @@ input[type="checkbox"].checkbox-no-label {
border-right: 1px solid #ddd;
}
.node-toggle {
.node-toggle, .node-no-toggle {
/* also used on job evetns */
float: none;
padding-top: 3px;
@ -1054,6 +1054,10 @@ input[type="checkbox"].checkbox-no-label {
margin-left: 0;
}
.node-no-toggle {
opacity: .30;
}
.disabled {
color: @grey;
}

View File

@ -218,7 +218,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper'])
source: sorted[i].summary_fields.inventory_source.source,
group_id: sorted[i].id,
event_level: level,
ngicon: (sorted[i].children.length > 0) ? 'fa fa-minus-square-o node-toggle' : null,
ngicon: (sorted[i].children.length > 0) ? 'fa fa-minus-square-o node-toggle' : 'fa fa-square-o node-no-toggle',
ngclick: 'toggle(' + id + ')',
related: {
children: (sorted[i].children.length > 0) ? sorted[i].related.children : '',

View File

@ -505,8 +505,8 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
// Add collapse/expand icon --used on job_events page
if (list['hasChildren'] && field.hasChildren) {
html += "<span class=\"level-\{\{ " + list.iterator + ".event_level \}\}\"><a href=\"\" ng-click=\"\{\{ " + list.iterator + ".ngclick \}\}\"> " +
"<i class=\"\{\{ " + list.iterator + ".ngicon \}\}\" ng-show=\"'\{\{ " +
list.iterator + ".related.children \}\}' !== ''\" ></i></a> ";
"<i class=\"\{\{ " + list.iterator + ".ngicon \}\}\"></i></a> ";
//ng-show=\"'\{\{ " + list.iterator + ".related.children \}\}' !== ''\"
}
// Start the Link