mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
Inventory refactor: save changes to a host now updates the enabled flag and tool tip on the host list.
This commit is contained in:
@@ -47,6 +47,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
scope.removePostRefresh = scope.$on('PostRefresh', function(e) {
|
scope.removePostRefresh = scope.$on('PostRefresh', function(e) {
|
||||||
for (var i=0; i < scope.hosts.length; i++) {
|
for (var i=0; i < scope.hosts.length; i++) {
|
||||||
//Set tooltip for host enabled flag
|
//Set tooltip for host enabled flag
|
||||||
|
scope.hosts[i].enabled_flag = scope.hosts[i].enabled;
|
||||||
SetEnabledMsg(scope.hosts[i]);
|
SetEnabledMsg(scope.hosts[i]);
|
||||||
}
|
}
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
@@ -336,9 +337,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
|
|
||||||
|
|
||||||
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
.factory('HostsEdit', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait', 'Find', 'SetEnabledMsg',
|
||||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
|
function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, GenerateForm, Prompt, ProcessErrors,
|
||||||
GetBasePath, HostsReload, ParseTypeChange, Wait, Find) {
|
GetBasePath, HostsReload, ParseTypeChange, Wait, Find, SetEnabledMsg) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var parent_scope = params.scope;
|
var parent_scope = params.scope;
|
||||||
@@ -428,6 +429,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
// Update the name on the list
|
// Update the name on the list
|
||||||
var host = Find({ list: parent_scope.hosts, key: 'id', val: host_id });
|
var host = Find({ list: parent_scope.hosts, key: 'id', val: host_id });
|
||||||
host.name = scope.name;
|
host.name = scope.name;
|
||||||
|
host.enabled = scope.enabled;
|
||||||
|
host.enabled_flag = scope.enabled;
|
||||||
|
SetEnabledMsg(host);
|
||||||
// Close modal
|
// Close modal
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#form-modal').modal('hide');
|
$('#form-modal').modal('hide');
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ angular.module('InventoryHostsDefinition', [])
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
enabled_flag: {
|
enabled_flag: {
|
||||||
//label: 'Enabled',
|
//label: 'Enabled',
|
||||||
iconClass: "\{\{ 'fa icon-enabled-' + host.enabled \}\}",
|
iconClass: "\{\{ 'fa icon-enabled-' + host.enabled \}\}",
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
@@ -69,13 +69,13 @@ angular.module('InventoryHostsDefinition', [])
|
|||||||
dataTipWatch: "host.enabledToolTip",
|
dataTipWatch: "host.enabledToolTip",
|
||||||
ngClick: "toggleHostEnabled(\{\{ host.id \}\}, \{\{ host.has_inventory_sources \}\})"
|
ngClick: "toggleHostEnabled(\{\{ host.id \}\}, \{\{ host.has_inventory_sources \}\})"
|
||||||
},
|
},
|
||||||
active_failures: {
|
active_failures: {
|
||||||
//label: 'Job Status',
|
//label: 'Job Status',
|
||||||
awToolTip: "\{\{ host.badgeToolTip \}\}",
|
awToolTip: "\{\{ host.badgeToolTip \}\}",
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
iconClass: "\{\{ 'fa icon-failures-' + host.has_active_failures \}\}"
|
iconClass: "\{\{ 'fa icon-failures-' + host.has_active_failures \}\}"
|
||||||
},
|
},
|
||||||
edit: {
|
edit: {
|
||||||
//label: 'Edit',
|
//label: 'Edit',
|
||||||
ngClick: "editHost(\{\{ host.id \}\})",
|
ngClick: "editHost(\{\{ host.id \}\})",
|
||||||
icon: 'icon-edit',
|
icon: 'icon-edit',
|
||||||
|
|||||||
Reference in New Issue
Block a user