mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Inventory refactor from 1.4.11
Includes commits from release_1.4.11 branch up to and including d434e675a7c9727af900d7c21de5e542aef0eb98. That should be everything. What remains is testing.
This commit is contained in:
@@ -62,16 +62,7 @@ angular.module('InventoryGroupsHelpDefinition', [])
|
|||||||
},
|
},
|
||||||
box: "<div class=\"text-left\">First, select a group. Then click <i class=\"fa fa-plus\"></i> to create a new group. The new group " +
|
box: "<div class=\"text-left\">First, select a group. Then click <i class=\"fa fa-plus\"></i> to create a new group. The new group " +
|
||||||
"will be added to the selected group.</div>"
|
"will be added to the selected group.</div>"
|
||||||
}, {
|
},{
|
||||||
intro: 'Copy or move groups:',
|
|
||||||
img: {
|
|
||||||
src: 'groups006.png',
|
|
||||||
maxWidth: 263,
|
|
||||||
maxHeight: 211
|
|
||||||
},
|
|
||||||
box: "<div class=\"text-left\">Copy or move a group by dragging and dropping its name onto another group name. A dialog will appear " +
|
|
||||||
"asking if the group should be coppied or moved.</div>"
|
|
||||||
}, {
|
|
||||||
intro: 'Adding hosts:',
|
intro: 'Adding hosts:',
|
||||||
img: {
|
img: {
|
||||||
src: 'groups007.png',
|
src: 'groups007.png',
|
||||||
|
|||||||
@@ -450,7 +450,8 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
|
|||||||
ParseVariableString, CreateDialog, TextareaResize) {
|
ParseVariableString, CreateDialog, TextareaResize) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var parent_scope = params.parent_scope,
|
var parent_scope = params.host_scope,
|
||||||
|
group_scope = params.group_scope,
|
||||||
host_id = params.host_id,
|
host_id = params.host_id,
|
||||||
inventory_id = params.inventory_id,
|
inventory_id = params.inventory_id,
|
||||||
mode = params.mode, // 'add' or 'edit'
|
mode = params.mode, // 'add' or 'edit'
|
||||||
@@ -458,7 +459,7 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
|
|||||||
generator = GenerateForm,
|
generator = GenerateForm,
|
||||||
form = HostForm,
|
form = HostForm,
|
||||||
defaultUrl,
|
defaultUrl,
|
||||||
scope = params.host_scope,
|
scope = parent_scope.$new(),
|
||||||
master = {},
|
master = {},
|
||||||
relatedSets = {},
|
relatedSets = {},
|
||||||
buttons, url;
|
buttons, url;
|
||||||
@@ -614,36 +615,7 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
|
|||||||
scope.removeSaveCompleted();
|
scope.removeSaveCompleted();
|
||||||
}
|
}
|
||||||
scope.removeSaveCompleted = scope.$on('saveCompleted', function() {
|
scope.removeSaveCompleted = scope.$on('saveCompleted', function() {
|
||||||
var host, old_name;
|
scope.cancelModal();
|
||||||
if (mode === 'edit') {
|
|
||||||
// Update the name on the list
|
|
||||||
host = Find({ list: scope.hosts, key: 'id', val: host_id });
|
|
||||||
old_name = host.name;
|
|
||||||
host.name = scope.name;
|
|
||||||
host.enabled = (scope.enabled) ? true : false;
|
|
||||||
host.enabled_flag = host.enabled;
|
|
||||||
SetStatus({ scope: scope, host: host });
|
|
||||||
// Update any titles attributes created by ApplyEllipsis
|
|
||||||
if (old_name) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$('#hosts_table .host-name a[title="' + old_name + '"]').attr('title', host.name);
|
|
||||||
ApplyEllipsis('#hosts_table .host-name a');
|
|
||||||
// Close modal
|
|
||||||
$('#host-modal-dialog').dialog('close');
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Close modal
|
|
||||||
$('#host-modal-dialog').dialog('close');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$('#host-modal-dialog').dialog('close');
|
|
||||||
parent_scope.refreshHosts();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore ellipsis response to window resize
|
|
||||||
//WatchInventoryWindowResize();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
@@ -701,7 +673,8 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
|
|||||||
catch(err) {
|
catch(err) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
parent_scope.refreshHosts();
|
group_scope.refreshHosts();
|
||||||
|
scope.$destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -331,8 +331,10 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
view = GenerateList,
|
view = GenerateList,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
parent_scope = params.scope,
|
parent_scope = params.scope,
|
||||||
PreviousSearchParams = Store('CurrentSearchParams'),
|
search_iterator = params.search_iterator, // use to get correct current_search_params from local store
|
||||||
|
PreviousSearchParams = (search_iterator) ? Store(search_iterator + '_current_search_params') : Store('CurrentSearchParams'),
|
||||||
inventory_name = (params && params.inventory_name) ? params.inventory_name : null,
|
inventory_name = (params && params.inventory_name) ? params.inventory_name : null,
|
||||||
|
onClose = params.onClose, // optional callback to $emit after AS closes
|
||||||
url = (params && params.url) ? params.url : null,
|
url = (params && params.url) ? params.url : null,
|
||||||
type, paths, itm, scope;
|
type, paths, itm, scope;
|
||||||
|
|
||||||
@@ -402,6 +404,9 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
if (inUrl) {
|
if (inUrl) {
|
||||||
$location.path(inUrl);
|
$location.path(inUrl);
|
||||||
}
|
}
|
||||||
|
else if (onClose) {
|
||||||
|
parent_scope.$emit(onClose);
|
||||||
|
}
|
||||||
scope.$destroy();
|
scope.$destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -907,7 +907,6 @@ input[type="checkbox"].checkbox-no-label {
|
|||||||
.table-hover tbody tr:hover > td,
|
.table-hover tbody tr:hover > td,
|
||||||
.table-hover tbody tr:hover > th {
|
.table-hover tbody tr:hover > th {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-hover-inverse tbody tr:hover > td,
|
.table-hover-inverse tbody tr:hover > td,
|
||||||
|
|||||||
Reference in New Issue
Block a user