mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
resolve jshint merge conflicts
This commit is contained in:
committed by
Leigh Johnson
parent
b718f70b8e
commit
83e79724d1
@@ -198,8 +198,6 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
var defaultUrl = GetBasePath('teams'),
|
var defaultUrl = GetBasePath('teams'),
|
||||||
generator = GenerateForm,
|
generator = GenerateForm,
|
||||||
form = TeamForm,
|
form = TeamForm,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
|
||||||
master = {},
|
|
||||||
id = $stateParams.team_id,
|
id = $stateParams.team_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
@@ -207,7 +205,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
|
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset()
|
generator.reset();
|
||||||
|
|
||||||
var setScopeFields = function(data){
|
var setScopeFields = function(data){
|
||||||
_(data)
|
_(data)
|
||||||
@@ -218,7 +216,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
$scope[key] = value;
|
$scope[key] = value;
|
||||||
})
|
})
|
||||||
.value();
|
.value();
|
||||||
return
|
return;
|
||||||
};
|
};
|
||||||
var setScopeRelated = function(data, related){
|
var setScopeRelated = function(data, related){
|
||||||
_(related)
|
_(related)
|
||||||
@@ -242,7 +240,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
data[key] = $scope[key];
|
data[key] = $scope[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return data
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
var init = function(){
|
var init = function(){
|
||||||
@@ -251,7 +249,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
Rest.get(url).success(function(data){
|
Rest.get(url).success(function(data){
|
||||||
setScopeFields(data);
|
setScopeFields(data);
|
||||||
setScopeRelated(data, form.related)
|
setScopeRelated(data, form.related);
|
||||||
$scope.organization_name = data.summary_fields.organization.name;
|
$scope.organization_name = data.summary_fields.organization.name;
|
||||||
|
|
||||||
RelatedSearchInit({
|
RelatedSearchInit({
|
||||||
@@ -275,11 +273,11 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
input_type: 'radio'
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
$state.go('teams', null, {reload: true});
|
$state.go('teams', null, {reload: true});
|
||||||
}
|
};
|
||||||
|
|
||||||
$scope.formSave = function(){
|
$scope.formSave = function(){
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
@@ -288,7 +286,7 @@ export function TeamsEdit($scope, $rootScope, $location,
|
|||||||
if ($scope[form.name + '_form'].$valid){
|
if ($scope[form.name + '_form'].$valid){
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = processNewData(form.fields);
|
var data = processNewData(form.fields);
|
||||||
Rest.put(data).success(function(res){
|
Rest.put(data).success(function(){
|
||||||
$state.go('teams', null, {reload: true});
|
$state.go('teams', null, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
|||||||
@@ -229,7 +229,6 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
var defaultUrl = GetBasePath('users'),
|
var defaultUrl = GetBasePath('users'),
|
||||||
generator = GenerateForm,
|
generator = GenerateForm,
|
||||||
form = UserForm,
|
form = UserForm,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
|
||||||
master = {},
|
master = {},
|
||||||
id = $stateParams.user_id,
|
id = $stateParams.user_id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
@@ -246,7 +245,7 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
$scope[key] = value;
|
$scope[key] = value;
|
||||||
})
|
})
|
||||||
.value();
|
.value();
|
||||||
return
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
var setScopeRelated = function(data, related){
|
var setScopeRelated = function(data, related){
|
||||||
@@ -270,7 +269,7 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
data[key] = $scope[key];
|
data[key] = $scope[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return data
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
var init = function(){
|
var init = function(){
|
||||||
@@ -315,8 +314,8 @@ export function UsersEdit($scope, $rootScope, $location,
|
|||||||
if ($scope[form.name + '_form'].$valid){
|
if ($scope[form.name + '_form'].$valid){
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = processNewData(form.fields);
|
var data = processNewData(form.fields);
|
||||||
Rest.put(data).success(function(res){
|
Rest.put(data).success(function(){
|
||||||
$state.go('users', null, {reload: true})
|
$state.go('users', null, {reload: true});
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve user: ' +
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
if (fld !== 'access_key' && fld !== 'secret_key' && fld !== 'ssh_username' &&
|
if (fld !== 'access_key' && fld !== 'secret_key' && fld !== 'ssh_username' &&
|
||||||
fld !== 'ssh_password') {
|
fld !== 'ssh_password') {
|
||||||
if (fld === "organization" && !scope[fld]) {
|
if (fld === "organization" && !scope[fld]) {
|
||||||
data["user"] = $rootScope.current_user.id;
|
data.user = $rootScope.current_user.id;
|
||||||
} else if (scope[fld] === null) {
|
} else if (scope[fld] === null) {
|
||||||
data[fld] = "";
|
data[fld] = "";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1008,7 +1008,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
}
|
}
|
||||||
else if(fld === "inventory_script"){
|
else if(fld === "inventory_script"){
|
||||||
// the API stores it as 'source_script', we call it inventory_script
|
// the API stores it as 'source_script', we call it inventory_script
|
||||||
data.summary_fields['inventory_script'] = data.summary_fields.source_script;
|
data.summary_fields.inventory_script = data.summary_fields.source_script;
|
||||||
sources_scope.inventory_script = data.source_script;
|
sources_scope.inventory_script = data.source_script;
|
||||||
master.inventory_script = sources_scope.inventory_script;
|
master.inventory_script = sources_scope.inventory_script;
|
||||||
} else if (fld === "source_regions") {
|
} else if (fld === "source_regions") {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ export default
|
|||||||
* Initialize calling scope with all the bits required to support a jobs list
|
* Initialize calling scope with all the bits required to support a jobs list
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.factory('JobsControllerInit', ['$state', 'Find', 'DeleteJob', 'RelaunchJob', '$window',
|
.factory('JobsControllerInit', ['$state', 'Find', 'DeleteJob', 'RelaunchJob',
|
||||||
function($state, Find, DeleteJob, RelaunchJob, $window) {
|
function($state, Find, DeleteJob, RelaunchJob) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
iterator = (params.iterator) ? params.iterator : scope.iterator;
|
iterator = (params.iterator) ? params.iterator : scope.iterator;
|
||||||
@@ -76,7 +76,7 @@ export default
|
|||||||
|
|
||||||
var goToJobDetails = function(state) {
|
var goToJobDetails = function(state) {
|
||||||
$state.go(state, {id: job.id}, {reload:true});
|
$state.go(state, {id: job.id}, {reload:true});
|
||||||
}
|
};
|
||||||
|
|
||||||
switch(job.type) {
|
switch(job.type) {
|
||||||
case 'job':
|
case 'job':
|
||||||
@@ -348,8 +348,8 @@ export default
|
|||||||
* Called from JobsList controller to load each section or list on the page
|
* Called from JobsList controller to load each section or list on the page
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.factory('LoadJobsScope', ['$stateParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate', 'SearchWidget',
|
.factory('LoadJobsScope', ['$stateParams', '$location', '$compile', 'SearchInit', 'PaginateInit', 'generateList', 'JobsControllerInit', 'JobsListUpdate',
|
||||||
function($stateParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate, SearchWidget) {
|
function($stateParams, $location, $compile, SearchInit, PaginateInit, GenerateList, JobsControllerInit, JobsListUpdate) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var parent_scope = params.parent_scope,
|
var parent_scope = params.parent_scope,
|
||||||
scope = params.scope,
|
scope = params.scope,
|
||||||
@@ -359,8 +359,7 @@ export default
|
|||||||
pageSize = params.pageSize || 5,
|
pageSize = params.pageSize || 5,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
search_params = params.searchParams,
|
search_params = params.searchParams,
|
||||||
spinner = (params.spinner === undefined) ? true : params.spinner,
|
spinner = (params.spinner === undefined) ? true : params.spinner, key;
|
||||||
e, html, key;
|
|
||||||
|
|
||||||
GenerateList.inject(list, {
|
GenerateList.inject(list, {
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
|
|||||||
@@ -20,14 +20,12 @@ export default
|
|||||||
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', listGenerator.name, 'ModalDialog',
|
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', listGenerator.name, 'ModalDialog',
|
||||||
'GeneratorHelpers'])
|
'GeneratorHelpers'])
|
||||||
|
|
||||||
.factory('ShowSchedulerModal', ['$rootScope', 'Wait', 'CreateDialog', function($rootScope, Wait, CreateDialog) {
|
.factory('ShowSchedulerModal', ['$rootScope', function($rootScope) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
// Set modal dimensions based on viewport width
|
// Set modal dimensions based on viewport width
|
||||||
|
|
||||||
var buttons,
|
var buttons,
|
||||||
scope = params.scope,
|
scope = params.scope;
|
||||||
callback = params.callback,
|
|
||||||
title = params.title;
|
|
||||||
|
|
||||||
buttons = [{
|
buttons = [{
|
||||||
"label": "Cancel",
|
"label": "Cancel",
|
||||||
@@ -221,12 +219,12 @@ export default
|
|||||||
if (!Empty($stateParams.template_id)) {
|
if (!Empty($stateParams.template_id)) {
|
||||||
url += $stateParams.template_id + '/schedules/';
|
url += $stateParams.template_id + '/schedules/';
|
||||||
}
|
}
|
||||||
else if (!Empty($stateParams.id) && base != 'system_job_templates') {
|
else if (!Empty($stateParams.id) && base !== 'system_job_templates') {
|
||||||
url += $stateParams.id + '/schedules/';
|
url += $stateParams.id + '/schedules/';
|
||||||
}
|
}
|
||||||
else if (base == 'system_job_templates') {
|
else if (base === 'system_job_templates') {
|
||||||
url += $stateParams.id + '/schedules/';
|
url += $stateParams.id + '/schedules/';
|
||||||
if($stateParams.id == 4){
|
if($stateParams.id === 4){
|
||||||
scope.isFactCleanup = true;
|
scope.isFactCleanup = true;
|
||||||
scope.keep_unit_choices = [{
|
scope.keep_unit_choices = [{
|
||||||
"label" : "Days",
|
"label" : "Days",
|
||||||
@@ -532,9 +530,8 @@ export default
|
|||||||
|
|
||||||
|
|
||||||
.factory('SchedulesControllerInit', ['$state', '$location', 'ToggleSchedule',
|
.factory('SchedulesControllerInit', ['$state', '$location', 'ToggleSchedule',
|
||||||
'DeleteSchedule', 'EditSchedule', 'AddSchedule',
|
'DeleteSchedule',
|
||||||
function($state, $location, ToggleSchedule, DeleteSchedule, EditSchedule,
|
function($state, $location, ToggleSchedule, DeleteSchedule) {
|
||||||
AddSchedule) {
|
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
parent_scope = params.parent_scope,
|
parent_scope = params.parent_scope,
|
||||||
|
|||||||
@@ -67,24 +67,26 @@ export default
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var id, restUrl, pageSize;
|
||||||
|
|
||||||
// if you're editing an object, make sure you're on the right
|
// if you're editing an object, make sure you're on the right
|
||||||
// page to display the element you are editing
|
// page to display the element you are editing
|
||||||
if (scope.addedItem) {
|
if (scope.addedItem) {
|
||||||
var id = scope.addedItem + "";
|
id = scope.addedItem + "";
|
||||||
delete scope.addedItem;
|
delete scope.addedItem;
|
||||||
$rootScope.rowBeingEdited = id;
|
$rootScope.rowBeingEdited = id;
|
||||||
$rootScope.listBeingEdited = set;
|
$rootScope.listBeingEdited = set;
|
||||||
$rootScope.addedAnItem = true;
|
$rootScope.addedAnItem = true;
|
||||||
var restUrl = params.url.split("?")[0];
|
restUrl = params.url.split("?")[0];
|
||||||
var pageSize = scope[iterator + '_page_size'];
|
pageSize = scope[iterator + '_page_size'];
|
||||||
pagination.getInitialPageForList(id, restUrl, pageSize)
|
pagination.getInitialPageForList(id, restUrl, pageSize)
|
||||||
.then(function (currentPage) {
|
.then(function (currentPage) {
|
||||||
scope.getPage(currentPage, set, iterator);
|
scope.getPage(currentPage, set, iterator);
|
||||||
});
|
});
|
||||||
} else if ($location.$$url.split("/")[1] === params.set && $location.$$url.split("/")[2] && $location.$$url.split("/")[2] !== "add" && !scope.getNewPage) {
|
} else if ($location.$$url.split("/")[1] === params.set && $location.$$url.split("/")[2] && $location.$$url.split("/")[2] !== "add" && !scope.getNewPage) {
|
||||||
var id = $location.$$url.split("/")[2];
|
id = $location.$$url.split("/")[2];
|
||||||
var restUrl = params.url.split("?")[0];
|
restUrl = params.url.split("?")[0];
|
||||||
var pageSize = scope[iterator + '_page_size'];
|
pageSize = scope[iterator + '_page_size'];
|
||||||
pagination.getInitialPageForList(id, restUrl, pageSize)
|
pagination.getInitialPageForList(id, restUrl, pageSize)
|
||||||
.then(function (currentPage) {
|
.then(function (currentPage) {
|
||||||
scope[iterator + '_page'] = currentPage;
|
scope[iterator + '_page'] = currentPage;
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ export default
|
|||||||
scope[set] = []; //clear the list array to make sure 'Loading' is the only thing visible on the list
|
scope[set] = []; //clear the list array to make sure 'Loading' is the only thing visible on the list
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scope[iterator + 'SearchValue' + modifier] && scope[iterator + 'SearchValue' + modifier] != '') {
|
if(scope[iterator + 'SearchValue' + modifier] && scope[iterator + 'SearchValue' + modifier] !== '') {
|
||||||
scope[iterator + '_active_search'] = true;
|
scope[iterator + '_active_search'] = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -92,4 +92,4 @@ export default['$scope', '$rootScope', '$compile', '$location',
|
|||||||
'$log', '$stateParams', 'InventoryForm', 'GenerateForm', 'Rest', 'Alert',
|
'$log', '$stateParams', 'InventoryForm', 'GenerateForm', 'Rest', 'Alert',
|
||||||
'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList',
|
'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList',
|
||||||
'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit',
|
'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit',
|
||||||
'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', '$state', InventoriesAdd]
|
'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', '$state', InventoriesAdd];
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import route from './inventory-add.route';
|
import route from './inventory-add.route';
|
||||||
import controller from './inventory-add.controller';
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('inventoryAdd', [])
|
angular.module('inventoryAdd', [])
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import route from './inventory-edit.route';
|
import route from './inventory-edit.route';
|
||||||
import controller from './inventory-edit.controller';
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('inventoryEdit', [])
|
angular.module('inventoryEdit', [])
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import route from './inventory-list.route';
|
import route from './inventory-list.route';
|
||||||
import controller from './inventory-list.controller';
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('inventoryList', [])
|
angular.module('inventoryList', [])
|
||||||
|
|||||||
@@ -3,18 +3,21 @@ function CopyGroupsCtrl($compile, $state, $scope, $location, Rest, ProcessErrors
|
|||||||
var vm = this;
|
var vm = this;
|
||||||
var name;
|
var name;
|
||||||
|
|
||||||
var params = ParamPass.get();
|
var params = ParamPass.get(),
|
||||||
|
group_id,
|
||||||
|
parent_scope,
|
||||||
|
scope;
|
||||||
|
|
||||||
if (params !== undefined) {
|
if (params !== undefined) {
|
||||||
var group_id = $state.params.group_id,
|
group_id = $state.params.group_id;
|
||||||
parent_scope = params.scope,
|
parent_scope = params.scope;
|
||||||
scope = parent_scope.$new(),
|
scope = parent_scope.$new();
|
||||||
parent_group = parent_scope.selected_group_id,
|
var parent_group = parent_scope.selected_group_id,
|
||||||
url, group;
|
url, group;
|
||||||
} else {
|
} else {
|
||||||
var group_id = $state.params.group_id;
|
group_id = $state.params.group_id;
|
||||||
var parent_scope = $scope.$new();
|
parent_scope = $scope.$new();
|
||||||
var scope = parent_scope.$new();
|
scope = parent_scope.$new();
|
||||||
}
|
}
|
||||||
|
|
||||||
var inventory_id = $state.params.inventory_id;
|
var inventory_id = $state.params.inventory_id;
|
||||||
@@ -132,7 +135,7 @@ function CopyGroupsCtrl($compile, $state, $scope, $location, Rest, ProcessErrors
|
|||||||
});
|
});
|
||||||
$scope.refreshHostsOnGroupRefresh = true;
|
$scope.refreshHostsOnGroupRefresh = true;
|
||||||
//$scope.search(InventoryGroups.iterator, null, true, false, true);
|
//$scope.search(InventoryGroups.iterator, null, true, false, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
var cancel = function() {
|
var cancel = function() {
|
||||||
restoreSearch(); // Restore all parent search stuff and refresh hosts and groups lists
|
restoreSearch(); // Restore all parent search stuff and refresh hosts and groups lists
|
||||||
@@ -296,7 +299,7 @@ function CopyGroupsCtrl($compile, $state, $scope, $location, Rest, ProcessErrors
|
|||||||
name: name,
|
name: name,
|
||||||
allowSave: allowSave
|
allowSave: allowSave
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
export default ['$compile', '$state', '$scope', '$location', 'Rest', 'ProcessErrors', 'CreateDialog', 'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
|
export default ['$compile', '$state', '$scope', '$location', 'Rest', 'ProcessErrors', 'CreateDialog', 'GetBasePath', 'Wait', 'generateList', 'GroupList', 'SearchInit',
|
||||||
'PaginateInit', 'GetRootGroups', 'ParamPass', 'Store', CopyGroupsCtrl
|
'PaginateInit', 'GetRootGroups', 'ParamPass', 'Store', CopyGroupsCtrl
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ function CopyHostsCtrl($compile, $state, $scope, Rest, ProcessErrors, CreateDial
|
|||||||
|
|
||||||
var host_id = $state.params.host_id;
|
var host_id = $state.params.host_id;
|
||||||
var inventory_id = $state.params.inventory_id;
|
var inventory_id = $state.params.inventory_id;
|
||||||
var url, host;
|
var url, host, group_scope, parent_scope, scope, parent_group;
|
||||||
|
|
||||||
var params = ParamPass.get();
|
var params = ParamPass.get();
|
||||||
if (params !== undefined) {
|
if (params !== undefined) {
|
||||||
var group_scope = params.group_scope,
|
group_scope = params.group_scope;
|
||||||
parent_scope = params.host_scope,
|
parent_scope = params.host_scope;
|
||||||
parent_group = group_scope.selected_group_id,
|
parent_group = group_scope.selected_group_id;
|
||||||
scope = parent_scope.$new();
|
scope = parent_scope.$new();
|
||||||
} else {
|
} else {
|
||||||
var group_scope = $scope.$new();
|
group_scope = $scope.$new();
|
||||||
var parent_scope = $scope.$new();
|
parent_scope = $scope.$new();
|
||||||
var scope = parent_scope.$new();
|
scope = parent_scope.$new();
|
||||||
}
|
}
|
||||||
|
|
||||||
var PreviousSearchParams = Store('group_current_search_params');
|
var PreviousSearchParams = Store('group_current_search_params');
|
||||||
@@ -91,6 +91,21 @@ function CopyHostsCtrl($compile, $state, $scope, Rest, ProcessErrors, CreateDial
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var restoreSearch = function() {
|
||||||
|
// Restore search params and related stuff, plus refresh
|
||||||
|
// groups and hosts lists
|
||||||
|
SearchInit({
|
||||||
|
scope: $scope,
|
||||||
|
set: PreviousSearchParams.set,
|
||||||
|
list: PreviousSearchParams.list,
|
||||||
|
url: PreviousSearchParams.defaultUrl,
|
||||||
|
iterator: PreviousSearchParams.iterator,
|
||||||
|
sort_order: PreviousSearchParams.sort_order,
|
||||||
|
setWidgets: false
|
||||||
|
});
|
||||||
|
$scope.refreshHostsOnGroupRefresh = true;
|
||||||
|
};
|
||||||
|
|
||||||
var cancel = function() {
|
var cancel = function() {
|
||||||
$(document).off("keydown");
|
$(document).off("keydown");
|
||||||
restoreSearch(); // Restore all parent search stuff and refresh hosts and groups lists
|
restoreSearch(); // Restore all parent search stuff and refresh hosts and groups lists
|
||||||
@@ -129,21 +144,6 @@ function CopyHostsCtrl($compile, $state, $scope, Rest, ProcessErrors, CreateDial
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var restoreSearch = function() {
|
|
||||||
// Restore search params and related stuff, plus refresh
|
|
||||||
// groups and hosts lists
|
|
||||||
SearchInit({
|
|
||||||
scope: $scope,
|
|
||||||
set: PreviousSearchParams.set,
|
|
||||||
list: PreviousSearchParams.list,
|
|
||||||
url: PreviousSearchParams.defaultUrl,
|
|
||||||
iterator: PreviousSearchParams.iterator,
|
|
||||||
sort_order: PreviousSearchParams.sort_order,
|
|
||||||
setWidgets: false
|
|
||||||
});
|
|
||||||
$scope.refreshHostsOnGroupRefresh = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
var performCopy = function() {
|
var performCopy = function() {
|
||||||
var list = GroupList,
|
var list = GroupList,
|
||||||
target,
|
target,
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ function inventoryManageCopyCtrl($state) {
|
|||||||
var cancelPanel = function() {
|
var cancelPanel = function() {
|
||||||
$state.go('inventoryManage', {}, {
|
$state.go('inventoryManage', {}, {
|
||||||
reload: true
|
reload: true
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
angular.extend(vm, {
|
angular.extend(vm, {
|
||||||
cancelPanel: cancelPanel
|
cancelPanel: cancelPanel
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
export default ['$state', inventoryManageCopyCtrl
|
export default ['$state', inventoryManageCopyCtrl
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
|||||||
inventory_id: $scope.inventory.id,
|
inventory_id: $scope.inventory.id,
|
||||||
group_id: $scope.selected_group_id,
|
group_id: $scope.selected_group_id,
|
||||||
mode: 'add'
|
mode: 'add'
|
||||||
}
|
};
|
||||||
ParamPass.set(params);
|
ParamPass.set(params);
|
||||||
$state.go('inventoryManage.addGroup');
|
$state.go('inventoryManage.addGroup');
|
||||||
};
|
};
|
||||||
@@ -354,7 +354,7 @@ function InventoriesManage($log, $scope, $rootScope, $location,
|
|||||||
inventory_id: $scope.inventory.id,
|
inventory_id: $scope.inventory.id,
|
||||||
group_id: id,
|
group_id: id,
|
||||||
mode: 'edit'
|
mode: 'edit'
|
||||||
}
|
};
|
||||||
ParamPass.set(params);
|
ParamPass.set(params);
|
||||||
$state.go('inventoryManage.editGroup', {group_id: id});
|
$state.go('inventoryManage.editGroup', {group_id: id});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,12 +60,14 @@ function manageGroupsDirectiveController($filter, $location, $log,
|
|||||||
|
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
|
|
||||||
generator.inject(form, {
|
var form_scope =
|
||||||
mode: mode,
|
generator.inject(GroupForm, {
|
||||||
id: 'group-manage-panel',
|
mode: mode,
|
||||||
tabs: true,
|
id: 'properties-tab',
|
||||||
scope: $scope
|
related: false,
|
||||||
});
|
scope: properties_scope,
|
||||||
|
cancelButton: false,
|
||||||
|
});
|
||||||
|
|
||||||
generator.reset();
|
generator.reset();
|
||||||
|
|
||||||
@@ -74,13 +76,13 @@ function manageGroupsDirectiveController($filter, $location, $log,
|
|||||||
variable: 'source_type_options'
|
variable: 'source_type_options'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.source = form.fields.source['default'];
|
$scope.source = form.fields.source['default'];
|
||||||
$scope.sourcePathRequired = false;
|
$scope.sourcePathRequired = false;
|
||||||
$scope[form.fields.source_vars.parseTypeName] = 'yaml';
|
$scope[form.fields.source_vars.parseTypeName] = 'yaml';
|
||||||
$scope.update_cache_timeout = 0;
|
$scope.update_cache_timeout = 0;
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
|
|
||||||
|
|
||||||
function initSourceChange() {
|
function initSourceChange() {
|
||||||
$scope.showSchedulesTab = (mode === 'edit' && $scope.source && $scope.source.value !== "manual") ? true : false;
|
$scope.showSchedulesTab = (mode === 'edit' && $scope.source && $scope.source.value !== "manual") ? true : false;
|
||||||
SourceChange({
|
SourceChange({
|
||||||
@@ -144,7 +146,7 @@ function manageGroupsDirectiveController($filter, $location, $log,
|
|||||||
master.source_vars = $scope.variables;
|
master.source_vars = $scope.variables;
|
||||||
} else if (fld === "inventory_script") {
|
} else if (fld === "inventory_script") {
|
||||||
// the API stores it as 'source_script', we call it inventory_script
|
// the API stores it as 'source_script', we call it inventory_script
|
||||||
data.summary_fields['inventory_script'] = data.summary_fields.source_script;
|
data.summary_fields.inventory_script = data.summary_fields.source_script;
|
||||||
$scope.inventory_script = data.source_script;
|
$scope.inventory_script = data.source_script;
|
||||||
master.inventory_script = $scope.inventory_script;
|
master.inventory_script = $scope.inventory_script;
|
||||||
} else if (fld === "source_regions") {
|
} else if (fld === "source_regions") {
|
||||||
|
|||||||
Reference in New Issue
Block a user