mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed the SQL help issue for EDB Postgres Advanced Server. Fixes #4099
This commit is contained in:
@@ -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$ '
|
||||
|
||||
@@ -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 + '/';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user