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