Fixed the SQL help issue for EDB Postgres Advanced Server. Fixes #4099

This commit is contained in:
Akshay Joshi
2020-05-22 14:11:35 +05:30
parent 4a8037fc6a
commit 9b8902dfb8
7 changed files with 75 additions and 26 deletions

View File

@@ -66,7 +66,8 @@ class HelpModule(PgAdminModule):
self.edbas_help_path = self.help_preference.register(
'help', 'edbas_help_path',
gettext("EDB Advanced Server Help Path"), 'text',
'https://www.enterprisedb.com/docs/en/$VERSION$/pg/',
'https://www.enterprisedb.com/edb-docs/d/postgresql/reference/'
'manual/$VERSION$/',
category_label=gettext('Help'),
help_str=gettext(
'Path to the EDB Advanced Server documentation. $VERSION$ '

View File

@@ -7,18 +7,23 @@
//
//////////////////////////////////////////////////////////////////////////
export function getHelpUrl(base_path, file, version) {
export function getHelpUrl(base_path, file, version, server_type) {
var major = Math.floor(version / 10000),
minor = Math.floor(version / 100) - (major * 100),
url = '';
subminor = version - ((major * 10000) + (minor * 100)),
url = '',
replace_string = major + '.' + minor;
// Handle the version number format change in PG 10+
if (major >= 10) {
url = base_path.replace('$VERSION$', major);
} else {
url = base_path.replace('$VERSION$', 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) {
// Handle the version number format change in PG 10+
replace_string = major;
}
url = base_path.replace('$VERSION$', replace_string);
if (url.substr(-1) != '/') {
url = url + '/';
}