2019-03-22 09:09:24 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2021-01-04 04:04:45 -06:00
|
|
|
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
|
2019-03-22 09:09:24 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2020-05-22 03:41:35 -05:00
|
|
|
export function getHelpUrl(base_path, file, version, server_type) {
|
2019-03-22 09:09:24 -05:00
|
|
|
var major = Math.floor(version / 10000),
|
|
|
|
minor = Math.floor(version / 100) - (major * 100),
|
2020-05-22 03:41:35 -05:00
|
|
|
subminor = version - ((major * 10000) + (minor * 100)),
|
|
|
|
url = '',
|
|
|
|
replace_string = major + '.' + minor;
|
2019-03-22 09:09:24 -05:00
|
|
|
|
2020-05-22 03:41:35 -05:00
|
|
|
// Handle the version number format change in EPAS 9.6 and below
|
|
|
|
if (server_type == 'ppas' && major < 10) {
|
|
|
|
replace_string = major + '.' + minor + '.' + subminor;
|
|
|
|
} else if (server_type == 'pg' && major >= 10) {
|
|
|
|
// Handle the version number format change in PG 10+
|
|
|
|
replace_string = major;
|
2019-03-22 09:09:24 -05:00
|
|
|
}
|
|
|
|
|
2020-05-22 03:41:35 -05:00
|
|
|
url = base_path.replace('$VERSION$', replace_string);
|
|
|
|
|
2019-03-22 09:09:24 -05:00
|
|
|
if (url.substr(-1) != '/') {
|
|
|
|
url = url + '/';
|
|
|
|
}
|
|
|
|
|
|
|
|
return url + file;
|
2019-04-05 02:37:43 -05:00
|
|
|
}
|