diff --git a/docs/en_US/images/tool_menu.png b/docs/en_US/images/tool_menu.png index 599c6d444..a4e264222 100644 Binary files a/docs/en_US/images/tool_menu.png and b/docs/en_US/images/tool_menu.png differ diff --git a/docs/en_US/menu_bar.rst b/docs/en_US/menu_bar.rst index c06fd139c..d3a1618ba 100644 --- a/docs/en_US/menu_bar.rst +++ b/docs/en_US/menu_bar.rst @@ -96,40 +96,40 @@ Use the *Tools* menu to access the following options (in alphabetical order): +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Option | Action | +===========================+===========================================================================================================================================+ -| *Add named restore point* | Click to open the :ref:`Add named restore point... ` dialog to take a point-in-time snapshot of the current | -| | server state. | +| *ERD Tool* | Click to open the :ref:`ERD Tool ` and start designing your database. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Backup...* | Click to open the :ref:`Backup... ` dialog to backup database objects. | +| *Grant Wizard...* | Click to access the :ref:`Grant Wizard ` tool. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *PSQL Tool* | Click to open the :ref:`PSQL Tool ` and start PSQL in the current database context. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Query tool* | Click to open the :ref:`Query tool ` for the currently selected object. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Schema Diff* | Click to open the :ref:`Schema Diff ` and start comparing two database or two schema. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | *Backup Globals...* | Click to open the :ref:`Backup Globals... ` dialog to backup cluster objects. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | *Backup Server...* | Click to open the :ref:`Backup Server... ` dialog to backup a server. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Grant Wizard...* | Click to access the :ref:`Grant Wizard ` tool. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Import/Export...* | Click to open the :ref:`Import/Export data... ` dialog to import or export data from a table. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Maintenance...* | Click to open the :ref:`Maintenance... ` dialog to VACUUM, ANALYZE, REINDEX, or CLUSTER. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Pause replay of WAL* | Click to pause the replay of the WAL log. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Query tool* | Click to open the :ref:`Query tool ` for the currently selected object. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Reload Configuration...* | Click to update configuration files without restarting the server. | +| *Backup...* | Click to open the :ref:`Backup... ` dialog to backup database objects. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | *Restore...* | Click to access the :ref:`Restore ` dialog to restore database files from a backup. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Resume replay of WAL* | Click to resume the replay of the WAL log. | +| *Import/Export Data...* | Click to open the :ref:`Import/Export data... ` dialog to import or export data from a table. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Storage Manager* | Click to open the :ref:`Storage Manager ` to upload, delete, or download the backup files. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *New ERD Project* | Click to open the :ref:`ERD Tool ` and start designing your database. | -+---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *Schema Diff* | Click to open the :ref:`Schema Diff ` and start comparing two database or two schema. | +| *Maintenance...* | Click to open the :ref:`Maintenance... ` dialog to VACUUM, ANALYZE, REINDEX, or CLUSTER. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | *Search Objects...* | Click to open the :ref:`Search Objects... ` and start searching any kind of objects in a database. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ -| *PSQL Tool* | Click to open the :ref:`PSQL Tool ` and start PSQL in the current database context. | +| *Add named restore point* | Click to open the :ref:`Add named restore point... ` dialog to take a point-in-time snapshot of the current | +| | server state. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Pause replay of WAL* | Click to pause the replay of the WAL log. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Resume replay of WAL* | Click to resume the replay of the WAL log. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Reload Configuration...* | Click to update configuration files without restarting the server. | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| *Storage Manager* | Click to open the :ref:`Storage Manager ` to upload, delete, or download the backup files. | +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ The Help Menu diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js index 4794d85a7..017288a66 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/server.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js @@ -105,14 +105,14 @@ define('pgadmin.node.server', [ { name: 'reload_configuration', node: 'server', module: this, applies: ['tools', 'context'], callback: 'reload_configuration', - category: 'reload', priority: 6, label: gettext('Reload Configuration'), + category: 'reload', priority: 10, label: gettext('Reload Configuration'), icon: 'fa fa-redo-alt', enable : 'enable_reload_config',data: { data_disabled: gettext('Please select a server from the browser tree to reload the configuration files.'), }, },{ name: 'restore_point', node: 'server', module: this, applies: ['tools', 'context'], callback: 'restore_point', - category: 'restore', priority: 9, label: gettext('Add Named Restore Point...'), + category: 'restore', priority: 7, label: gettext('Add Named Restore Point...'), icon: 'fa fa-anchor', enable : 'is_applicable',data: { data_disabled: gettext('Please select any server from the browser tree to Add Named Restore Point.'), }, @@ -126,14 +126,14 @@ define('pgadmin.node.server', [ },{ name: 'wal_replay_pause', node: 'server', module: this, applies: ['tools', 'context'], callback: 'pause_wal_replay', - category: 'wal_replay_pause', priority: 7, label: gettext('Pause Replay of WAL'), + category: 'wal_replay_pause', priority: 8, label: gettext('Pause Replay of WAL'), icon: 'fa fa-pause-circle', enable : 'wal_pause_enabled',data: { data_disabled: gettext('Please select a connected database as a Super user and run in Recovery mode to Pause Replay of WAL.'), }, },{ name: 'wal_replay_resume', node: 'server', module: this, applies: ['tools', 'context'], callback: 'resume_wal_replay', - category: 'wal_replay_resume', priority: 8, label: gettext('Resume Replay of WAL'), + category: 'wal_replay_resume', priority: 9, label: gettext('Resume Replay of WAL'), icon: 'fa fa-play-circle', enable : 'wal_resume_enabled',data: { data_disabled: gettext('Please select a connected database as a Super user and run in Recovery mode to Resume Replay of WAL.'), }, diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js index a18aefcee..122358954 100644 --- a/web/pgadmin/browser/static/js/node.js +++ b/web/pgadmin/browser/static/js/node.js @@ -498,7 +498,7 @@ define('pgadmin.browser.node', [ return null; }, - addUtilityPanel: function() { + addUtilityPanel: function(width, height) { var body = window.document.body, el = document.createElement('div'); @@ -506,10 +506,10 @@ define('pgadmin.browser.node', [ var new_panel = pgBrowser.docker.addPanel( 'utility_props', window.wcDocker.DOCK.FLOAT, undefined, { - w: (screen.width < 700 ? - screen.width * 0.95 : screen.width * 0.5), - h: (screen.height < 500 ? - screen.height * 0.95 : screen.height * 0.5), + w: (!_.isUndefined(width) && !_.isNull(width)) ? width : + (screen.width < 700 ? screen.width * 0.95 : screen.width * 0.5), + h: (!_.isUndefined(height) && !_.isNull(height)) ? height : + (screen.height < 500 ? screen.height * 0.95 : screen.height * 0.5), x: (screen.width < 700 ? '2%' : '25%'), y: (screen.height < 500 ? '2%' : '25%'), } diff --git a/web/pgadmin/tools/backup/static/js/backup.js b/web/pgadmin/tools/backup/static/js/backup.js index 0ed15da94..723788bef 100644 --- a/web/pgadmin/tools/backup/static/js/backup.js +++ b/web/pgadmin/tools/backup/static/js/backup.js @@ -14,14 +14,11 @@ import Notify from '../../../../static/js/helpers/Notifier'; // Backup dialog define([ - 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'sources/pgadmin', - 'backbone', 'pgadmin.backgrid', - 'pgadmin.backform', 'pgadmin.browser', 'sources/utils', + 'sources/gettext', 'sources/url_for', 'underscore', 'pgadmin.browser', 'tools/backup/static/js/menu_utils', 'sources/nodes/supported_database_node', ], function( - gettext, url_for, $, _, pgAdmin, Backbone, Backgrid, Backform, pgBrowser, - commonUtils, menuUtils, supportedNodes + gettext, url_for, _, pgBrowser, menuUtils, supportedNodes ) { // if module is already initialized, refer to that. @@ -61,7 +58,7 @@ define([ module: this, applies: ['tools'], callback: 'startBackupGlobal', - priority: 12, + priority: 2, label: gettext('Backup Globals...'), icon: 'fa fa-save', enable: menuUtils.menuEnabledServer, @@ -73,7 +70,7 @@ define([ module: this, applies: ['tools'], callback: 'startBackupServer', - priority: 12, + priority: 2, label: gettext('Backup Server...'), icon: 'fa fa-save', enable: menuUtils.menuEnabledServer, @@ -86,7 +83,7 @@ define([ node: 'server', applies: ['context'], callback: 'startBackupGlobal', - priority: 12, + priority: 2, label: gettext('Backup Globals...'), icon: 'fa fa-save', enable: menuUtils.menuEnabledServer, @@ -99,7 +96,7 @@ define([ node: 'server', applies: ['context'], callback: 'startBackupServer', - priority: 12, + priority: 2, label: gettext('Backup Server...'), icon: 'fa fa-save', enable: menuUtils.menuEnabledServer, @@ -111,7 +108,7 @@ define([ module: this, applies: ['tools'], callback: 'backupObjects', - priority: 11, + priority: 2, label: gettext('Backup...'), icon: 'fa fa-save', enable: supportedNodes.enabled.bind( @@ -129,7 +126,7 @@ define([ module: this, applies: ['context'], callback: 'backupObjects', - priority: 11, + priority: 2, label: gettext('Backup...'), icon: 'fa fa-save', enable: supportedNodes.enabled.bind( diff --git a/web/pgadmin/tools/backup/static/js/backup.ui.js b/web/pgadmin/tools/backup/static/js/backup.ui.js index 62f2c1476..d60d7bbd6 100644 --- a/web/pgadmin/tools/backup/static/js/backup.ui.js +++ b/web/pgadmin/tools/backup/static/js/backup.ui.js @@ -1,3 +1,11 @@ +///////////////////////////////////////////////////////////// +// +// pgAdmin 4 - PostgreSQL Tools +// +// Copyright (C) 2013 - 2021, The pgAdmin Development Team +// This software is released under the PostgreSQL Licence +// +////////////////////////////////////////////////////////////// import gettext from 'sources/gettext'; import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import { isEmptyString } from 'sources/validators'; diff --git a/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js b/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js index 4fdb4d4c0..88012e107 100644 --- a/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js +++ b/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js @@ -1,3 +1,11 @@ +///////////////////////////////////////////////////////////// +// +// pgAdmin 4 - PostgreSQL Tools +// +// Copyright (C) 2013 - 2021, The pgAdmin Development Team +// This software is released under the PostgreSQL Licence +// +////////////////////////////////////////////////////////////// import gettext from 'sources/gettext'; import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import { isEmptyString } from 'sources/validators'; diff --git a/web/pgadmin/tools/erd/static/js/erd_module.js b/web/pgadmin/tools/erd/static/js/erd_module.js index 9e5431f90..dc930f115 100644 --- a/web/pgadmin/tools/erd/static/js/erd_module.js +++ b/web/pgadmin/tools/erd/static/js/erd_module.js @@ -37,7 +37,7 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, pgBrowser applies: ['tools'], callback: 'showErdTool', priority: 1, - label: gettext('New ERD Project'), + label: gettext('ERD Tool'), enable: this.erdToolEnabled, data: { data_disabled: gettext('The selected tree node does not support this option.'), diff --git a/web/pgadmin/static/js/components/GrantWizard.jsx b/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx similarity index 95% rename from web/pgadmin/static/js/components/GrantWizard.jsx rename to web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx index b475921e5..8ca1c6e5d 100644 --- a/web/pgadmin/static/js/components/GrantWizard.jsx +++ b/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx @@ -13,19 +13,19 @@ import url_for from 'sources/url_for'; import React from 'react'; import { Box } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; -import Wizard from '../helpers/wizard/Wizard'; -import WizardStep from '../helpers/wizard/WizardStep'; +import Wizard from '../../../../static/js/helpers/wizard/Wizard'; +import WizardStep from '../../../../static/js/helpers/wizard/WizardStep'; import PgTable from 'sources/components/PgTable'; -import { getNodePrivilegeRoleSchema } from '../../../browser/server_groups/servers/static/js/privilege.ui.js'; -import { InputSQL, InputText, FormFooterMessage, MESSAGE_TYPE } from './FormComponents'; -import getApiInstance from '../api_instance'; -import SchemaView from '../SchemaView'; +import { getNodePrivilegeRoleSchema } from '../../../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui.js'; +import { InputSQL, InputText, FormFooterMessage, MESSAGE_TYPE } from '../../../../static/js/components/FormComponents'; +import getApiInstance from '../../../../static/js/api_instance'; +import SchemaView from '../../../../static/js/SchemaView'; import clsx from 'clsx'; import Loader from 'sources/components/Loader'; import Alertify from 'pgadmin.alertifyjs'; import PropTypes from 'prop-types'; -import PrivilegeSchema from '../../../tools/grant_wizard/static/js/privilege_schema.ui'; -import Notify from '../../../static/js/helpers/Notifier'; +import PrivilegeSchema from './privilege_schema.ui'; +import Notify from '../../../../static/js/helpers/Notifier'; const useStyles = makeStyles(() => ({ diff --git a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js index 419c6bea9..468918a9e 100644 --- a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js +++ b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js @@ -9,23 +9,20 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Theme from 'sources/Theme'; -import GrantWizard from 'sources/components/GrantWizard'; +import GrantWizard from './GrantWizard'; // Grant Wizard define([ - 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone', - 'pgadmin.alertifyjs', 'pgadmin.backgrid', 'pgadmin.backform', - 'pgadmin.browser', 'pgadmin.browser.node', + 'sources/gettext', 'jquery', 'underscore', + 'pgadmin.alertifyjs', 'pgadmin.browser', 'tools/grant_wizard/static/js/menu_utils', - 'sources/utils', 'sources/nodes/supported_database_node', 'backgrid.select.all', 'backgrid.filter', 'pgadmin.browser.server.privilege', 'pgadmin.browser.wizard', ], function( - gettext, url_for, $, _, Backbone, Alertify, Backgrid, Backform, pgBrowser, - pgNode, menuUtils, commonUtils, supportedNodes + gettext, $, _, Alertify, pgBrowser, menuUtils, supportedNodes ) { // if module is already initialized, refer to that. @@ -48,7 +45,7 @@ define([ module: this, applies: ['tools'], callback: 'start_grant_wizard', - priority: 14, + priority: 1, label: gettext('Grant Wizard...'), icon: 'fa fa-unlock', enable: supportedNodes.enabled.bind( diff --git a/web/pgadmin/tools/import_export/static/js/import_export.js b/web/pgadmin/tools/import_export/static/js/import_export.js index c143733cf..a161c0112 100644 --- a/web/pgadmin/tools/import_export/static/js/import_export.js +++ b/web/pgadmin/tools/import_export/static/js/import_export.js @@ -408,8 +408,8 @@ define([ applies: ['tools', 'context'], callback: 'callback_import_export', category: 'import', - priority: 10, - label: gettext('Import/Export...'), + priority: 3, + label: gettext('Import/Export Data...'), icon: 'fa fa-shopping-cart', enable: supportedNodes.enabled.bind( null, pgBrowser.tree, ['table'] diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.js b/web/pgadmin/tools/maintenance/static/js/maintenance.js index d96e2eb37..749971519 100644 --- a/web/pgadmin/tools/maintenance/static/js/maintenance.js +++ b/web/pgadmin/tools/maintenance/static/js/maintenance.js @@ -165,7 +165,7 @@ define([ module: this, applies: ['tools'], callback: 'callback_maintenance', - priority: 10, + priority: 3, label: gettext('Maintenance...'), icon: 'fa fa-wrench', enable: supportedNodes.enabled.bind( diff --git a/web/pgadmin/tools/restore/static/js/restore.js b/web/pgadmin/tools/restore/static/js/restore.js index 50bd63dc5..20054e344 100644 --- a/web/pgadmin/tools/restore/static/js/restore.js +++ b/web/pgadmin/tools/restore/static/js/restore.js @@ -392,9 +392,10 @@ define('tools.restore', [ module: this, applies: ['tools'], callback: 'restore_objects', - priority: 13, + priority: 2, label: gettext('Restore...'), icon: 'fa fa-upload', + below: true, enable: supportedNodes.enabled.bind( null, pgBrowser.tree, menuUtils.restoreSupportedNodes ), diff --git a/web/pgadmin/tools/schema_diff/static/js/schema_diff.js b/web/pgadmin/tools/schema_diff/static/js/schema_diff.js index 2c257c87f..82fb0d49f 100644 --- a/web/pgadmin/tools/schema_diff/static/js/schema_diff.js +++ b/web/pgadmin/tools/schema_diff/static/js/schema_diff.js @@ -39,6 +39,7 @@ define('pgadmin.schemadiff', [ priority: 1, label: gettext('Schema Diff'), enable: true, + below: true, }]; pgBrowser.add_menus(menus); diff --git a/web/pgadmin/tools/search_objects/static/js/search_objects.js b/web/pgadmin/tools/search_objects/static/js/search_objects.js index 0f04e9c4a..e82be6f5b 100644 --- a/web/pgadmin/tools/search_objects/static/js/search_objects.js +++ b/web/pgadmin/tools/search_objects/static/js/search_objects.js @@ -34,8 +34,9 @@ define([ applies: ['tools'], callback: 'show_search_objects', enable: this.search_objects_enabled, - priority: 1, + priority: 3, label: gettext('Search Objects...'), + below: true, data: { data_disabled: gettext('Please select a database from the browser tree to search the database objects.'), }, diff --git a/web/pgadmin/tools/storage_manager/static/js/storage_manager.js b/web/pgadmin/tools/storage_manager/static/js/storage_manager.js index 6dcb7c1f6..9454ace5e 100644 --- a/web/pgadmin/tools/storage_manager/static/js/storage_manager.js +++ b/web/pgadmin/tools/storage_manager/static/js/storage_manager.js @@ -49,7 +49,7 @@ define([ module: this, applies: ['tools'], callback: 'callback_storage_manager', - priority: 2, + priority: 11, label: gettext('Storage Manager...'), enable: true, }];