mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that SQL help should work for EPAS servers. Fixes #6834
This commit is contained in:
@@ -63,18 +63,6 @@ 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/edb-docs/d/postgresql/reference/'
|
||||
'manual/$VERSION$/',
|
||||
category_label=gettext('Help'),
|
||||
help_str=gettext(
|
||||
'Path to the EDB Advanced Server documentation. $VERSION$ '
|
||||
'will be replaced with the major.minor version number.'
|
||||
)
|
||||
)
|
||||
|
||||
def get_exposed_url_endpoints(self):
|
||||
"""
|
||||
Returns the list of URLs exposed to the client.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user