mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 07:56:06 -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
|
// create a promise that will resolve state $AnsibleConfig is loaded
|
||||||
$rootScope.loginConfig = $q.defer();
|
$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;
|
$rootScope.licenseMissing = true;
|
||||||
//the authorization controller redirects to the home page automatcially if there is no last path defined. in order to override
|
//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.
|
// 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")
|
label: N_("DASHBOARD")
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
graphData: ['$q', 'jobStatusGraphData',
|
graphData: ['$q', 'jobStatusGraphData', '$rootScope',
|
||||||
function($q, jobStatusGraphData) {
|
function($q, jobStatusGraphData, $rootScope) {
|
||||||
return $q.all({
|
return $rootScope.basePathsLoaded.promise.then(function() {
|
||||||
jobStatus: jobStatusGraphData.get("month", "all"),
|
return $q.all({
|
||||||
|
jobStatus: jobStatusGraphData.get("month", "all"),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -36,11 +36,17 @@ angular.module('ApiLoader', ['Utilities'])
|
|||||||
data.base = base;
|
data.base = base;
|
||||||
$rootScope.defaultUrls = data;
|
$rootScope.defaultUrls = data;
|
||||||
Store('api', data);
|
Store('api', data);
|
||||||
|
if($rootScope.basePathsLoaded){
|
||||||
|
$rootScope.basePathsLoaded.resolve();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(({data, status}) => {
|
.catch(({data, status}) => {
|
||||||
$rootScope.defaultUrls = {
|
$rootScope.defaultUrls = {
|
||||||
status: 'error'
|
status: 'error'
|
||||||
};
|
};
|
||||||
|
if($rootScope.basePathsLoaded){
|
||||||
|
$rootScope.basePathsLoaded.reject();
|
||||||
|
}
|
||||||
ProcessErrors(null, data, status, null, {
|
ProcessErrors(null, data, status, null, {
|
||||||
hdr: 'Error',
|
hdr: 'Error',
|
||||||
msg: 'Failed to read ' + base + '. GET status: ' + status
|
msg: 'Failed to read ' + base + '. GET status: ' + status
|
||||||
|
|||||||
Reference in New Issue
Block a user