Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
app.js60 linesDownload Raw Back to bundle
1/////////////////////////////////////////////////////////////2//3// pgAdmin 4 - PostgreSQL Tools4//5// Copyright (C) 2013 - 2024, The pgAdmin Development Team6// This software is released under the PostgreSQL Licence7//8//////////////////////////////////////////////////////////////9 10import React from 'react';11import ReactDOM from 'react-dom';12import BrowserComponent from '../js/BrowserComponent';13import MainMenuFactory from '../../browser/static/js/MainMenuFactory';14import Theme from '../js/Theme';15 16define('app', [17  'sources/pgadmin', 'bundled_browser',18], function(pgAdmin) {19  let initializeModules = function(obj) {20    for (let key in obj) {21      let module = obj[key];22 23      if (typeof module?.init == 'function') {24        try {25          module.init();26        }27        catch (e) {28          console.warn(e.stack || e);29        }30      }31      else if (typeof module?.Init == 'function') {32        try {33          module.Init();34        }35        catch (e) {36          console.warn(e.stack || e);37        }38      }39    }40  };41 42  // Initialize modules registered to pgAdmin, pgAdmin.Browser and Tools object.43  initializeModules(pgAdmin);44  initializeModules(pgAdmin.Browser);45  initializeModules(pgAdmin.Tools);46 47  // Add menus from back end.48  pgAdmin.Browser.utils.addBackendMenus(pgAdmin.Browser);49 50  // Create menus after all modules are initialized.51  MainMenuFactory.createMainMenus();52 53  ReactDOM.render(54    <Theme>55      <BrowserComponent pgAdmin={pgAdmin} />56    </Theme>,57    document.querySelector('#root')58  );59});60 
codekingpro/portable-devtools · Team Ai