mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
Use ConfigService to get version for doc links
This commit is contained in:
@@ -1,17 +1,22 @@
|
|||||||
export default ['$stateParams', '$scope', '$state', 'GetBasePath', 'QuerySet', 'SmartSearchService', 'i18n', 'ConfigModel',
|
export default ['$stateParams', '$scope', '$state', 'GetBasePath', 'QuerySet', 'SmartSearchService', 'i18n', 'ConfigService',
|
||||||
function($stateParams, $scope, $state, GetBasePath, qs, SmartSearchService, i18n, ConfigModel) {
|
function($stateParams, $scope, $state, GetBasePath, qs, SmartSearchService, i18n, configService) {
|
||||||
|
|
||||||
let path,
|
let path,
|
||||||
defaults,
|
defaults,
|
||||||
queryset,
|
queryset,
|
||||||
stateChangeSuccessListener,
|
stateChangeSuccessListener;
|
||||||
configModel = new ConfigModel();
|
|
||||||
|
|
||||||
configModel.request('get')
|
configService.getConfig()
|
||||||
.then(() => init());
|
.then(config => init(config));
|
||||||
|
|
||||||
function init() {
|
function init(config) {
|
||||||
let version = configModel.getTruncatedVersion() || 'latest';
|
let version;
|
||||||
|
|
||||||
|
try {
|
||||||
|
version = config.version.split('-')[0];
|
||||||
|
} catch (err) {
|
||||||
|
version = 'latest';
|
||||||
|
}
|
||||||
|
|
||||||
$scope.documentationLink = `http://docs.ansible.com/ansible-tower/${version}/html/userguide/search_sort.html`;
|
$scope.documentationLink = `http://docs.ansible.com/ansible-tower/${version}/html/userguide/search_sort.html`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user