mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
adjustments to host list
adding Inventory column and disabling host toggle for external sources
This commit is contained in:
parent
f9b46b7c3d
commit
3bcb4b0496
@ -21,7 +21,7 @@ export default ['i18n', function(i18n) {
|
||||
|
||||
fields: {
|
||||
toggleHost: {
|
||||
ngDisabled: "!host.summary_fields.user_capabilities.edit",
|
||||
ngDisabled: 'host.has_inventory_sources',
|
||||
label: '',
|
||||
columnClass: 'List-staticColumn--toggle',
|
||||
type: "toggle",
|
||||
@ -54,13 +54,20 @@ export default ['i18n', function(i18n) {
|
||||
},
|
||||
name: {
|
||||
key: true,
|
||||
label: 'Name',
|
||||
label: i18n._('Name'),
|
||||
ngClick: "editHost(host.id)",
|
||||
columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7',
|
||||
dataHostId: "{{ host.id }}",
|
||||
dataType: "host",
|
||||
class: 'InventoryManage-breakWord'
|
||||
}
|
||||
},
|
||||
inventory_name: {
|
||||
label: i18n._('Inventory'),
|
||||
sourceModel: 'inventory',
|
||||
sourceField: 'name',
|
||||
columnClass: 'col-lg-5 col-md-4 col-sm-4 hidden-xs elllipsis',
|
||||
linkTo: "{{ '/#/inventories/' + host.inventory_id }}"
|
||||
},
|
||||
},
|
||||
|
||||
fieldActions: {
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
*************************************************/
|
||||
|
||||
function HostsList($scope, HostsNewList, $rootScope, GetBasePath,
|
||||
rbacUiControlService, Dataset, $state, $filter, Prompt, Wait, HostManageService) {
|
||||
rbacUiControlService, Dataset, $state, $filter, Prompt, Wait,
|
||||
HostManageService, SetStatus) {
|
||||
|
||||
let list = HostsNewList;
|
||||
|
||||
@ -26,6 +27,24 @@ function HostsList($scope, HostsNewList, $rootScope, GetBasePath,
|
||||
|
||||
$rootScope.flashMessage = null;
|
||||
|
||||
$scope.$watchCollection(list.name, function() {
|
||||
$scope[list.name] = _.map($scope.hosts, function(value) {
|
||||
value.inventory_name = value.summary_fields.inventory.name;
|
||||
value.inventory_id = value.summary_fields.inventory.id;
|
||||
return value;
|
||||
});
|
||||
setJobStatus();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function setJobStatus(){
|
||||
_.forEach($scope.hosts, function(value) {
|
||||
SetStatus({
|
||||
scope: $scope,
|
||||
host: value
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$scope.createHost = function(){
|
||||
@ -58,7 +77,7 @@ function HostsList($scope, HostsNewList, $rootScope, GetBasePath,
|
||||
});
|
||||
$rootScope.promptActionBtnClass = 'Modal-errorButton';
|
||||
};
|
||||
|
||||
|
||||
$scope.toggleHost = function(event, host) {
|
||||
try {
|
||||
$(event.target).tooltip('hide');
|
||||
@ -76,5 +95,6 @@ function HostsList($scope, HostsNewList, $rootScope, GetBasePath,
|
||||
}
|
||||
|
||||
export default ['$scope', 'HostsNewList', '$rootScope', 'GetBasePath',
|
||||
'rbacUiControlService', 'Dataset', '$state', '$filter', 'Prompt', 'Wait', 'HostManageService', HostsList
|
||||
'rbacUiControlService', 'Dataset', '$state', '$filter', 'Prompt', 'Wait',
|
||||
'HostManageService', 'SetStatus', HostsList
|
||||
];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user