MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / hasBinariesConfiguration

Function hasBinariesConfiguration

web/pgadmin/static/js/utils.js:299–325  ·  view source on GitHub ↗
(pgBrowser, serverInformation)

Source from the content-addressed store, hash-verified

297}
298
299export function hasBinariesConfiguration(pgBrowser, serverInformation) {
300 const module = 'paths';
301 let preference_name = 'pg_bin_dir';
302 let msg = gettext('Please configure the PostgreSQL Binary Path in the Preferences.');
303
304 if ((serverInformation.type && serverInformation.type === 'ppas') ||
305 serverInformation.server_type === 'ppas') {
306 preference_name = 'ppas_bin_dir';
307 msg = gettext('Please configure the EDB Advanced Server Binary Path in the Preferences.');
308 }
309
310 const preference = usePreferences.getState().getPreferences(module, preference_name);
311
312 if (preference) {
313 if (_.isUndefined(preference.value) || !checkBinaryPathExists(preference.value, serverInformation.version)) {
314 pgAdmin.Browser.notifier.alert(gettext('Configuration required'), msg);
315 return false;
316 }
317 } else {
318 pgAdmin.Browser.notifier.alert(
319 gettext('Preferences Error'),
320 gettext('Failed to load preference %s of module %s', preference_name, module)
321 );
322 return false;
323 }
324 return true;
325}
326
327function checkBinaryPathExists(binaryPathArray, selectedServerVersion) {
328 let foundDefaultPath = false,

Callers 1

openPsqlToolMethod · 0.90

Calls 3

gettextFunction · 0.85
checkBinaryPathExistsFunction · 0.85
alertMethod · 0.80

Tested by

no test coverage detected