mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 05:55:59 -03:30
Resolve initial login error
This commit is contained in:
@@ -411,6 +411,10 @@ angular
|
||||
// create a promise that will resolve state $AnsibleConfig is loaded
|
||||
$rootScope.loginConfig = $q.defer();
|
||||
}
|
||||
if (!$rootScope.basePathsLoaded) {
|
||||
// create a promise that will resolve when base paths are loaded
|
||||
$rootScope.basePathsLoaded = $q.defer();
|
||||
}
|
||||
$rootScope.licenseMissing = true;
|
||||
//the authorization controller redirects to the home page automatcially if there is no last path defined. in order to override
|
||||
// this, set the last path to /portal for instances where portal is visited for the first time.
|
||||
|
||||
@@ -21,10 +21,12 @@ export default {
|
||||
label: N_("DASHBOARD")
|
||||
},
|
||||
resolve: {
|
||||
graphData: ['$q', 'jobStatusGraphData',
|
||||
function($q, jobStatusGraphData) {
|
||||
return $q.all({
|
||||
jobStatus: jobStatusGraphData.get("month", "all"),
|
||||
graphData: ['$q', 'jobStatusGraphData', '$rootScope',
|
||||
function($q, jobStatusGraphData, $rootScope) {
|
||||
return $rootScope.basePathsLoaded.promise.then(function() {
|
||||
return $q.all({
|
||||
jobStatus: jobStatusGraphData.get("month", "all"),
|
||||
});
|
||||
});
|
||||
}
|
||||
]
|
||||
|
||||
@@ -36,11 +36,17 @@ angular.module('ApiLoader', ['Utilities'])
|
||||
data.base = base;
|
||||
$rootScope.defaultUrls = data;
|
||||
Store('api', data);
|
||||
if($rootScope.basePathsLoaded){
|
||||
$rootScope.basePathsLoaded.resolve();
|
||||
}
|
||||
})
|
||||
.catch(({data, status}) => {
|
||||
$rootScope.defaultUrls = {
|
||||
status: 'error'
|
||||
};
|
||||
if($rootScope.basePathsLoaded){
|
||||
$rootScope.basePathsLoaded.reject();
|
||||
}
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error',
|
||||
msg: 'Failed to read ' + base + '. GET status: ' + status
|
||||
|
||||
Reference in New Issue
Block a user