mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
local_config
Don't start the app until the config file is loaded and $AnsibleConfig is defined.
This commit is contained in:
@@ -416,11 +416,6 @@ angular.module('Tower', [
|
|||||||
var e, html, sock, checkCount;
|
var e, html, sock, checkCount;
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
LoadBasePaths();
|
|
||||||
|
|
||||||
$rootScope.breadcrumbs = [];
|
|
||||||
$rootScope.crumbCache = [];
|
|
||||||
$rootScope.sessionTimer = Timer.init();
|
|
||||||
|
|
||||||
function detectBrowser() {
|
function detectBrowser() {
|
||||||
var ua = window.navigator.userAgent,
|
var ua = window.navigator.userAgent,
|
||||||
@@ -513,6 +508,16 @@ angular.module('Tower', [
|
|||||||
activateTab();
|
activateTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($rootScope.removeConfigReady) {
|
||||||
|
$rootScope.removeConfigReady();
|
||||||
|
}
|
||||||
|
$rootScope.removeConfigReady = $rootScope.$on('ConfigReady', function() {
|
||||||
|
LoadBasePaths();
|
||||||
|
|
||||||
|
$rootScope.breadcrumbs = [];
|
||||||
|
$rootScope.crumbCache = [];
|
||||||
|
$rootScope.sessionTimer = Timer.init();
|
||||||
|
|
||||||
if (!Authorization.getToken()) {
|
if (!Authorization.getToken()) {
|
||||||
// When the app first loads, redirect to login page
|
// When the app first loads, redirect to login page
|
||||||
$rootScope.sessionExpired = false;
|
$rootScope.sessionExpired = false;
|
||||||
@@ -584,5 +589,6 @@ angular.module('Tower', [
|
|||||||
checkCount = 0;
|
checkCount = 0;
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ angular.module('LoadConfigHelper', ['Utilities'])
|
|||||||
$http({ method:'GET', url: $basePath + 'js/config.js' })
|
$http({ method:'GET', url: $basePath + 'js/config.js' })
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
$AnsibleConfig = eval(data);
|
$AnsibleConfig = eval(data);
|
||||||
|
$rootScope.$emit('ConfigReady');
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
|
||||||
@@ -37,10 +38,11 @@ angular.module('LoadConfigHelper', ['Utilities'])
|
|||||||
$http({ method:'GET', url: $basePath + 'js/local_config.js' })
|
$http({ method:'GET', url: $basePath + 'js/local_config.js' })
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
$AnsibleConfig = eval(data);
|
$AnsibleConfig = eval(data);
|
||||||
|
$rootScope.$emit('ConfigReady');
|
||||||
})
|
})
|
||||||
.error(function() {
|
.error(function() {
|
||||||
//local_config.js not found
|
//local_config.js not found
|
||||||
$rootScope.$emit('LoadConfig');
|
$rootScope.$emit('LoadConfig');
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
}]);
|
}]);
|
||||||
Reference in New Issue
Block a user