2019-03-22 09:09:24 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2023-01-02 00:23:55 -06:00
|
|
|
// Copyright (C) 2013 - 2023, The pgAdmin Development Team
|
2019-03-22 09:09:24 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2021-10-06 04:19:56 -05:00
|
|
|
export function getHelpUrl(base_path, file, version) {
|
2022-09-08 07:38:58 -05:00
|
|
|
let major = Math.floor(version / 10000),
|
2019-03-22 09:09:24 -05:00
|
|
|
minor = Math.floor(version / 100) - (major * 100),
|
2020-05-22 03:41:35 -05:00
|
|
|
url = '',
|
|
|
|
replace_string = major + '.' + minor;
|
2019-03-22 09:09:24 -05:00
|
|
|
|
2021-10-06 04:19:56 -05:00
|
|
|
if (major >= 10) {
|
2020-05-22 03:41:35 -05:00
|
|
|
// 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
|
|
|
}
|
2021-10-06 04:19:56 -05:00
|
|
|
|
|
|
|
export function getEPASHelpUrl(version) {
|
2022-09-08 07:38:58 -05:00
|
|
|
let major = Math.floor(version / 10000),
|
2021-10-06 04:19:56 -05:00
|
|
|
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;
|
|
|
|
}
|