mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 21:51:26 -03:30
Updates based on PR feedback.
This commit is contained in:
parent
66bab4fcf2
commit
ed0770b707
@ -55,10 +55,7 @@ import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects';
|
||||
import OrganizationsList from './organizations/list/organizations-list.controller';
|
||||
import OrganizationsAdd from './organizations/add/organizations-add.controller';
|
||||
import OrganizationsEdit from './organizations/edit/organizations-edit.controller';
|
||||
import InventoriesAdd from './inventories/add/inventory-add.controller';
|
||||
import InventoriesEdit from './inventories/edit/inventory-edit.controller';
|
||||
import InventoriesList from './inventories/list/inventory-list.controller';
|
||||
import InventoriesManage from './inventories/manage/inventory-manage.controller';
|
||||
import {InventoriesAdd, InventoriesEdit, InventoriesList, InventoriesManage} from './inventories/main';
|
||||
import {AdminsList} from './controllers/Admins';
|
||||
import {UsersList, UsersAdd, UsersEdit} from './controllers/Users';
|
||||
import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams';
|
||||
|
||||
@ -10,8 +10,6 @@
|
||||
* @description This controller's for the Inventory page
|
||||
*/
|
||||
|
||||
import '../../job-templates/main';
|
||||
|
||||
function InventoriesAdd($scope, $rootScope, $compile, $location, $log,
|
||||
$stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors,
|
||||
ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit,
|
||||
@ -25,7 +23,6 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log,
|
||||
form = InventoryForm(),
|
||||
generator = GenerateForm;
|
||||
|
||||
form.well = true;
|
||||
form.formLabelSize = null;
|
||||
form.formFieldSize = null;
|
||||
|
||||
|
||||
@ -10,8 +10,6 @@
|
||||
* @description This controller's for the Inventory page
|
||||
*/
|
||||
|
||||
import '../../job-templates/main';
|
||||
|
||||
function InventoriesEdit($scope, $rootScope, $compile, $location,
|
||||
$log, $stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors,
|
||||
ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit,
|
||||
@ -30,7 +28,6 @@ function InventoriesEdit($scope, $rootScope, $compile, $location,
|
||||
fld, json_data, data,
|
||||
relatedSets = {};
|
||||
|
||||
form.well = true;
|
||||
form.formLabelSize = null;
|
||||
form.formFieldSize = null;
|
||||
$scope.inventory_id = inventory_id;
|
||||
|
||||
@ -14,7 +14,7 @@ function InventoriesList($scope, $rootScope, $location, $log,
|
||||
$stateParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList,
|
||||
generateList, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||
ClearScope, ProcessErrors, GetBasePath, Wait,
|
||||
EditInventoryProperties, Find, Empty, $state) {
|
||||
Find, Empty, $state) {
|
||||
|
||||
var list = InventoryList,
|
||||
defaultUrl = GetBasePath('inventory'),
|
||||
@ -301,10 +301,6 @@ function InventoriesList($scope, $rootScope, $location, $log,
|
||||
|
||||
};
|
||||
|
||||
$scope.editInventoryProperties = function (inventory_id) {
|
||||
EditInventoryProperties({ scope: $scope, inventory_id: inventory_id });
|
||||
};
|
||||
|
||||
$scope.addInventory = function () {
|
||||
$state.go('inventories.add');
|
||||
};
|
||||
@ -365,5 +361,4 @@ function InventoriesList($scope, $rootScope, $location, $log,
|
||||
export default ['$scope', '$rootScope', '$location', '$log',
|
||||
'$stateParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList',
|
||||
'generateList', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller',
|
||||
'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait',
|
||||
'EditInventoryProperties', 'Find', 'Empty', '$state', InventoriesList];
|
||||
'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state', InventoriesList];
|
||||
|
||||
@ -335,12 +335,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
||||
|
||||
$scope.createGroup = function () {
|
||||
PreviousSearchParams = Store('group_current_search_params');
|
||||
// GroupsEdit({
|
||||
// scope: $scope,
|
||||
// inventory_id: $scope.inventory.id,
|
||||
// group_id: $scope.selected_group_id,
|
||||
// mode: 'add'
|
||||
// });
|
||||
var params = {
|
||||
scope: $scope,
|
||||
inventory_id: $scope.inventory.id,
|
||||
@ -353,12 +347,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
||||
|
||||
$scope.editGroup = function (id) {
|
||||
PreviousSearchParams = Store('group_current_search_params');
|
||||
// GroupsEdit({
|
||||
// scope: $scope,
|
||||
// inventory_id: $scope.inventory.id,
|
||||
// group_id: id,
|
||||
// mode: 'edit'
|
||||
// });
|
||||
var params = {
|
||||
scope: $scope,
|
||||
inventory_id: $scope.inventory.id,
|
||||
@ -432,15 +420,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
||||
};
|
||||
|
||||
hostScope.createHost = function () {
|
||||
// HostsEdit({
|
||||
// host_scope: hostScope,
|
||||
// group_scope: $scope,
|
||||
// mode: 'add',
|
||||
// host_id: null,
|
||||
// selected_group_id: $scope.selected_group_id,
|
||||
// inventory_id: $scope.inventory.id
|
||||
// });
|
||||
|
||||
var params = {
|
||||
host_scope: hostScope,
|
||||
group_scope: $scope,
|
||||
@ -454,13 +433,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
||||
};
|
||||
|
||||
hostScope.editHost = function (host_id) {
|
||||
// HostsEdit({
|
||||
// host_scope: hostScope,
|
||||
// group_scope: $scope,
|
||||
// mode: 'edit',
|
||||
// host_id: host_id,
|
||||
// inventory_id: $scope.inventory.id
|
||||
// });
|
||||
var params = {
|
||||
host_scope: hostScope,
|
||||
group_scope: $scope,
|
||||
@ -490,19 +462,6 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
||||
});
|
||||
};
|
||||
|
||||
/*hostScope.restoreSearch = function() {
|
||||
SearchInit({
|
||||
scope: hostScope,
|
||||
set: PreviousSearchParams.set,
|
||||
list: PreviousSearchParams.list,
|
||||
url: PreviousSearchParams.defaultUrl,
|
||||
iterator: PreviousSearchParams.iterator,
|
||||
sort_order: PreviousSearchParams.sort_order,
|
||||
setWidgets: false
|
||||
});
|
||||
hostScope.search('host');
|
||||
};*/
|
||||
|
||||
hostScope.toggleHostEnabled = function (host_id, external_source) {
|
||||
ToggleHostEnabled({
|
||||
parent_scope: $scope,
|
||||
|
||||
@ -68,13 +68,15 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $
|
||||
elem = document.getElementById('group-manage-panel');
|
||||
$compile(elem)(modal_scope);
|
||||
|
||||
$scope.parseType = 'yaml';
|
||||
|
||||
var form_scope =
|
||||
generator.inject(GroupForm, {
|
||||
mode: mode,
|
||||
id: 'properties-tab',
|
||||
related: false,
|
||||
scope: properties_scope,
|
||||
cancelButton: false
|
||||
cancelButton: false,
|
||||
});
|
||||
var source_form_scope =
|
||||
generator.inject(SourceForm, {
|
||||
@ -114,6 +116,13 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $
|
||||
modal_scope.removeLoadSourceData();
|
||||
}
|
||||
modal_scope.removeLoadSourceData = modal_scope.$on('LoadSourceData', function() {
|
||||
ParseTypeChange({
|
||||
scope: form_scope,
|
||||
variable: 'variables',
|
||||
parse_variable: 'parseType',
|
||||
field_id: 'group_variables'
|
||||
});
|
||||
|
||||
if (sources_scope.source_url) {
|
||||
// get source data
|
||||
Rest.setUrl(sources_scope.source_url);
|
||||
@ -239,6 +248,7 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $
|
||||
opts: opts
|
||||
});
|
||||
}
|
||||
|
||||
sources_scope.group_update_url = data.related.update;
|
||||
})
|
||||
.error(function(data, status) {
|
||||
|
||||
@ -40,9 +40,16 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam
|
||||
cancelButton: false
|
||||
});
|
||||
generator.reset();
|
||||
console.info(angular.element(document.getElementById('host_variables')));
|
||||
|
||||
$scope.parseType = 'yaml';
|
||||
ParseTypeChange({
|
||||
scope: form_scope,
|
||||
variable: 'variables',
|
||||
parse_variable: 'parseType',
|
||||
field_id: 'host_variables'
|
||||
});
|
||||
|
||||
scope.parseType = 'yaml';
|
||||
|
||||
// Retrieve detail record and prepopulate the form
|
||||
if (mode === 'edit') {
|
||||
@ -171,8 +178,6 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam
|
||||
$state.go('inventoryManage');
|
||||
};
|
||||
|
||||
|
||||
|
||||
angular.extend(vm, {
|
||||
cancelPanel: cancelPanel,
|
||||
saveHost: saveHost,
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
#Inventory-groupManage--panel, #Inventory-hostManage--panel {
|
||||
.ui-dialog-buttonpane.ui-widget-content {
|
||||
border: none;
|
||||
text-align: right;
|
||||
}
|
||||
#Inventory-groupManage--panel,
|
||||
#Inventory-hostManage--panel {
|
||||
.ui-dialog-buttonpane.ui-widget-content {
|
||||
border: none;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#host-panel-form, #properties-tab {
|
||||
.Form-header {
|
||||
margin-top: -20px;
|
||||
}
|
||||
}
|
||||
#host-panel-form,
|
||||
#properties-tab {
|
||||
.Form-header {
|
||||
margin-top: -20px;
|
||||
}
|
||||
}
|
||||
|
||||
.Form-textArea {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user