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