mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
Added 'working' spinner to all save/delete/select actions. This is to compensate for places where activity log is slowing down the API. AC-646 changes Rackspace credentials to show API Key in place of password. Fixed a bug on machine credential that caused username to not be passed to the API when adding and editing.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
|
function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices)
|
ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -86,14 +86,17 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
scope.deleteCredential = function(id, name) {
|
scope.deleteCredential = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -109,7 +112,7 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
|
|
||||||
CredentialsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'CredentialList', 'GenerateList',
|
CredentialsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'CredentialList', 'GenerateList',
|
||||||
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||||
'GetBasePath', 'SelectionInit', 'GetChoices'];
|
'GetBasePath', 'SelectionInit', 'GetChoices', 'Wait' ];
|
||||||
|
|
||||||
|
|
||||||
function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm,
|
function CredentialsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm,
|
||||||
@@ -360,14 +363,16 @@ function CredentialsEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
master['secret_key'] = scope['secret_key'];
|
master['secret_key'] = scope['secret_key'];
|
||||||
break;
|
break;
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
scope['ssh_username'] = data.username;
|
|
||||||
scope['ssh_password'] = data.password;
|
scope['ssh_password'] = data.password;
|
||||||
master['ssh_username'] = scope['ssh_username'];
|
|
||||||
master['ssh_password'] = scope['ssh_password'];
|
master['ssh_password'] = scope['ssh_password'];
|
||||||
break;
|
break;
|
||||||
case 'scm':
|
case 'scm':
|
||||||
scope['scm_key_unlock'] = data['ssh_key_unlock'];
|
scope['scm_key_unlock'] = data['ssh_key_unlock'];
|
||||||
break;
|
break;
|
||||||
|
case 'rax':
|
||||||
|
scope['api_key'] = data['password'];
|
||||||
|
master['api_key'] = scope['api_key'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.$emit('credentialLoaded');
|
scope.$emit('credentialLoaded');
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
scope.deleteInventory = function(id, name) {
|
scope.deleteInventory = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
Wait('start');
|
Wait('start');
|
||||||
@@ -207,7 +208,7 @@ InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$route
|
|||||||
function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
||||||
GenerateList, OrganizationList, SearchInit, PaginateInit, LookUpInit, GetBasePath,
|
GenerateList, OrganizationList, SearchInit, PaginateInit, LookUpInit, GetBasePath,
|
||||||
ParseTypeChange)
|
ParseTypeChange, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -239,6 +240,7 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
try {
|
try {
|
||||||
// Make sure we have valid variable data
|
// Make sure we have valid variable data
|
||||||
if (scope.inventoryParseType == 'json') {
|
if (scope.inventoryParseType == 'json') {
|
||||||
@@ -273,23 +275,28 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
Rest.setUrl(data.related.variable_data);
|
Rest.setUrl(data.related.variable_data);
|
||||||
Rest.put(json_data)
|
Rest.put(json_data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$location.path('/inventories/' + inventory_id + '/groups');
|
$location.path('/inventories/' + inventory_id + '/groups');
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add inventory varaibles. PUT returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add inventory varaibles. PUT returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Wait('stop');
|
||||||
$location.path('/inventories/' + inventory_id + '/groups');
|
$location.path('/inventories/' + inventory_id + '/groups');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new inventory. Post returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new inventory. Post returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing inventory variables. Parser returned: " + err);
|
Alert("Error", "Error parsing inventory variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,13 +311,14 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
|
|
||||||
InventoriesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
InventoriesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList',
|
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList',
|
||||||
'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange'];
|
'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait'];
|
||||||
|
|
||||||
|
|
||||||
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, OrganizationList,
|
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, OrganizationList,
|
||||||
GetBasePath, LoadInventory, ParseTypeChange, EditInventory, SaveInventory, PostLoadInventory)
|
GetBasePath, LoadInventory, ParseTypeChange, EditInventory, SaveInventory, PostLoadInventory
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList,
|
function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, GetBasePath, PromptPasswords, JobTemplateForm, CredentialList,
|
ClearScope, ProcessErrors, GetBasePath, PromptPasswords, JobTemplateForm, CredentialList,
|
||||||
LookUpInit, SubmitJob)
|
LookUpInit, SubmitJob, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -49,14 +49,17 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
|||||||
|
|
||||||
scope.deleteJobTemplate = function(id, name) {
|
scope.deleteJobTemplate = function(id, name) {
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -77,13 +80,13 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
|||||||
JobTemplatesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobTemplateList',
|
JobTemplatesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobTemplateList',
|
||||||
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
|
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
|
||||||
'ProcessErrors','GetBasePath', 'PromptPasswords', 'JobTemplateForm', 'CredentialList', 'LookUpInit',
|
'ProcessErrors','GetBasePath', 'PromptPasswords', 'JobTemplateForm', 'CredentialList', 'LookUpInit',
|
||||||
'SubmitJob'
|
'SubmitJob', 'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
||||||
GetBasePath, InventoryList, CredentialList, ProjectList, LookUpInit,
|
GetBasePath, InventoryList, CredentialList, ProjectList, LookUpInit,
|
||||||
md5Setup, ParseTypeChange)
|
md5Setup, ParseTypeChange, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -224,6 +227,7 @@ function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var data = {}
|
var data = {}
|
||||||
try {
|
try {
|
||||||
// Make sure we have valid variable data
|
// Make sure we have valid variable data
|
||||||
@@ -258,16 +262,19 @@ function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'job_templates') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'job_templates') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new job template. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new job template. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing extra variables. Parser returned: " + err);
|
Alert("Error", "Error parsing extra variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -286,14 +293,14 @@ function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
JobTemplatesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm',
|
JobTemplatesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope',
|
||||||
'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit',
|
'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit',
|
||||||
'md5Setup', 'ParseTypeChange' ];
|
'md5Setup', 'ParseTypeChange', 'Wait'];
|
||||||
|
|
||||||
|
|
||||||
function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, CredentialList,
|
RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, CredentialList,
|
||||||
ProjectList, LookUpInit, PromptPasswords, GetBasePath, md5Setup, ParseTypeChange,
|
ProjectList, LookUpInit, PromptPasswords, GetBasePath, md5Setup, ParseTypeChange,
|
||||||
JobStatusToolTip, FormatDate)
|
JobStatusToolTip, FormatDate, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -530,6 +537,7 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var data = {}
|
var data = {}
|
||||||
try {
|
try {
|
||||||
// Make sure we have valid variable data
|
// Make sure we have valid variable data
|
||||||
@@ -564,16 +572,19 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'job_templates') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'job_templates') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update job template. PUT returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update job template. PUT returned status: ' + status });
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing extra variables. Parser returned: " + err);
|
Alert("Error", "Error parsing extra variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -631,5 +642,5 @@ JobTemplatesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$
|
|||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList',
|
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList',
|
||||||
'ProjectList', 'LookUpInit', 'PromptPasswords', 'GetBasePath', 'md5Setup', 'ParseTypeChange',
|
'ProjectList', 'LookUpInit', 'PromptPasswords', 'GetBasePath', 'md5Setup', 'ParseTypeChange',
|
||||||
'JobStatusToolTip', 'FormatDate'
|
'JobStatusToolTip', 'FormatDate', 'Wait'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -49,14 +49,17 @@ function OrganizationsList ($routeParams, $scope, $rootScope, $location, $log, R
|
|||||||
scope.deleteOrganization = function(id, name) {
|
scope.deleteOrganization = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -77,7 +80,7 @@ OrganizationsList.$inject=[ '$routeParams', '$scope', '$rootScope', '$location',
|
|||||||
|
|
||||||
function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
|
||||||
ReturnToCaller)
|
ReturnToCaller, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -94,12 +97,14 @@ function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
form.clearApiErrors();
|
form.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var url = GetBasePath(base);
|
var url = GetBasePath(base);
|
||||||
url += (base != 'organizations') ? $routeParams['project_id'] + '/organizations/' : '';
|
url += (base != 'organizations') ? $routeParams['project_id'] + '/organizations/' : '';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post({ name: $scope.name,
|
Rest.post({ name: $scope.name,
|
||||||
description: $scope.description })
|
description: $scope.description })
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
if (base == 'organizations') {
|
if (base == 'organizations') {
|
||||||
$rootScope.flashMessage = "New organization successfully created!";
|
$rootScope.flashMessage = "New organization successfully created!";
|
||||||
$location.path('/organizations/' + data.id);
|
$location.path('/organizations/' + data.id);
|
||||||
@@ -109,6 +114,7 @@ function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, OrganizationForm,
|
ProcessErrors(scope, data, status, OrganizationForm,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new organization. Post returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new organization. Post returned status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -123,12 +129,12 @@ function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
|
|
||||||
OrganizationsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm',
|
OrganizationsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
||||||
'ReturnToCaller' ];
|
'ReturnToCaller', 'Wait'];
|
||||||
|
|
||||||
|
|
||||||
function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, Prompt, ClearScope, GetBasePath)
|
RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -186,6 +192,7 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var params = {};
|
var params = {};
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
params[fld] = scope[fld];
|
params[fld] = scope[fld];
|
||||||
@@ -193,10 +200,12 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
master = params;
|
master = params;
|
||||||
$rootScope.flashMessage = "Your changes were successfully saved!";
|
$rootScope.flashMessage = "Your changes were successfully saved!";
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, OrganizationForm,
|
ProcessErrors(scope, data, status, OrganizationForm,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update organization: ' + id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update organization: ' + id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -228,14 +237,17 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
|
|||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + $routeParams.organization_id + '/' + set + '/';
|
var url = defaultUrl + $routeParams.organization_id + '/' + set + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post({ id: itm_id, disassociate: 1 })
|
Rest.post({ id: itm_id, disassociate: 1 })
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(form.related[set].iterator);
|
scope.search(form.related[set].iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST returned status: ' + status });
|
||||||
@@ -252,4 +264,4 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
|
|||||||
|
|
||||||
OrganizationsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm',
|
OrganizationsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'OrganizationForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath'];
|
'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', 'Wait'];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
|
function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, GetBasePath, CheckAccess)
|
ClearScope, ProcessErrors, GetBasePath, CheckAccess, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -35,14 +35,17 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
|
|
||||||
scope.deletePermission = function(id, name) {
|
scope.deletePermission = function(id, name) {
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = GetBasePath('base') + 'permissions/' + id + '/';
|
var url = GetBasePath('base') + 'permissions/' + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -60,13 +63,14 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
|
|
||||||
PermissionsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'PermissionList',
|
PermissionsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'PermissionList',
|
||||||
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller',
|
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller',
|
||||||
'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess'
|
'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess', 'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
||||||
GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess)
|
GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess,
|
||||||
|
Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -110,6 +114,7 @@ function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
if (scope.PermissionAddAllowed) {
|
if (scope.PermissionAddAllowed) {
|
||||||
var data = {};
|
var data = {};
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
@@ -119,9 +124,11 @@ function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ReturnToCaller(1);
|
ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, PermissionsForm,
|
ProcessErrors(scope, data, status, PermissionsForm,
|
||||||
{ hdr: 'Error!', msg: 'Failed to create new permission. Post returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to create new permission. Post returned status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -153,13 +160,14 @@ function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
|
|
||||||
PermissionsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'PermissionsForm',
|
PermissionsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'PermissionsForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
||||||
'ReturnToCaller', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess'
|
'ReturnToCaller', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller,
|
||||||
ClearScope, Prompt, GetBasePath, InventoryList, ProjectList, LookUpInit, CheckAccess)
|
ClearScope, Prompt, GetBasePath, InventoryList, ProjectList, LookUpInit, CheckAccess,
|
||||||
|
Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -247,6 +255,7 @@ function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var data = {}
|
var data = {}
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
data[fld] = scope[fld];
|
data[fld] = scope[fld];
|
||||||
@@ -254,9 +263,11 @@ function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ReturnToCaller(1);
|
ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update Permission: ' + $routeParams.id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update Permission: ' + $routeParams.id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -286,6 +297,7 @@ function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
PermissionsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'PermissionsForm',
|
PermissionsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'PermissionsForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
|
||||||
'ClearScope', 'Prompt', 'GetBasePath', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess'
|
'ClearScope', 'Prompt', 'GetBasePath', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess',
|
||||||
|
'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList,
|
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate, ProjectStatus,
|
ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate, ProjectStatus,
|
||||||
FormatDate, Refresh)
|
FormatDate, Refresh, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -112,14 +112,17 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
scope.deleteProject = function(id, name) {
|
scope.deleteProject = function(id, name) {
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -225,13 +228,13 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
|
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
|
||||||
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||||
'GetBasePath', 'SelectionInit', 'ProjectUpdate', 'ProjectStatus', 'FormatDate', 'Refresh' ];
|
'GetBasePath', 'SelectionInit', 'ProjectUpdate', 'ProjectStatus', 'FormatDate', 'Refresh', 'Wait' ];
|
||||||
|
|
||||||
|
|
||||||
function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,
|
function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
||||||
GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList,
|
GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList,
|
||||||
CredentialList, GetChoices, DebugForm)
|
CredentialList, GetChoices, DebugForm, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -291,6 +294,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
var data = {};
|
var data = {};
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
if (form.fields[fld].type == 'checkbox_group') {
|
if (form.fields[fld].type == 'checkbox_group') {
|
||||||
@@ -322,6 +326,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post(org)
|
Rest.post(org)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$rootScope.flashMessage = "New project successfully created!";
|
$rootScope.flashMessage = "New project successfully created!";
|
||||||
(base == 'projects') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'projects') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
@@ -331,6 +336,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, ProjectsForm,
|
ProcessErrors(scope, data, status, ProjectsForm,
|
||||||
{ hdr: 'Error!', msg: 'Failed to create new project. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to create new project. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -357,14 +363,14 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
ProjectsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'ProjectsForm',
|
ProjectsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'ProjectsForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
|
||||||
'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices',
|
'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices',
|
||||||
'DebugForm'
|
'DebugForm', 'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,
|
function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, Prompt, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath,
|
RelatedPaginateInit, Prompt, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath,
|
||||||
Authorization, CredentialList, LookUpInit, GetChoices, Empty, DebugForm)
|
Authorization, CredentialList, LookUpInit, GetChoices, Empty, DebugForm, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -499,6 +505,7 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
var params = {};
|
var params = {};
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
@@ -525,9 +532,11 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ReturnToCaller();
|
ReturnToCaller();
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -591,5 +600,5 @@ ProjectsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log'
|
|||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', 'ReturnToCaller',
|
'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', 'ReturnToCaller',
|
||||||
'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty',
|
'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty',
|
||||||
'DebugForm'
|
'DebugForm', 'Wait'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList,
|
function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit)
|
ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -56,14 +56,17 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
|||||||
scope.deleteTeam = function(id, name) {
|
scope.deleteTeam = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -90,12 +93,12 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
|||||||
|
|
||||||
TeamsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'TeamList', 'GenerateList',
|
TeamsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'TeamList', 'GenerateList',
|
||||||
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||||
'SetTeamListeners', 'GetBasePath', 'SelectionInit'];
|
'SetTeamListeners', 'GetBasePath', 'SelectionInit', 'Wait'];
|
||||||
|
|
||||||
|
|
||||||
function TeamsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm,
|
function TeamsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm, GenerateForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList,
|
||||||
GenerateList, OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit)
|
OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -120,6 +123,7 @@ function TeamsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
var data = {}
|
var data = {}
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
@@ -127,10 +131,12 @@ function TeamsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
}
|
}
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$rootScope.flashMessage = "New team successfully created!";
|
$rootScope.flashMessage = "New team successfully created!";
|
||||||
$location.path('/teams/' + data.id);
|
$location.path('/teams/' + data.id);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new team. Post returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new team. Post returned status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -145,13 +151,13 @@ function TeamsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
|
|
||||||
TeamsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm', 'GenerateForm',
|
TeamsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList',
|
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList',
|
||||||
'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', 'LookUpInit' ];
|
'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', 'LookUpInit', 'Wait'];
|
||||||
|
|
||||||
|
|
||||||
function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm,
|
function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt,
|
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt,
|
||||||
GetBasePath, CheckAccess, OrganizationList)
|
GetBasePath, CheckAccess, OrganizationList, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -230,6 +236,7 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
Rest.setUrl(defaultUrl + $routeParams.team_id +'/');
|
Rest.setUrl(defaultUrl + $routeParams.team_id +'/');
|
||||||
var data = {}
|
var data = {}
|
||||||
@@ -238,10 +245,12 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
}
|
}
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'teams') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'teams') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update team: ' + $routeParams.team_id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update team: ' + $routeParams.team_id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -335,6 +344,6 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
TeamsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm',
|
TeamsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt',
|
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt',
|
||||||
'GetBasePath', 'CheckAccess', 'OrganizationList'
|
'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, UserList,
|
||||||
Alert, UserList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit)
|
ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -47,14 +47,17 @@ function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
scope.deleteUser = function(id, name) {
|
scope.deleteUser = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
|
Wait('start')
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
@@ -70,12 +73,12 @@ function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
UsersList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'UserList', 'GenerateList',
|
UsersList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'UserList', 'GenerateList',
|
||||||
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
|
||||||
'GetBasePath', 'SelectionInit'];
|
'GetBasePath', 'SelectionInit', 'Wait' ];
|
||||||
|
|
||||||
|
|
||||||
function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm,
|
function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
||||||
GetBasePath, LookUpInit, OrganizationList, ResetForm)
|
GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -121,6 +124,7 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
// Save
|
// Save
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
if (scope.organization !== undefined && scope.organization !== null && scope.organization !== '') {
|
if (scope.organization !== undefined && scope.organization !== null && scope.organization !== '') {
|
||||||
Rest.setUrl(defaultUrl + scope.organization + '/users/');
|
Rest.setUrl(defaultUrl + scope.organization + '/users/');
|
||||||
var data = {}
|
var data = {}
|
||||||
@@ -138,6 +142,7 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
|
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
if (base == 'users') {
|
if (base == 'users') {
|
||||||
$rootScope.flashMessage = 'New user successfully created!';
|
$rootScope.flashMessage = 'New user successfully created!';
|
||||||
@@ -148,6 +153,7 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new user. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new user. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -174,12 +180,13 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
|
|
||||||
UsersAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm', 'GenerateForm',
|
UsersAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GetBasePath',
|
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GetBasePath',
|
||||||
'LookUpInit', 'OrganizationList', 'ResetForm' ];
|
'LookUpInit', 'OrganizationList', 'ResetForm', 'Wait' ];
|
||||||
|
|
||||||
|
|
||||||
function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm,
|
function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath, Prompt, CheckAccess, ResetForm)
|
RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath, Prompt, CheckAccess,
|
||||||
|
ResetForm, Wait)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -252,6 +259,7 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
generator.clearApiErrors();
|
generator.clearApiErrors();
|
||||||
|
Wait('start');
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = {}
|
var data = {}
|
||||||
@@ -269,10 +277,12 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
|
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'users') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'users') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update users: ' + $routeParams.id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update users: ' + $routeParams.id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -425,5 +435,5 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
UsersEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm',
|
UsersEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'UserForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'Prompt', 'CheckAccess',
|
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'Prompt', 'CheckAccess',
|
||||||
'ResetForm' ];
|
'ResetForm', 'Wait' ];
|
||||||
|
|
||||||
|
|||||||
@@ -114,11 +114,22 @@ angular.module('CredentialFormDefinition', [])
|
|||||||
awRequiredWhen: {variable: 'rackspace_required', init: false },
|
awRequiredWhen: {variable: 'rackspace_required', init: false },
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
|
"api_key": {
|
||||||
|
label: 'API Key',
|
||||||
|
type: 'password',
|
||||||
|
ngShow: "kind.value == 'rax'",
|
||||||
|
awRequiredWhen: { variable: "rackspace_required", init: false },
|
||||||
|
autocomplete: false,
|
||||||
|
ask: false,
|
||||||
|
clear: false,
|
||||||
|
apiField: 'passwowrd'
|
||||||
|
},
|
||||||
"password": {
|
"password": {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
ngShow: "kind.value == 'rax' || kind.value == 'scm'",
|
ngShow: "kind.value == 'scm'",
|
||||||
awRequiredWhen: {variable: 'rackspace_required', init: false },
|
addRequired: false,
|
||||||
|
editRequired: false,
|
||||||
ngChange: "clearPWConfirm('password_confirm')",
|
ngChange: "clearPWConfirm('password_confirm')",
|
||||||
ask: false,
|
ask: false,
|
||||||
clear: false,
|
clear: false,
|
||||||
@@ -128,7 +139,7 @@ angular.module('CredentialFormDefinition', [])
|
|||||||
"password_confirm": {
|
"password_confirm": {
|
||||||
label: 'Confirm Password',
|
label: 'Confirm Password',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
ngShow: "kind.value == 'rax' || kind.value == 'scm'",
|
ngShow: "kind.value == 'scm'",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
awPassMatch: true,
|
awPassMatch: true,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
if (reset) {
|
if (reset) {
|
||||||
scope['access_key'] = null;
|
scope['access_key'] = null;
|
||||||
scope['secret_key'] = null;
|
scope['secret_key'] = null;
|
||||||
|
scope['api_key'] = null;
|
||||||
scope['username'] = null;
|
scope['username'] = null;
|
||||||
scope['password'] = null;
|
scope['password'] = null;
|
||||||
scope['password_confirm'] = null;
|
scope['password_confirm'] = null;
|
||||||
@@ -94,14 +95,16 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
|
|
||||||
.factory('FormSave', ['$location', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller',
|
.factory('FormSave', ['$location', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller', 'Wait',
|
||||||
function($location, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller) {
|
function($location, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope;
|
var scope = params.scope;
|
||||||
var mode = params.mode; // add or edit
|
var mode = params.mode; // add or edit
|
||||||
var form = CredentialForm;
|
var form = CredentialForm;
|
||||||
var data = {}
|
var data = {}
|
||||||
|
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
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') {
|
||||||
@@ -127,7 +130,6 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
|
|
||||||
switch (data['kind']) {
|
switch (data['kind']) {
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
data['username'] = scope['ssh_username'];
|
|
||||||
data['password'] = scope['ssh_password'];
|
data['password'] = scope['ssh_password'];
|
||||||
break;
|
break;
|
||||||
case 'aws':
|
case 'aws':
|
||||||
@@ -137,6 +139,9 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
case 'scm':
|
case 'scm':
|
||||||
data['ssh_key_unlock'] = scope['scm_key_unlock'];
|
data['ssh_key_unlock'] = scope['scm_key_unlock'];
|
||||||
break;
|
break;
|
||||||
|
case 'rax':
|
||||||
|
data['password'] = scope['api_key'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Empty(data.team) && Empty(data.user)) {
|
if (Empty(data.team) && Empty(data.user)) {
|
||||||
@@ -150,10 +155,12 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'credentials') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'credentials') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to create new Credential. POST status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to create new Credential. POST status: ' + status });
|
||||||
});
|
});
|
||||||
@@ -163,10 +170,12 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
(base == 'credentials') ? ReturnToCaller() : ReturnToCaller(1);
|
(base == 'credentials') ? ReturnToCaller() : ReturnToCaller(1);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update Credential. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update Credential. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -564,9 +564,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
.factory('GroupsAdd', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
.factory('GroupsAdd', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'ParseTypeChange', 'GroupsEdit', 'BuildTree', 'ClickNode',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'ParseTypeChange', 'GroupsEdit', 'BuildTree', 'ClickNode', 'Wait',
|
||||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
function($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
||||||
GetBasePath, ParseTypeChange, GroupsEdit, BuildTree, ClickNode) {
|
GetBasePath, ParseTypeChange, GroupsEdit, BuildTree, ClickNode, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var inventory_id = params.inventory_id;
|
var inventory_id = params.inventory_id;
|
||||||
@@ -603,6 +603,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
|
|
||||||
// Save
|
// Save
|
||||||
scope.formModalAction = function() {
|
scope.formModalAction = function() {
|
||||||
|
Wait('start');
|
||||||
try {
|
try {
|
||||||
scope.formModalActionDisabled = true;
|
scope.formModalActionDisabled = true;
|
||||||
|
|
||||||
@@ -638,6 +639,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
groupCreated = true;
|
groupCreated = true;
|
||||||
scope.formModalActionDisabled = false;
|
scope.formModalActionDisabled = false;
|
||||||
scope.showGroupHelp = false; //get rid of the Hint
|
scope.showGroupHelp = false; //get rid of the Hint
|
||||||
@@ -653,12 +655,14 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
scope.formModalActionDisabled = false;
|
scope.formModalActionDisabled = false;
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new group. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new group. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
scope.formModalActionDisabled = false;
|
scope.formModalActionDisabled = false;
|
||||||
Alert("Error", "Error parsing group variables. Parser returned: " + err);
|
Alert("Error", "Error parsing group variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
@@ -675,10 +679,10 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
|
|
||||||
.factory('GroupsEdit', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
.factory('GroupsEdit', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'SetNodeName', 'ParseTypeChange', 'GetSourceTypeOptions', 'InventoryUpdate',
|
||||||
'GetUpdateIntervalOptions', 'ClickNode', 'LookUpInit', 'CredentialList', 'Empty',
|
'GetUpdateIntervalOptions', 'ClickNode', 'LookUpInit', 'CredentialList', 'Empty', 'Wait',
|
||||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
function($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
||||||
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, GetUpdateIntervalOptions, ClickNode,
|
GetBasePath, SetNodeName, ParseTypeChange, GetSourceTypeOptions, InventoryUpdate, GetUpdateIntervalOptions, ClickNode,
|
||||||
LookUpInit, CredentialList, Empty) {
|
LookUpInit, CredentialList, Empty, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var group_id = params.group_id;
|
var group_id = params.group_id;
|
||||||
@@ -942,6 +946,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
|
|
||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formSave = function() {
|
scope.formSave = function() {
|
||||||
|
Wait('start');
|
||||||
try {
|
try {
|
||||||
var refreshHosts = false;
|
var refreshHosts = false;
|
||||||
|
|
||||||
@@ -967,6 +972,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
if (scope.variables) {
|
if (scope.variables) {
|
||||||
//update group variables
|
//update group variables
|
||||||
Rest.setUrl(scope.variable_url);
|
Rest.setUrl(scope.variable_url);
|
||||||
@@ -979,11 +985,13 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
scope.$emit('formSaveSuccess', data.id);
|
scope.$emit('formSaveSuccess', data.id);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update group: ' + group_id + '. PUT status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update group: ' + group_id + '. PUT status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing group variables. Parser returned: " + err);
|
Alert("Error", "Error parsing group variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -161,9 +161,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
|
|
||||||
|
|
||||||
.factory('HostsAdd', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
.factory('HostsAdd', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'HostForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait',
|
||||||
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) {
|
GetBasePath, HostsReload, ParseTypeChange, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var inventory_id = params.inventory_id;
|
var inventory_id = params.inventory_id;
|
||||||
@@ -202,6 +202,8 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
// Save
|
// Save
|
||||||
scope.formModalAction = function() {
|
scope.formModalAction = function() {
|
||||||
|
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
function finished() {
|
function finished() {
|
||||||
$('#form-modal').modal('hide');
|
$('#form-modal').modal('hide');
|
||||||
scope.$emit('hostsReload');
|
scope.$emit('hostsReload');
|
||||||
@@ -245,15 +247,18 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
finished();
|
finished();
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
scope.formModalActionDisabled = false;
|
scope.formModalActionDisabled = false;
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to add new host. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to add new host. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
scope.formModalActionDisabled = false;
|
scope.formModalActionDisabled = false;
|
||||||
Alert("Error", "Error parsing host variables. Parser returned: " + err);
|
Alert("Error", "Error parsing host variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
@@ -270,9 +275,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',
|
'Prompt', 'ProcessErrors', 'GetBasePath', 'HostsReload', 'ParseTypeChange', 'Wait',
|
||||||
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) {
|
GetBasePath, HostsReload, ParseTypeChange, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var host_id = params.host_id;
|
var host_id = params.host_id;
|
||||||
@@ -366,6 +371,8 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
// Save changes to the parent
|
// Save changes to the parent
|
||||||
scope.formModalAction = function() {
|
scope.formModalAction = function() {
|
||||||
|
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
function finished() {
|
function finished() {
|
||||||
$('#form-modal').modal('hide');
|
$('#form-modal').modal('hide');
|
||||||
if (hostsReload) {
|
if (hostsReload) {
|
||||||
@@ -406,14 +413,17 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
finished();
|
finished();
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update host: ' + host_id + '. PUT returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update host: ' + host_id + '. PUT returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing host variables. Parser returned: " + err);
|
Alert("Error", "Error parsing host variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
|||||||
'LookUpHelper', 'ProjectFormDefinition', 'JobSubmissionHelper', 'GroupFormDefinition', 'GroupsHelper' ])
|
'LookUpHelper', 'ProjectFormDefinition', 'JobSubmissionHelper', 'GroupFormDefinition', 'GroupsHelper' ])
|
||||||
|
|
||||||
.factory('PromptPasswords', ['CredentialForm', 'JobTemplateForm', 'GroupForm', 'ProjectsForm', '$compile', 'Rest', '$location', 'ProcessErrors',
|
.factory('PromptPasswords', ['CredentialForm', 'JobTemplateForm', 'GroupForm', 'ProjectsForm', '$compile', 'Rest', '$location', 'ProcessErrors',
|
||||||
'GetBasePath', 'Alert', 'Empty',
|
'GetBasePath', 'Alert', 'Empty', 'Wait',
|
||||||
function(CredentialForm, JobTemplateForm, ProjectsForm, GroupForm, $compile, Rest, $location, ProcessErrors, GetBasePath, Alert, Empty) {
|
function(CredentialForm, JobTemplateForm, ProjectsForm, GroupForm, $compile, Rest, $location, ProcessErrors, GetBasePath, Alert, Empty,
|
||||||
|
Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var scope = params.scope;
|
var scope = params.scope;
|
||||||
@@ -65,6 +66,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
|||||||
|
|
||||||
scope.startJob = function() {
|
scope.startJob = function() {
|
||||||
$('#password-modal').modal('hide');
|
$('#password-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var pswd = {};
|
var pswd = {};
|
||||||
var value_supplied = false;
|
var value_supplied = false;
|
||||||
$('.password-field').each(function(index) {
|
$('.password-field').each(function(index) {
|
||||||
@@ -77,17 +79,20 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
|||||||
Rest.setUrl(start_url);
|
Rest.setUrl(start_url);
|
||||||
Rest.post(pswd)
|
Rest.post(pswd)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
scope.$emit('UpdateSubmitted','started');
|
scope.$emit('UpdateSubmitted','started');
|
||||||
if (form.name == 'credential') {
|
if (form.name == 'credential') {
|
||||||
navigate(false);
|
navigate(false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'POST to ' + start_url + ' failed with status: ' + status });
|
{ hdr: 'Error!', msg: 'POST to ' + start_url + ' failed with status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Wait('stop');
|
||||||
Alert('No Passwords', 'Required password(s) not provided. The request was not submitted.', 'alert-info');
|
Alert('No Passwords', 'Required password(s) not provided. The request was not submitted.', 'alert-info');
|
||||||
if (form.name == 'credential') {
|
if (form.name == 'credential') {
|
||||||
// No passwords provided, so we can't start the job. Rather than leave the job in a 'new'
|
// No passwords provided, so we can't start the job. Rather than leave the job in a 'new'
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
||||||
|
|
||||||
.factory('SelectionInit', [ 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller',
|
.factory('SelectionInit', [ 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'Wait',
|
||||||
function(Rest, Alert, ProcessErrors, ReturnToCaller) {
|
function(Rest, Alert, ProcessErrors, ReturnToCaller, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
var scope = params.scope; // current scope
|
var scope = params.scope; // current scope
|
||||||
@@ -74,6 +74,8 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
|||||||
scope.queue = [];
|
scope.queue = [];
|
||||||
scope.formModalActionDisabled = true;
|
scope.formModalActionDisabled = true;
|
||||||
|
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
function finished() {
|
function finished() {
|
||||||
scope.selected = [];
|
scope.selected = [];
|
||||||
if (returnToCaller !== undefined) {
|
if (returnToCaller !== undefined) {
|
||||||
@@ -92,6 +94,7 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
|||||||
// We call the API for each selected item. We need to hang out until all the api
|
// We call the API for each selected item. We need to hang out until all the api
|
||||||
// calls are finished.
|
// calls are finished.
|
||||||
if (scope.queue.length == scope.selected.length) {
|
if (scope.queue.length == scope.selected.length) {
|
||||||
|
Wait('stop');
|
||||||
var errors = 0;
|
var errors = 0;
|
||||||
for (var i=0; i < scope.queue.length; i++) {
|
for (var i=0; i < scope.queue.length; i++) {
|
||||||
if (scope.queue[i].result == 'error') {
|
if (scope.queue[i].result == 'error') {
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
.factory('SaveInventory', ['InventoryForm', 'Rest', 'Alert', 'ProcessErrors', 'LookUpInit', 'OrganizationList',
|
.factory('SaveInventory', ['InventoryForm', 'Rest', 'Alert', 'ProcessErrors', 'LookUpInit', 'OrganizationList',
|
||||||
'GetBasePath', 'ParseTypeChange', 'LoadInventory',
|
'GetBasePath', 'ParseTypeChange', 'LoadInventory', 'Wait',
|
||||||
function(InventoryForm, Rest, Alert, ProcessErrors, LookUpInit, OrganizationList, GetBasePath, ParseTypeChange,
|
function(InventoryForm, Rest, Alert, ProcessErrors, LookUpInit, OrganizationList, GetBasePath, ParseTypeChange,
|
||||||
LoadInventory) {
|
LoadInventory, Wait) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
|
|
||||||
// Save inventory property modifications
|
// Save inventory property modifications
|
||||||
@@ -117,6 +117,8 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
|||||||
var form = InventoryForm;
|
var form = InventoryForm;
|
||||||
var defaultUrl=GetBasePath('inventory');
|
var defaultUrl=GetBasePath('inventory');
|
||||||
|
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Make sure we have valid variable data
|
// Make sure we have valid variable data
|
||||||
if (scope.inventoryParseType == 'json') {
|
if (scope.inventoryParseType == 'json') {
|
||||||
@@ -150,6 +152,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
|||||||
Rest.setUrl(data.related.variable_data);
|
Rest.setUrl(data.related.variable_data);
|
||||||
Rest.put(json_data)
|
Rest.put(json_data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
scope.$emit('inventorySaved');
|
scope.$emit('inventorySaved');
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
@@ -162,11 +165,13 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
|
Wait('stop');
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
{ hdr: 'Error!', msg: 'Failed to update inventory. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Failed to update inventory. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
|
Wait('stop');
|
||||||
Alert("Error", "Error parsing inventory variables. Parser returned: " + err);
|
Alert("Error", "Error parsing inventory variables. Parser returned: " + err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
// Add a container for the stream widget
|
// Add a container for the stream widget
|
||||||
$('#tab-content-container').append('<div id="stream-container"><div id=\"stream-content\"></div></div><!-- Stream widget -->');
|
$('#tab-content-container').append('<div id="stream-container"><div id=\"stream-content\"></div></div><!-- Stream widget -->');
|
||||||
|
|
||||||
|
ShowStream();
|
||||||
|
|
||||||
// Generate the list
|
// Generate the list
|
||||||
var scope = view.inject(list, {
|
var scope = view.inject(list, {
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
@@ -257,7 +259,6 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
}
|
}
|
||||||
scope['activities'][i].description = BuildDescription(scope['activities'][i]);
|
scope['activities'][i].description = BuildDescription(scope['activities'][i]);
|
||||||
}
|
}
|
||||||
ShowStream();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize search and paginate pieces and load data
|
// Initialize search and paginate pieces and load data
|
||||||
|
|||||||
Reference in New Issue
Block a user