mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
[system_tracking] Ensure 401 errors in resolver handles sign out
This commit is contained in:
@@ -15,12 +15,20 @@ export default {
|
|||||||
moduleOptions:
|
moduleOptions:
|
||||||
[ 'getModuleOptions',
|
[ 'getModuleOptions',
|
||||||
'lodashAsPromised',
|
'lodashAsPromised',
|
||||||
|
'ProcessErrors',
|
||||||
'$route',
|
'$route',
|
||||||
function(getModuleOptions, _, $route) {
|
function(getModuleOptions, _, ProcessErrors, $route) {
|
||||||
var hostIds = $route.current.params.hosts.split(',');
|
var hostIds = $route.current.params.hosts.split(',');
|
||||||
|
|
||||||
var data =
|
var data =
|
||||||
getModuleOptions(hostIds[0])
|
getModuleOptions(hostIds[0])
|
||||||
|
.catch(function (response) {
|
||||||
|
ProcessErrors(null, response.data, response.status, null, {
|
||||||
|
hdr: 'Error!',
|
||||||
|
msg: 'Failed to get license info. GET returned status: ' +
|
||||||
|
response.status
|
||||||
|
});
|
||||||
|
})
|
||||||
.value();
|
.value();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@@ -32,7 +40,8 @@ export default {
|
|||||||
'$q',
|
'$q',
|
||||||
'Rest',
|
'Rest',
|
||||||
'GetBasePath',
|
'GetBasePath',
|
||||||
function($route, $q, rest, getBasePath) {
|
'ProcessErrors',
|
||||||
|
function($route, $q, rest, getBasePath, ProcessErrors) {
|
||||||
if ($route.current.hasModelKey('inventory')) {
|
if ($route.current.hasModelKey('inventory')) {
|
||||||
return $q.when($route.current.params.model.inventory);
|
return $q.when($route.current.params.model.inventory);
|
||||||
}
|
}
|
||||||
@@ -44,7 +53,13 @@ export default {
|
|||||||
return rest.get()
|
return rest.get()
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
return data.data;
|
return data.data;
|
||||||
});
|
}).catch(function (response) {
|
||||||
|
ProcessErrors(null, response.data, response.status, null, {
|
||||||
|
hdr: 'Error!',
|
||||||
|
msg: 'Failed to get license info. GET returned status: ' +
|
||||||
|
response.status
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
hosts:
|
hosts:
|
||||||
@@ -52,7 +67,8 @@ export default {
|
|||||||
'$q',
|
'$q',
|
||||||
'Rest',
|
'Rest',
|
||||||
'GetBasePath',
|
'GetBasePath',
|
||||||
function($route, $q, rest, getBasePath) {
|
'ProcessErrors',
|
||||||
|
function($route, $q, rest, getBasePath, ProcessErrors) {
|
||||||
if ($route.current.hasModelKey('hosts')) {
|
if ($route.current.hasModelKey('hosts')) {
|
||||||
return $q.when($route.current.params.model.hosts);
|
return $q.when($route.current.params.model.hosts);
|
||||||
}
|
}
|
||||||
@@ -68,7 +84,13 @@ export default {
|
|||||||
return rest.get()
|
return rest.get()
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
return data.data;
|
return data.data;
|
||||||
});
|
}).catch(function (response) {
|
||||||
|
ProcessErrors(null, response.data, response.status, null, {
|
||||||
|
hdr: 'Error!',
|
||||||
|
msg: 'Failed to get license info. GET returned status: ' +
|
||||||
|
response.status
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return $q.all(hosts);
|
return $q.all(hosts);
|
||||||
|
|||||||
Reference in New Issue
Block a user