Ensure that SQL help should work for EPAS servers. Fixes #6834

This commit is contained in:
Akshay Joshi
2021-10-06 14:49:56 +05:30
parent ab424b27d1
commit 1ed6272e7b
13 changed files with 55 additions and 96 deletions

View File

@@ -7,17 +7,13 @@
//
//////////////////////////////////////////////////////////////////////////
export function getHelpUrl(base_path, file, version, server_type) {
export function getHelpUrl(base_path, file, version) {
var major = Math.floor(version / 10000),
minor = Math.floor(version / 100) - (major * 100),
subminor = version - ((major * 10000) + (minor * 100)),
url = '',
replace_string = major + '.' + minor;
// 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) {
if (major >= 10) {
// Handle the version number format change in PG 10+
replace_string = major;
}
@@ -30,3 +26,21 @@ export function getHelpUrl(base_path, file, version, server_type) {
return url + file;
}
export function getEPASHelpUrl(version) {
var major = Math.floor(version / 10000),
minor = Math.floor(version / 100) - (major * 100),
epasHelp11Plus = 'https://www.enterprisedb.com/docs/epas/$VERSION$/epas_compat_sql/',
epasHelp = 'https://www.enterprisedb.com/docs/epas/$VERSION$/',
url = '';
url = epasHelp11Plus.replace('$VERSION$', major);
if (major == 10) {
url = epasHelp.replace('$VERSION$', major);
} else if (major < 10) {
url = epasHelp.replace('$VERSION$', major + '.' + minor);
}
return url;
}