mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
add children count badges to Inventories > Groups. resolves #1600
This commit is contained in:
@@ -153,8 +153,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
|||||||
}
|
}
|
||||||
$scope.removeInventoryLoaded = $scope.$on('InventoryLoaded', function() {
|
$scope.removeInventoryLoaded = $scope.$on('InventoryLoaded', function() {
|
||||||
var rows;
|
var rows;
|
||||||
|
|
||||||
// Add groups view
|
|
||||||
generateList.inject(InventoryGroups, {
|
generateList.inject(InventoryGroups, {
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
id: 'group-list-container',
|
id: 'group-list-container',
|
||||||
@@ -529,5 +527,5 @@ export default [
|
|||||||
'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
||||||
'EditInventoryProperties', 'ToggleHostEnabled', 'ShowJobSummary',
|
'EditInventoryProperties', 'ToggleHostEnabled', 'ShowJobSummary',
|
||||||
'InventoryGroupsHelp', 'HelpDialog', 'GroupsCopy',
|
'InventoryGroupsHelp', 'HelpDialog', 'GroupsCopy',
|
||||||
'HostsCopy', '$stateParams', 'ParamPass', InventoriesManage,
|
'HostsCopy', '$stateParams', 'ParamPass', InventoriesManage
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ export default
|
|||||||
key: true,
|
key: true,
|
||||||
ngClick: "groupSelect(group.id)",
|
ngClick: "groupSelect(group.id)",
|
||||||
columnClick: "groupSelect(group.id)",
|
columnClick: "groupSelect(group.id)",
|
||||||
columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6'
|
columnClass: 'col-lg-3 col-md-3 col-sm-3 col-xs-3'
|
||||||
|
},
|
||||||
|
total_groups: {
|
||||||
|
nosort: true,
|
||||||
|
label: '',
|
||||||
|
type: 'badgeCount',
|
||||||
|
ngHide: '{{group.total_groups == 0}}',
|
||||||
},
|
},
|
||||||
source: {
|
source: {
|
||||||
label: 'Source',
|
label: 'Source',
|
||||||
|
|||||||
@@ -20,3 +20,7 @@
|
|||||||
background: @btn-bg-sel;
|
background: @btn-bg-sel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.List-tableRow .badge, {
|
||||||
|
padding: 3px 15px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
@@ -268,29 +268,27 @@ angular.module('GeneratorHelpers', [systemStatus.name])
|
|||||||
.factory('BadgeCount', [
|
.factory('BadgeCount', [
|
||||||
function () {
|
function () {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
// Adds a badge count with optional tooltip
|
// Adds a badge count with optional tooltip
|
||||||
|
|
||||||
var list = params.list,
|
var list = params.list,
|
||||||
fld = params.fld,
|
fld = params.fld,
|
||||||
field = list.fields[fld],
|
field = list.fields[fld],
|
||||||
html;
|
html = '';
|
||||||
|
html = "<td class=\"" + fld + "-column";
|
||||||
html = "<td class=\"" + fld + "-column";
|
html += (field.columnClass) ? " " + field.columnClass : "";
|
||||||
html += (field.columnClass) ? " " + field.columnClass : "";
|
html += "\">\n";
|
||||||
html += (field.columnNgClass) ? "\" ng-class=\"" + field.columnNgClass : "";
|
html += "<a ng-href=\"" + field.ngHref + "\" aw-tool-tip=\"" + field.awToolTip + "\"";
|
||||||
html += "\">\n";
|
html += (field.dataPlacement) ? " data-placement=\"" + field.dataPlacement + "\"" : "";
|
||||||
html += "<a ng-href=\"" + field.ngHref + "\" aw-tool-tip=\"" + field.awToolTip + "\"";
|
html += ">";
|
||||||
html += (field.dataPlacement) ? " data-placement=\"" + field.dataPlacement + "\"" : "";
|
html += "<span class=\"badge";
|
||||||
html += ">";
|
html += (field['class']) ? " " + field['class'] : "";
|
||||||
html += "<span class=\"badge";
|
html += (field.ngHide) ? "\" ng-hide=\"" + field.ngHide : "";
|
||||||
html += (field['class']) ? " " + field['class'] : "";
|
html += "\">";
|
||||||
html += "\">";
|
html += "{{ " + list.iterator + '.' + fld + " }}";
|
||||||
html += "{{ " + list.iterator + '.' + fld + " }}";
|
html += "</span>";
|
||||||
html += "</span>";
|
html += (field.badgeLabel) ? " " + field.badgeLabel : "";
|
||||||
html += (field.badgeLabel) ? " " + field.badgeLabel : "";
|
html += "</a>\n";
|
||||||
html += "</a>\n";
|
html += "</td>\n";
|
||||||
html += "</td>\n";
|
|
||||||
return html;
|
return html;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user