2019-01-02 04:24:12 -06:00
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2024-01-01 02:43:48 -06:00
|
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2019-01-02 04:24:12 -06:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
2022-12-22 02:55:18 -06:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2023-10-23 07:13:17 -05:00
|
|
|
import BrowserComponent from '../js/BrowserComponent';
|
2022-12-22 02:55:18 -06:00
|
|
|
import MainMenuFactory from '../../browser/static/js/MainMenuFactory';
|
|
|
|
import Theme from '../js/Theme';
|
|
|
|
|
2017-07-18 09:14:59 -05:00
|
|
|
define('app', [
|
2022-04-07 07:06:56 -05:00
|
|
|
'sources/pgadmin', 'bundled_browser',
|
2019-10-10 01:35:28 -05:00
|
|
|
], function(pgAdmin) {
|
2023-06-09 04:58:46 -05:00
|
|
|
let initializeModules = function(obj) {
|
|
|
|
for (let key in obj) {
|
|
|
|
let module = obj[key];
|
2021-09-27 06:14:26 -05:00
|
|
|
|
|
|
|
if (module && module.init && typeof module.init == 'function') {
|
|
|
|
try {
|
|
|
|
module.init();
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
console.warn(e.stack || e);
|
|
|
|
}
|
2018-01-17 01:54:25 -06:00
|
|
|
}
|
2021-09-27 06:14:26 -05:00
|
|
|
else if (module && module.Init && typeof module.Init == 'function') {
|
|
|
|
try {
|
2022-06-30 00:36:50 -05:00
|
|
|
module.Init();
|
2021-09-27 06:14:26 -05:00
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
console.warn(e.stack || e);
|
|
|
|
}
|
2017-07-18 09:14:59 -05:00
|
|
|
}
|
|
|
|
}
|
2018-01-17 01:54:25 -06:00
|
|
|
};
|
2017-07-18 09:14:59 -05:00
|
|
|
|
2019-03-14 10:11:16 -05:00
|
|
|
// Initialize modules registered to pgAdmin, pgAdmin.Browser and Tools object.
|
2018-01-17 01:54:25 -06:00
|
|
|
initializeModules(pgAdmin);
|
|
|
|
initializeModules(pgAdmin.Browser);
|
|
|
|
initializeModules(pgAdmin.Tools);
|
2017-07-18 09:14:59 -05:00
|
|
|
|
2022-12-22 02:55:18 -06:00
|
|
|
// Add menus from back end.
|
|
|
|
pgAdmin.Browser.utils.addBackendMenus(pgAdmin.Browser);
|
|
|
|
|
|
|
|
// Create menus after all modules are initialized.
|
|
|
|
MainMenuFactory.createMainMenus();
|
|
|
|
|
2023-04-26 00:48:16 -05:00
|
|
|
ReactDOM.render(
|
|
|
|
<Theme>
|
2023-10-23 07:13:17 -05:00
|
|
|
<BrowserComponent pgAdmin={pgAdmin} />
|
|
|
|
</Theme>,
|
|
|
|
document.querySelector('#root')
|
2023-04-26 00:48:16 -05:00
|
|
|
);
|
2017-07-27 06:55:07 -05:00
|
|
|
});
|