Commit Graph

510 Commits

Author SHA1 Message Date
Nagesh Dhope
37f76142fb 1) Added aria-label to buttons used in graphical explain plan.
2) Fixed minor issue where we use dialog tab navigator keyboard shortcut only on visible tabs.
3) Fixed an issue where Zoom in, Zoom out, Zoom to original and Download button should not blur the focus after a click on them.

Initial patch sent by Murtuza Zabuawala.
2019-12-31 13:05:46 +05:30
Aditya Toshniwal
f1a18749f6 1) Allow screen-reader to read relationship attributes for tab, tabpanels and tables under it. Similar changes are done for subnode controls.
2) Add role="img" for font icons.

Fixes #4764
2019-12-17 13:22:36 +05:30
Khushboo Vashi
cb26ca0e46 Fix XSS issue in explain and explain analyze for table and type which contain HTML. Fixes #4947. 2019-12-09 18:00:56 +05:30
Aditya Toshniwal
5316a28e6c Fixed issue where Dark Theme is unavailable in python wheel distro.
pgAdmin wheel distro is not having pgadmin.themes.json file in 'web/pgadmin/misc/themes' directory,
so it's better to refer this file from the generated directory.
2019-11-20 15:05:20 +05:30
Aditya Toshniwal
00ce130286 Shown some text on process watcher till the initial logs are loaded. Fixes #4925 2019-11-15 12:12:19 +05:30
Aditya Toshniwal
c1c682402a 1) Further styling tweaks for Dark Theme.
2) Theme related code changes are removed from config.py and moved to miscellaneous under a new package - "themes".
2019-11-11 18:47:43 +05:30
Aditya Toshniwal
8180403f97 1) Added support for custom theme creation and selection. Fixes #4348.
2) Added Dark(Beta) UI Theme option. Fixes #3741.
3) Fix an issue where a black arrow-kind image is displaying at the background of browser tree images. Fixes #4171

Changes include:
  1) New theme option in preferences - Miscellaneous -> Themes. You can select the theme from the dropdown.
     It also has a preview of the theme just below the dropdown. Note that, a page refresh is needed to apply changes.
     On saving, a dialog appears to ask for refresh.
  2) You can create your own theme and submit to hackers. README is updated to help you create a theme. Theme will be available only after the bundle.
  3) Correction of SASS variables at few places and few other CSS corrections.
  4) Added iconfont-webpack-plugin, which will convert all the SVG files(monochrome) used as icons for buttons to font icons.
     This will allow us to change the color of the icon by using CSS color property.
  5) All the .css files will bundle into a separate file now- pgadmin.style.css. This will help reduce the size of
     theme CSS files as CSS in .css files will not change with the change of SASS variables.
2019-11-07 18:51:03 +05:30
Aditya Toshniwal
a7d8b9de8c Ensure that units are respected when sorting by file size in the File dialog. Fixes #4647 2019-11-01 15:00:34 +00:00
Akshay Joshi
7c271d21ae Fix 'placeholders are incompatible' issue in the message catalog.
Replace % with %% used in the explain module.
2019-10-14 12:51:34 +05:30
Aditya Toshniwal
d056a94f0c popen() function strips the quotes from the arguments, so backup fails
for the schema name that needs quoting.

Code is changed to add escapers.

Fixes #4590
2019-10-10 17:58:32 +05:30
Aditya Toshniwal
f16498a8a7 Optimize Webpack to improve overall performance.
Changes include:
1) Remove underscore-string and sprintf-js packages as we were using only %s. Instead, added a function to do the same. Also changed gettext to behave like sprintf directly.
2) backgrid.sizeable.columns was not used anywhere, removed. @babel/polyfill is deprecated, replaced it with core-js.
3) Moved few css to make sure they get minified and bundled.
4) Added Flask-Compress to send static files as compressed gzip. This will reduce network traffic and improve initial load time for pgAdmin.
5) Split few JS files to make code reusable.
6) Lazy load few modules like leaflet, wkx is required only if geometry viewer is opened. snapsvg loaded only when explain plan is executed. This will improve sqleditor initial opening time.

Reviewed By: Khushboo Vashi
Fixes #4701
2019-10-10 12:05:28 +05:30
Ashesh Vashi
6e4923d762 Fixes # 4778 - Implement the query plan analyzer
Look 'n' Feel and implementation logic are inspired from
'http://explain.depsez.com'.

It now creates three tabs under the 'Explain' panel when executing a
query using the Explain Analyze/Explain button from the toolbar of the
Query tool.

Graphical
---------
-> Graphical Explain Plan

Analysis
--------
-> Table to show details of the explain plan analyse.
-> Each row represents the statistics per Explain Plan Node
-> It may contains columns like node information, exclusive timing
   (time spent for this explain node excluding the child nodes),
   inclusive timing, actual rows, plan rows,
   rowsx (misestimation between planned vs actual rows), loop.
-> Background color of exclusive, inclusive, rows changes based on
   their values.
i.e.
If Percentage of exclusive, and inclusive timings of total query time
is:
> 90 - Red Color
> 50 - Orange (Between Red & Yellow Color)
> 10 - Yellow color

If planner misestimation for the rows is
> 1000 times - Red Color
> 100 times - Orange (Between Red & Yellow Color)
> 10 times - Yellow Color
Also - if actual rows <= planned rows then it shows up arrow, else it
shows down arrow.

Statistics
----------
-> It contains a HTML table for the statistics per Node Type, and
   a HTML table for the statistics per table.

Reviewed by: Akshay Joshi
2019-10-08 16:44:24 +05:30
Aditya Toshniwal
9a69d27009 Fix webpack issue where multiple assets emit to the same file. 2019-09-13 11:08:08 +05:30
Akshay Joshi
bdff046c57 1) Added ProjectSet icon for explain module. Fixes #2706
2) Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module. Fixes #2828
2019-08-20 16:47:53 +05:30
Aditya Toshniwal
0340b8fb28 Add EXPLAIN options for SETTINGS and SUMMARY. Fixes #4335
Prevent flickering of large tooltips on the Graphical EXPLAIN canvas. Fixes #4224
EXPLAIN options should be Query Tool instance-specific. Fixes #4395
2019-07-03 13:57:56 +01:00
Aditya Toshniwal
402dfd07db Change icons for table inheritance (icons by Chethana Kumar) Fixes #3174
Along with this, I have also fixed few other issues/icons found on the way:
1) Dependencies tab for inherited tables/foreign keys shows partial text (Fixes ##3994).
2) Dependencies tab for child partition table shows parent partition table as Function.
3) Dependencies tab for triggers shows trigger functions as plain functions.
4) Dependents tab for partitioned table shows the child partition tables as normal table instead for partitioned tables.
2019-06-17 10:36:30 +01:00
Murtuza Zabuawala
08b78fb6a1 Ensure we include the CSRF token when uploading files. Fixes #4350 2019-06-12 13:52:18 +01:00
Dave Page
6d52f2b911 Initial support for PostgreSQL 12. Fixes #4283. Fixes #4288. Fixes #4290. 2019-06-10 14:24:45 +01:00
Murtuza Zabuawala
32defc91cc Improve the performance of explain plan by embedding the images only when downloading it. Fixes #4307 2019-05-30 17:49:43 +05:30
Ashesh Vashi
9fdf68d559 Fix fatal error on launch of pgAdmin4. Fixes #4298 2019-05-28 17:05:54 +05:30
Aditya Toshniwal
dfa892d2a2 1. Added Master Password to increase the security of saved passwords. Fixes #4184
2. In server(web) mode, update all the saved server credentials when user password is changed. Fixes #3377
2019-05-28 12:00:18 +05:30
Khushboo Vashi
6f0eafb223 Fixed CSRF security vulnerability issue. per Alvin Lindstam. Fixes #4217
Initial patch by: Khushboo Vashi
Modified by: Ashesh Vashi and Murtuza Zabuawala
2019-05-28 10:59:51 +05:30
Aditya Toshniwal
036bd66638 Fix file browser path issue which occurs when client is on Windows and server is on Mac/Linux. Fixes #4164 2019-05-03 11:58:06 +05:30
Dave Page
c548eac5ef Append the file suffix to filenames when needed in the File Create dialogue. Fixes #4069 2019-03-14 15:48:21 +00:00
Khushboo Vashi
e4417229aa Update all Python and JS dependencies. Fixes #4019 2019-03-14 15:11:16 +00:00
Khushboo Vashi
622b67684d Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of 100. Fixes #3959 2019-02-14 11:15:01 +00:00
Akshay Joshi
93234c86b7 Fix alignment of submenu for Internet Explorer. Fixes #3932 2019-02-01 17:55:38 +05:30
Khushboo Vashi
6244463ac1 Fixed Statistics panel hang issue for 1000+ tables. Fixes #3664 2019-01-31 14:47:29 +05:30
Murtuza Zabuawala
d9fc9fdc4d Ensure object names in external process dialogues are properly escaped. Fixes #3872 2019-01-24 16:34:18 +00:00
Aditya Toshniwal
a9794d8ab4 Ensure that file format combo box value should not retained when hidden files checkbox is toggled. Fixes #3840 2019-01-21 16:22:59 +05:30
Aditya Toshniwal
7ac4e2a9d9 Fixed following issues:
- Process watcher made fixed width with header changes, time details rounded to 2 decimals
 - Query history will show "No query history" if no query fired. Query editor default size increased.
 - Fixed a bug where New folder create button not working when in List mode and No files/folder present.
 - Other minor improvements.
2019-01-16 11:55:08 +05:30
Aditya Toshniwal
d361e604c1 Further style tweaks. 2019-01-07 16:03:54 +05:30
Aditya Toshniwal
e9ba2e036a Further style tweaks. 2019-01-07 14:24:44 +05:30
Aditya Toshniwal
7d765fea04 Further styling fixes. 2019-01-03 14:50:24 +00:00
Murtuza Zabuawala
e23d307c56 Update copyright notices for 2019 2019-01-02 15:54:12 +05:30
Aditya Toshniwal
86ecf9c84e Fixed following:
- Base font size changed from 0.815rem to 0.875rem, for navbar from 0.875rem to 0.925rem.
- Dialog sizes made consistent throughout the application. Now there are 3 size options for width and height each - sm, md, lg. Combination of any of these to be used hereafter
- Alignment fix for controls of Node properties dialogs which includes showing text and label in one line without dialog size change, checkbox alignment, switch control alignment at places and other minor improvements in other dialogs
- Error message design change in dialogs validation
- SQL Editor data grid editor popup design changes which were missed
- Design change for dashboard server activity grid
- Login page language dropdown color fix
- Properties accordion collapse design fix
- Help, Info icon fixed across all dialogs which were not working if clicked exactly on the text
- Added missing icon with buttons at few places
- Shadow behind the dialogs is increased to make it look clearly separated and depth.
- Control Alignment fix in maintenance dialog
- Min height of alertify dialogs set for better UX
- File dialog design fix when no files found
- Grant wizard fixes - Scroll bar visibility on first page, use full space for SQL generated on the last page
- Browser toolbar buttons changed to sync with SQL editor toolbar buttons
- Rounded corners for docker floating dialog (no properties)
- Renaming file in file dialog should show original file name
- SQL data grid text edit popup buttons behaviour was swapped. This is fixed.
- Import/Export dialog changes as per new design.
2019-01-02 15:07:59 +05:30
Ashesh Vashi
5799ac14ba Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2

Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.

- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
  'web' mode
- Improved the look 'n' feel for the key selection in the preferences
  dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes

Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 17:14:55 +05:30
Murtuza Zabuawala
13dbfff11d Ensure identifiers are properly displayed in the plan viewer. Fixes #3821 2018-12-20 10:09:11 +00:00
Dave Page
d68eede3e6 Allow query plans to be downloaded as SVG files. Fixes #3589 2018-12-13 10:49:56 +00:00
Dave Page
6428ffcdaf Fix a minor CSS issue in the file dialogue's upload panel. 2018-12-04 13:12:02 +00:00
Akshay Joshi
6ddab02769 1) Fixed process watcher status message when user has stopped the process.
2) Saved the process state in sqlite database.
2018-10-25 17:03:34 +05:30
Aditya Toshniwal
091aa62084 Fixed background colour while replacing a file in File Manager dialog. 2018-10-24 17:53:06 +05:30
Akshay Joshi
6bc6bc7f60 Ensure that Utilities(Backup/Restore/Maintenence/Import-Export) should not be started
if binary path is wrong and also added 'Stop Process' button to cancel the process.
2018-10-22 12:35:53 +05:30
Usman Muzaffar
3f16a0c52c Log process exceptions using ASCII mode to avoid issues with string concatenation. 2018-10-11 13:13:08 +01:00
Aditya Toshniwal
0565f8dd78 Update to use Bootstrap 3 instead of Bootstrap 4. Fixes #3562 2018-10-10 12:43:26 +01:00
Akshay Joshi
7144db7f5a Cleanup session files periodically. Fixes #3674 2018-10-09 11:34:13 +01:00
Aditya Toshniwal
82c9cca683 Move all CSS into SCSS files for consistency and ease of colour maintenance etc. Fixes #2927 2018-09-04 11:24:51 +01:00
Akshay Joshi
7a3f3046df Merge pgcli code with version 1.10.3, which is used for auto complete feature. 2018-08-27 15:00:56 +05:30
Akshay Joshi
008359ad3a Ensure that refreshing a node also updates the Property list. Fixes #3461 2018-08-13 13:47:07 +01:00
Aditya Toshniwal
3b862bd70b More jQuery 3 updates. 2018-07-10 10:59:53 +01:00
Aditya Toshniwal
41a8333145 Replace deprecated success, error callbacks in $.ajax call with new functions .done and .fail. 2018-07-09 13:54:00 +01:00
Akshay Joshi
2b20b387e2 Add support for Trigger and JIT stats in the graphical query plan viewer. Fixes #3397 2018-07-06 13:13:14 +01:00
Aditya Toshniwal
82d77c4608 Don't create a session when the /misc/ping test endpoint is called. Fixes #3371 2018-07-05 11:12:03 +01:00
Khushboo Vashi
fb1ef9ac0b Properly support backups in Directory format. Fixes #3309 2018-06-29 15:14:37 +01:00
Akshay Joshi
4a71c6d7af Various EPAS/PG11 function & procedure fixes. Fixes #3421. Fixes #3422 2018-06-25 14:58:02 +01:00
Akshay Joshi
1f5ca1b540 Allow sorting in the file dialogue. Fixes #3273 2018-06-25 14:41:07 +01:00
Dave Page
9821e28da5 Fix file permissions per Devrim 2018-06-19 16:09:49 -04:00
Khushboo Vashi
ba8829b64f Further Python 2.6 fixes. 2018-06-15 15:03:53 +01:00
Khushboo Vashi
ab54a6d39a Fix external utilities to run with Python 2.6. 2018-06-15 12:38:31 +01:00
Akshay Joshi
b48145f01f Add an option to auto-complete keywords in upper case. Fixes #2686 2018-06-15 10:18:56 +01:00
Murtuza Zabuawala
e2b0cf6727 Fix labels and popups on EXPLAIN plan that were broken by the jQuery 3 update. Fixes #3404 2018-06-11 17:03:21 +01:00
Anthony DeBarros
a6ee27cf25 s/shutdown/shut down/ 2018-06-08 08:45:02 +01:00
Aditya Toshniwal
9f13865777 Update jQuery to 3.3.1. Fixes #3271
Patch by Aditya, with test enhancements from Anthony and Joao at Pivotal.
2018-05-25 16:26:37 +01:00
Murtuza Zabuawala
be055ce57d Update Python and JS modules. Fixes #3154 2018-04-04 10:47:01 +01:00
Murtuza Zabuawala
c312b03f6f Pass the service name to external processes. Fixes #3195 2018-03-19 11:01:04 +00:00
Murtuza Zabuawala
9ea118ca57 Ensure the file manager properly escapes file & directory names. Fixes #3196 2018-03-19 10:58:12 +00:00
Khushboo Vashi
63ba3402e8 Ensure SSL options are pushed down to external tools like pg_dump. Fixes #3122 2018-03-15 07:35:47 -04:00
Murtuza Zabuawala
faf243db71 Fixed PEP8 issue 2018-03-15 16:13:11 +05:30
Maxim Zakharov
54b1a79cb6 Sporadically crashes on Windows when exit. Fixes #3177
1) Shutdown the python server properly.
  2) Disabled "Shutdown server" menu till server is not successfully started.

Initial patch sent by Maxim, modified by Akshay Joshi.
2018-03-15 13:26:24 +05:30
Dave Page
3c686d3fbe PEP-8 fixes 2018-03-13 17:30:07 -04:00
Khushboo Vashi
802269910c Fix unicode handling in the external process tools and show the complete command in the process viewer. Fixes #2963. Fixes #3157. 2018-03-13 16:45:20 -04:00
Joao Pedro De Almeida Pereira
d1ab47c10c Disable function statistics on Greenplum. Fixes #3176 2018-03-07 11:52:02 +00:00
Khushboo Vashi
a4124c2496 PEP8 fixes. 2018-03-02 09:37:11 +00:00
Murtuza Zabuawala
6f25f4d175 Fix PEP-8 issues in feature_tests, dashboard, about and misc module's python code. Fixes #3082 2018-02-09 12:57:37 +00:00
Murtuza Zabuawala
6ad44cb51e Fix on-click handling of treeview nodes that wasn't refreshing SQL/Dependencies/Dependents in some circumstances. Fixes #3058 2018-02-01 14:44:12 +01:00
Murtuza Zabuawala
97760d65c2 Add keyboard navigation in Query tool module via Tab/Shift-Tab key. Fixes #2896
Note:
1) Once the keyboard shortcut infrastructure is ready we will add generic shortcut to focus out from CodeMirror editor and set foucs to next element, Right now there is no way of doing this, For testing purpose you can manually focus out from CodeMirror and click on data output panel to continue navigate using Tab key.
2) As of now inner panel's are not getting focused on Tab/Shift-Tab keys but once RM#2895 patch gets committed it will start working automatically as it's inherited code which will add tabindex tag automatically on each newly created wcDocker panel.
2018-01-25 12:27:13 +00:00
Chethana Kumar
5cea5f8485 Update scan and index scan EXPLAIN icons for greater clarity. Fixes #3021 2018-01-24 15:39:59 +00:00
Ashesh Vashi
c32eb6bd37 Fixed the warnings/errors reported by eslint for all the static
javascripts.
2018-01-12 13:00:14 +05:30
Murtuza Zabuawala
aec86970f2 Add ALT tags to images for accessibility. Fixes #2902 2018-01-08 12:43:36 +00:00
Dave Page
89821c0d19 Update copyright notices for 2018. 2018-01-05 10:42:50 +00:00
Murtuza Zabuawala
eae6f05b7c Allow files to be opened by double clicking on them. Fixes #2810 2017-12-18 09:48:14 +00:00
Murtuza Zabuawala
96a2987ef6 Prevent attempts to select directories as files in the file dialogue. Fixes #2937 2017-12-13 15:35:08 +00:00
Murtuza Zabuawala
22c38e4562 Fix a reference before assignment error in the file dialogue. Fixes #2934 2017-12-06 13:42:05 +09:00
Chethana Kumar
c74b348bac Update EXPLAIN icons. Fixes #2936 2017-12-06 11:45:02 +09:00
Murtuza Zabuawala
7fab041623 Prevent the user pressing the select button in the file manager when it is supposed to be disabled. Fixes #2923 2017-12-05 13:43:02 +09:00
Harshal Dhumal
7db7da5b0e Display process output as it happens. Fixes #2811 2017-11-27 13:00:47 +00:00
Harshal Dhumal
9212699936 When selecting an SSL cert or key, update only the expected path in the UI, not all of them. Fixes #2760. Fixes #2867 2017-11-21 15:59:44 +00:00
Alexander Lakhin
8f070f6095 Fix utility output capture encoding. Fixes #2854 2017-11-09 08:51:56 -05:00
Murtuza Zabuawala
8b543a58fe Fix a number of graphical explain rendering issues. Fixes #2824. Fixes #2842. Fixes #2843. 2017-11-06 19:59:01 -05:00
Alexander Lakhin
187ab22d90 Further missing translation fixes. Stats now:
1481 of 1831 messages (80%) translated in pgadmin/translations/de/LC_MESSAGES/messages.po
1694 of 1831 messages (92%) translated in pgadmin/translations/ja/LC_MESSAGES/messages.po
1748 of 1831 messages (95%) translated in pgadmin/translations/pl/LC_MESSAGES/messages.po
1750 of 1831 messages (95%) translated in pgadmin/translations/ru/LC_MESSAGES/messages.po
1436 of 1831 messages (78%) translated in pgadmin/translations/zh/LC_MESSAGES/messages.po
2017-11-06 19:49:20 -05:00
Alexander Lakhin
f15f46592a Tag some translations that were not, well, tagged. Current stats:
1481 of 1777 messages (83%) translated in pgadmin/translations/de/LC_MESSAGES/messages.po
1694 of 1777 messages (95%) translated in pgadmin/translations/ja/LC_MESSAGES/messages.po
1472 of 1777 messages (82%) translated in pgadmin/translations/pl/LC_MESSAGES/messages.po
1750 of 1777 messages (98%) translated in pgadmin/translations/ru/LC_MESSAGES/messages.po
1436 of 1777 messages (80%) translated in pgadmin/translations/zh/LC_MESSAGES/messages.po
2017-11-05 08:32:26 -05:00
Dave Page
b2186db562 Revert "Fix a number of cases where strings were not properly marked for translation."
This reverts commit 1f23838a4c due to unintended side
effects it caused - specifically, expanding Databases on the treeview displayed
Servers again
2017-11-03 16:45:20 +00:00
Alexander Lakhin
1f23838a4c Fix a number of cases where strings were not properly marked for translation. 2017-11-03 13:10:42 +00:00
Murtuza Zabuawala
f855ed88ce Allow selection of SSL certificates and pgpass files in connection properties. Fixes #2649. Fixes #2650 2017-09-28 10:02:33 +01:00
Ashesh Vashi
55e14e4d78 Handle the executor nodes, which are unknown to the Explain module,
gracefully by showing the 'ex_unknown.png' for such nodes.

Reported by: Murtuza
Refs #2706
2017-09-15 10:51:37 +05:30
Atul Sharma
788f7f3a69 Bundle fonts with pgAdmin so we have a standard set for all platforms.
Research by Shirley at Pivotal.
2017-09-13 16:01:14 +01:00
Ashesh Vashi
845025db8f Some cosmetic changes.
- Loading 'pgadmin' as 'sources/pgadmin', as found under the 'sources'
  reference directory to be consistent with other files.
- Removed the 'pgadmin' reference from the base.html template.
- Renamed 'pgadmin.slickgrid.editors.js', and
  'pgadmin.slickgrid.formatters.js' as 'editors.js', and 'formatters.js'
  respectively, as they're already in the 'pgadmin/static/js/slickgrid'
  directory.
- Removed the duplicate entry of 'translations' from the webpack.shim.js
2017-08-09 16:52:12 +05:30
Akshay Joshi
e506fa1dbe Improved alertify notification logic. Remove AlertifyWrapper class and extend notification methods in alertify itself. 2017-07-31 18:59:44 +05:30
Surinder Kumar
6d5417709c Moved the javascripts of different modules from 'templates' to 'static' directory.
Moving the javascripts for the following modules:
 - About
 - Browser nodes
 - Dashboard
 - FileManager
 - Vendor/snap.svg
 - Preferences
 - Settings
 - Backup
 - Datagrid
 - Debugger
 - Sqleditor
 - Grant Wizard
 - Import & Export
 - Maintenance
 - Restore and
 - User Management
2017-07-27 17:25:08 +05:30
Harshal Dhumal
831c614a60 Store the file dialog view on toggle. 2017-07-26 14:35:43 +01:00
Harshal Dhumal
97cd74a373 Default the file browser view to list, and make it configurable. Fixes #2579 2017-07-26 13:09:52 +01:00
Surinder Kumar
ae3acbdbbc Fix webpacking of loading icon. 2017-07-20 13:38:16 +01:00
Surinder Kumar
4a91bcde30 Webpack all the things! Fixes #2135
This significantly speeds up loading of the application; in an average of 3 tests, v1.6
loaded in 11.5s in the runtime on a Mac, whilst the webpacked version of the code
loaded in 5.53s.
2017-07-18 15:13:17 +01:00
Harshal Dhumal
8bbcf0ab36 Fix handline of large file uploads and properly show any errors that may occur. Fixes #2153 2017-07-17 10:51:26 +01:00
Murtuza Zabuawala
3f83780049 Remove the comma from PIDs in the statistics panel. 2017-07-17 10:18:31 +01:00
Murtuza Zabuawala
6d3d2cd458 Handle un-mounted drives correctly on Windows. Fixes #1999 2017-07-10 14:04:57 +01:00
Joao Pedro De Almeida Pereira
2a30a86e7d Update alertify alerts to use the styling defined in the styleguide. 2017-06-30 10:21:05 +01:00
Akshay Joshi
794b70daea Fixed issue of opening file manager dialog from Query Tool. 2017-06-13 15:48:12 +05:30
Ashesh Vashi
1a7c9d5ca1 Using client-side 'url_for' implementation in the module - bgprocess
(background-processes).
2017-06-13 09:18:48 +05:30
Surinder Kumar
af43ccfc07 Teach dialogues about Escape to cancel, Enter to Save/OK, and F1 for help. Fixes #1535 2017-06-12 16:43:29 +01:00
Ashesh Vashi
fd3ddbeafb Implementation of the client side 'url_for(...)' function.
Created a url_for function module to be used by different javascript
modules to use the same functionality of flask at client side.

A python module can expose the list of endpoints, used by its
javascripts, by overriding the 'get_exposed_url_endpoints(self)'
function.

In this patch, we have modified all the browser modules to use this
function. It will allow us to move the majority of the javascript
modules of browser nodes from templates directory to the static
directory.

TODO::
- Move these javascripts modules to the static directory.
- Use this function in all the applicable javascript modules.
  e.g. tools, miscellaneous modules
2017-06-12 12:01:25 +05:30
Ashesh Vashi
ae80976689 Using the client-side translation using the client-side 'gettext'
implementation.

This is the first step towards 'Avoid creating the javascript modules
using Jinja templates'.
2017-06-07 15:53:05 +05:30
Murtuza Zabuawala
a4d86d24e6 Cache statistics more reliably. Fixes #2357 2017-06-05 17:01:03 +01:00
Murtuza Zabuawala
1cb2a62fa8 Ensure object names are properly escaped for external process management. Fixes #2405 2017-05-15 13:01:12 +01:00
Murtuza Zabuawala
13f4432bbd Support loading files with Unicode BOMs. Fixes #2369 2017-05-09 12:06:49 +01:00
Khushboo Vashi
94b7fc483a Fix sorting of sizes on the statistics views by sorting raw values and prettifying on the client side. Includes Jasmine tests for the prettyfying function. Fixes #2315 2017-05-08 11:29:13 +01:00
Murtuza Zabuawala
928c0d3de8 startsWith() function of java script is not supported in IE, instead use startsWith() function of underscore string. Fixes #2347 2017-04-25 12:00:15 +05:30
Jonas Thelemann
b8566a0127 Un-split some strings for translateability. And so begins the battle between gettext and pep8... 2017-04-05 15:05:11 +01:00
Jonas Thelemann
65f21a8cd7 Replace all occurrences of "can not" with "cannot". 2017-04-05 13:38:14 +01:00
Sarah McAlear
1d27341e21 Fix translation extraction for new client side translations, and update catalogs. 2017-03-28 15:21:49 -04:00
Khushboo Vashi
0eda6033df Allow users to select UI language at login or from Preferences rather than unpredictable behaviour from browsers. Fixes #2190 2017-03-24 14:20:10 +00:00
Ashesh Vashi
7767c085c3 Resolved an issue finding the python interpreter on *nix systems, and
Windows 2008 R2 (32 bit), while running the pgAdmin 4 as runtime for
the PostgreSQL one click installers.

- Found a typo in runtime code, we were appending the path using ';' on
  *nix systems too. We should have used ':', and that did not allow the
  os.environ['PATH'] to identify the correct path of the python
  interpreter under the 'venv' directory.

- On Windows 2008, it was not honouring the environment variables, set
  under the Qt application (e.g. pgAdmin4.exe runtime), in the python
  application. (e.g. pgAdmin4.py). We will need to assume that - the
  python interpreter resides under the 'venv' directory outside the
  'bin' directory.

- Also, on windows 2008, it was setting PYTHONHOME environment variable
  to the full path of the pgAdmin4.exe, we need to reset it to 'venv'
  directory, if we find the python interpreter under it.

Thanks Murtuza Zabuawala for tips, and help.
2017-03-10 21:19:06 +05:30
Murtuza Zabuawala
bc63652811 Fix the issue where Import/Export was failing in linux runtime. Fixes #2166
Issue:
Changes done by Ashesh in pgAdmin4.py file for setting up PYTHONHOME variable to sys.prefix was applicable only for windows only.

Additionally I have also added exception handling for file provided by user for Backup/Restore/Import/Export.
2017-03-09 09:54:55 +00:00
Jonas Thelemann
c34f5fd2d4 Use "could not" consistently, instead of "couldn't" which was used in some places. 2017-03-07 10:29:54 +00:00
Ashesh Vashi
f2fc1ceba8 Resolved quite a few file-system encoding/decoding related cases.
In order to resolve the non-ascii characters in path (in user directory,
storage path, etc) on windows, we have converted the path into the
short-path, so that - we don't need to deal with the encoding issues
(specially with Python 2).

We've resolved majority of the issues with this patch.
We still need couple issues to resolve after this in the same area.

TODO
* Add better support for non-ascii characters in the database name on
  windows with Python 3
* Improve the messages created after the background processes by
  different modules (such as Backup, Restore, Import/Export, etc.),
  which does not show short-paths, and xml representable characters for
  non-ascii characters, when found in the database objects, and the file
  PATH.

Fixes #2174, #1797, #2166, #1940

Initial patch by: Surinder Kumar
Reviewed by: Murtuza Zabuawala
2017-03-07 15:31:03 +05:30
Murtuza Zabuawala
6d6a3753ee Fix the path to the busy indicator for the treeview which changed when the aciTree module was moved. 2017-03-06 10:36:07 +00:00
Sarah McAlear
a0a31e55ae Move 3rd party client code into vendor/ directories for ease of maintenance. 2017-02-24 17:01:21 +00:00
Murtuza Zabuawala
9ad1316990 Various encoding fixes. Fixes #2160 2017-02-16 11:00:40 +00:00
Murtuza Zabuawala
a914ea088c Python 2.6 compatibility fixes. 2017-02-08 16:28:04 +00:00
Murtuza Zabuawala
4d8683e13a Fix display of graphical query plans for UPDATE/DELETE queries. Fixes #2133 2017-02-06 10:43:31 +00:00
Ashesh Vashi
b7c5039416 Fix process execution. Fixes #1679. Fixes #2144.
Re-engineer the background process executor, to avoid using sqlite as some builds of
components it relies on do not support working in forked children.
2017-02-04 15:26:57 +01:00
Neel Patel
c17e201a92 Handle saved directories that no longer exist gracefully. Fixes #2110 2017-02-03 15:19:21 +01:00
Harshal Dhumal
4ef26a528b Allow direct navigation (i.e. typing of paths) in the file manager. Fixes #1911 2017-02-03 10:51:36 +01:00
George Gelashvili
6d05302ca1 Rename the 9.1_plus templates to "default" to more appropriately support Greenplum which is based on 8.3. 2017-02-01 09:57:49 +00:00
Neel Patel
8d71e888b4 Remember the last used directory in the file manager. Fixes #1910 2017-01-08 15:27:59 +05:30
Dave Page
a93a99fdc0 Improve query plan tooltip formatting. 2017-01-06 15:38:27 +00:00
Dave Page
f221194bcc Update copyright notices for 2017. 2017-01-04 13:33:32 +00:00
Ashesh Vashi
dbff4f7977 Minor Python 3/encoding fix in the file manager. 2016-12-12 09:49:00 +00:00
Surinder Kumar
a64824a851 Fix various encoding issues with multibyte paths and filenames.
Fixes #1986. Fixes #1940.
2016-12-05 13:10:56 +09:00
Dave Page
29743ad3c4 Allow selection of process output and commands. 2016-11-18 12:05:19 +00:00
Murtuza Zabuawala
e6d018c44f Ensure we handle external processes that fail to start. Fixes #1679 2016-10-21 15:35:06 +01:00
Surinder Kumar
1e66119ef5 Ensure the File Manager honours the file type while traversing the directories. Fixes #1858
When a File Manager is closed by clicking cancel button. Its dom element not destroyed.. So on traversing into directories, when it tries to get currently selected file type, it looks into the dom element but it gets dom of previous dialogs not of currently dialog.

Now whenever an instance of File Manager is closed. its dom elements are also destroyed.
2016-10-21 14:26:12 +01:00
Surinder Kumar
d806a9ce9e Fix the file manager when used under Python 3. Fixes #1872
Issues fixed:

1) In Python 3, parameter "cmp" is removed from sorted method. So File Manager won't open.
As we are sorting data on JS side using Natural sort, so on server side sorting is not required.

2) Improvement in Exception handling.
2016-10-21 12:43:02 +01:00
Surinder Kumar
df09f02e80 List files/folders alphabetically, and don't excessively truncate their names. Fixes #1792 2016-10-18 11:39:12 +01:00
Surinder Kumar
3963272523 Don't show Upload File icon unless it is in capabilities list [Storage Manager]. Fixes #1739
Issue:
When clicked on upload icon while saving a file prompt user to leave page. It is because the icon is a button and its type is set to submit which makes it to prompt, instead it should be 'button'

Storage Manager's menu items depends on capabilities list set by the module using it. If capabilities doesn't have 'upload' in it, It won't work. Upload button is bound to click event only when it is in capabilities.

Solution:
As upload button is being added only when it is in capabilities, so upload button html is removed from html file. It will not shown on UI untill it is in capabilities list.
2016-10-07 12:31:38 +01:00
Surinder Kumar
3b4776ab5f Improve network/server activity feedback for the user. Fixes #1751 2016-09-26 15:10:38 +01:00
Surinder Kumar
3dace5ff22 Fix file navigator to properly show drives in Windows. Fixes #1665 2016-09-05 17:07:07 +01:00
Ashesh Vashi
b6f307256b Sorting the data during tree data loading using the natural sort
algorithm.

This patch takes care of:
* Consistent behaviour during create, update operation on any node.
  - It should return the node data during creating a new object, or
    updating the existing one.
* Now that - we have consistent behaviour during these operations, we
  can consistently move, update the tree item based the node data from
  the server.
* Implemented the methods for each node to get the information about
  that particular node only.
* Using the above changes to implement the 'refresh' operation on tree
  node properly.

I must thank Surinder, and Harshal for helping me implement the 'node'
method, and also changed the behaviour of create & update methods to
return the node data for most of the nodes.

Fixes #1244
2016-08-29 20:06:58 +05:30
Ashesh Vashi
f12d981a9d Handling the bad/lost connection of a database server.
Made backend changes for:
* Taking care of the connection status in the psycopg2 driver. And, when
  the connection is lost, it throws a exception with 503 http status
  message, and connection lost information in it.
* Allowing the flask application to propagate the exceptions even in the
  release mode.
* Utilising the existing password (while reconnection, if not
  disconnected explicitly).
* Introduced a new ajax response message 'service_unavailable' (http
  status code: 503), which suggests temporary service unavailable.

Client (front-end) changes:
* To handle the connection lost of a database server for different
  operations by generating proper events, and handle them properly.

Removed the connection status check code from different nodes, so that
- it generates the proper exception, when accessing the non-alive
  connection.

Fixes #1387
2016-08-29 12:01:35 +05:30
Dave Page
6701bb191d String fix. 2016-08-17 15:10:33 +01:00
Surinder Kumar
a43f053a10 Fix file upload in File Manager in pgAdmin4 Runtime. Fixes #1397 2016-08-04 16:34:30 +01:00
Dave Page
790b28fb61 Flask-Babel 0.11+ compatibility. Fixes #1496 2016-07-25 17:23:10 +01:00
Dave Page
60659975ed Stop using deprecated imports. 2016-07-22 16:25:23 +01:00
Murtuza Zabuawala
419ead9121 Ensure ajax requests are sent on second click of an object. Fixes #1462 2016-07-21 13:26:09 +01:00
Surinder Kumar
1a129cf30e File management dialogue enhancements:
- Double click on file/folder icon or name will navigate to the folder/file.
- Selected file/folder can be renamed by Rename button only. Double click rename is removed.
- Filename text box will not hide on smaller screen. Setting minimum width of File Browser fixed it.
- Path at top will only show directory name, not the file name and it is greyed out
2016-07-15 10:50:25 +01:00
Surinder Kumar
53434030c1 Consistent busy indication. Fixes #1242 2016-06-29 12:16:02 +01:00
Harshal Dhumal
9396cb03d5 Fix intermittent CodeMirror rendering issue. Fixes #1399 2016-06-29 11:19:04 +01:00
Dave Page
1222681888 Revert "Display busy indicators in a much more consistent way. Fixes #1242"
This reverts commit 7fbefa507b which seems to be
missing things.
2016-06-29 10:32:20 +01:00
Dave Page
7fbefa507b Display busy indicators in a much more consistent way. Fixes #1242 2016-06-27 17:09:37 +01:00
Dave Page
78d329fc47 Don't blink the elapsed time - it's distracting. 2016-06-24 14:01:23 +01:00
Dave Page
7d0fe669ca Code tidy. 2016-06-21 14:21:06 +01:00
Dave Page
3026b470e9 Optimise Python imports. 2016-06-21 14:12:14 +01:00
Ashesh Vashi
a35288e25d Save the runtime status information in the application object for using
it other places.

globals() does not return consistent value across the application
context.

Thanks Neel Patel for reporting the issue.
2016-06-21 15:13:04 +05:30
Ashesh Vashi
bfe1b773b3 Do not rely on config.SERVER_MODE for determining (if it is running from
runtime, or time), instead check the environment variable PGADMIN_PORT
to do that as per Dave.
2016-06-20 22:00:16 +05:30
Ashesh Vashi
800d5d71d7 Use the python interpreter explicitly while running the background
process from the runtime.
2016-06-20 21:31:19 +05:30
Dave Page
05e7ee5a05 Second attempt at fixing the file handling code. Tested on Mac and Windows in both desktop and server modes. 2016-06-17 22:05:49 +01:00
Dave Page
2c62d1a4b7 Revert "Make the file manager work a little more sanely with regard to paths."
This breaks things even more on Windows :-(

This reverts commit 35243b9869.
2016-06-17 18:19:51 +01:00
Dave Page
35243b9869 Make the file manager work a little more sanely with regard to paths. 2016-06-17 17:12:04 +01:00
Dave Page
1172e31019 File dialogue layout tweaks. 2016-06-17 17:11:30 +01:00
Dave Page
a53811ef27 Get rid of canvas colouring in graphical explain. 2016-06-17 16:34:03 +01:00
Dave Page
f2b6ab816b Process manager UI cleanup. 2016-06-17 15:24:15 +01:00
Dave Page
fd6c43b393 String improvements. 2016-06-17 14:21:14 +01:00
Murtuza Zabuawala
b94b47f021 Fix issue which was showing incorrect datetime in Backup/Restore dialog. Fixes #1377 2016-06-17 13:54:31 +01:00
Surinder Kumar
9e8e3fc787 Fix file selection on Windows. Fixes #1319
1) Unable to select sql file through query tool on windows OS. In file_manager.js, we are stripping initial slash '/' from the path obtained, but we should not strip if it is full path like 'c:/path/to/dir/filename.ext'

2) Handle directory path if STORAGE_DIR is None. Proper checks are added.
2016-06-10 17:06:22 +01:00
Murtuza Zabuawala
47007076cc Fix validation issue causing statistics tab to break if no node is selected on browser tree and user clicks on statistics tab. 2016-06-08 12:48:34 +01:00
Surinder Kumar
a871b15fe9 When any of the docked tab(statistics, dependents & dependencies)
are clicked without selecting any tree node. it gives error in browser
console panel.
Because the node passed is undefined. and check is missing. This is now
fixed by adding check for node passed.
2016-06-08 12:46:30 +01:00
Murtuza Zabuawala
ac2612264c Fix validation of object before using it 2016-06-07 12:37:58 +01:00
Ashesh Vashi
486da5e12c Fixed issue only coming in the runtime.
* Do not need to translate an empty string. (that results into the
  translation header inclusion in the javacript module).
* String.prototype.StartsWith is not an well received function, it has
  not been available in the QWebkit for linux.
2016-06-02 13:15:26 +05:30
Murtuza Zabuawala
af84ba5a4f Fixed all the review comments from Dave.
* Moved the Columns, and Constraint to its repective tabs.
* Ensure all the labels only have a capital letter on the first word
  (except for keywords or acronyms).
* Resolve the typo in string - 'System table'.
* Error messages on fields should not be shown unless the field loses
  focus and has an error.
* "General" section should have a limited subset of information.
* Variables grids should not be on the Security tab.
* Fixes the field labels that imply a question.
* Privileges controls on the Properties lists should be in a "Security"
  group.

Apart from review comments improved few other areas too:
* Used in-place DepsCell functionality for columns in both index, and
  type node.
* Improved the error handling in constraint nodes.
* Added create, alert SQL Help for nodes associated with the table node.
2016-05-24 23:29:55 +05:30
Akshay Joshi
0a354055a9 Adding support for autocomplete in the SQL Editor.
In Query editor, we can use the autocomplete feature by using keyword
combination - 'Ctrl + Space'.
2016-05-21 16:04:29 +05:30
Neel Patel
da28dc8507 Added support for importing and exporting the table data. 2016-05-21 15:43:43 +05:30
Surinder Kumar
3120ce1909 Fixes few issues with File Manager.
- Rename file/folder not working in list view.
- Selection folder only should not allow to select file.
- Ui changes in table list to match with the pgadmin color styles.
- Custom STORAGE_DIR path don't list files/folders when opened in window
  system.
- Code cleanup, formatting & did proper commenting.
- In file selection mode, the value typed in text box not setting into
  backbone model.
- Removed create file code, it should be handled on module using it.
- Written a common function to make ajax request, instead of writing
  individual functions for same task.
2016-05-21 15:02:05 +05:30
Ashesh Vashi
d1e3237e2e Fixed misc issues 2016-05-16 19:51:15 +05:30
Ashesh Vashi
76087f3df3 Fixed issue while using decode() without checking type of the variable. Type maybe string or byte. 2016-05-16 13:22:10 +05:30
Ashesh Vashi
3bbfd8a19f Loading the explain.js as 'application/javascript'
On some older version of browser, it was considering it as HTML.

Thanks Neel Patel for reporting.
2016-05-16 11:28:23 +05:30
Ashesh Vashi
28af92d386 Resolved a bug about listing file type listing, 'All Files' were listed
twice in some cases.
2016-05-16 02:43:38 +05:30
Ashesh Vashi
63b951baee Adding initial version for showing statistics for the server, and
database nodes.
2016-05-16 01:58:02 +05:30
Sanket Mehta
fcc3d112e2 Integrate the graphical explain module in the Query Editor.
Added few TODO list for the graphical explain module by Ashesh.
2016-05-16 01:07:54 +05:30
Ashesh Vashi
ca62825c90 Set PGPASSWORD environment variable from the process executor before running
the external utility.
2016-05-15 22:29:17 +05:30
Murtuza Zabuawala
8ca760ee2b Addd support for taking backup for the server.
Tweaked by Ashesh Vashi to integrate the backgroud process, and also
with some improvements as stated below:
* Resolved an issue loading existing preference.
* Improved the background process observer/executor for supporting
  detalied view.
* Added the utility path preferences in the ServerType class.
2016-05-15 16:04:39 +05:30
Ashesh Vashi
fe0911f285 [Python 3 compatibility] Improved the background process executor to
work with Python 3.
2016-05-15 00:03:25 +05:30
Surinder Kumar
1aeab98a2b Load, and save the files in the Query Editor.
Also, the changes done by Ashesh to resolved few issue with the file
manager in 'Select' mode.
2016-05-14 15:29:08 +05:30
Ashesh Vashi
b22d73ec46 Improvise the pgsql driver to keep the utility names used for different
operation like backup, restore, etc within it.

Also:
* improvised the color combination of the background process logger.
* Removed an unnecessary print statement from the
  get_storage_directory(..) function, also return None if STORAGE_DIR
  is set to None.
2016-05-14 00:48:20 +05:30
Surinder Kumar
5348f6e96a Improvised the file manager functionalities as per comments given:
* Do not show the drives on windows, if STORAGE_DIR is set.
* Do not show non-applicable buttons, whenever no files/directory
  present in the storage directory.
* Showing dimmer under the warning messages for replace/delete.
* Select file type other than 'All Files' in create/replace mode.

Tweaked a bit by Ashesh.
2016-05-14 00:42:41 +05:30
Akshay Joshi
8e4e1640e7 Fixed cStringIO and StringIO module compatibility in python 2016-05-13 11:22:59 +05:30
Ashesh Vashi
f682f06c94 Adding a background process executor, and observer.
We will be using the external utilities like pg_dump, pg_dumpall,
pg_restore in background. pgAdmin 4 can be run as a CGI script, hence -
it is not good idea to run those utility in a controlled environment.
The process executor will run them in background, and we will execute
the process executor in detached mode.

Now that - the process executor runs in detached mode, we need an
observer, which will look at the status of the processes. It also reads
output, and error logs on demand.

Thanks - Surinder for helping in some of the UI changes.
2016-05-13 08:49:51 +05:30
Ashesh Vashi
9cdd1f8098 Added support for the server side file manager, which will be useful in
selection, creation, upload/download files/directories resides on the
server side.

This will be useful for file selection/creation for different server
side utilites like pg_dump, pg_dumpall, pg_restore.
2016-05-13 00:04:32 +05:30
Dave Page
1efba422bc Fix comment marker. 2016-05-06 10:23:17 +01:00
Ashesh Vashi
085ce50545 Refresh the SQL control, whenever necessary.
Also, remove the CodeMirror object for better clean up process.

When a SQL control/tab is rendered in a hidden element, it does not
render really well. Because - it rely on the height, and width of the
container to count the gutten position, and margin, and other elements.

Hence - whenever the tab, panel becomes visible, we will refresh the
control.
2016-04-22 15:29:23 +05:30
Ashesh Vashi
e07ebdc049 Moving the messages used in common utilities in a separate javascript. 2016-04-11 17:07:58 +05:30
Neel Patel
3969e91563 Add support for Foreign data wrappers, servers and user mappings. 2016-03-17 11:39:38 +00:00
Dave Page
62bd1a21cc Improve message display. 2016-03-15 15:45:40 +00:00
Neel Patel
000c76871f Updated the misc module javascripts to work with latest wcDocker. 2016-02-29 19:37:24 +05:30
Akshay Joshi
c153032e3b Add support for displaying dependency and dependents info. 2016-02-22 13:07:16 +00:00
Dave Page
2233583dbd Avoid unnecessary redraws of the SQL pane. 2016-02-17 10:43:02 +00:00
Ashesh Vashi
8120b380bb Introduced a event manager for the browser, which will generate certain
known events, when any activity happens on the browser layout.

The following types of events will be triggered through the browser
event manager.
- pgadmin-browser:frame:* [1]
- pgadmin-browser:frame-<name>:* [1]
- pgadmin-browser:panel:* [1]
- pgadmin-browser:panel-<name>:* [1]
- pgadmin-browser:panel
- pgadmin-browser:frame
- pgadmin-browser:tree
- pgadmin-browser:tree:* [2]

[1] The '*' denotes some of the events generated by the wcDocker, which
    can be useful to do some operations.
	These events are:
	+ wcDocker.EVENT.UPDATED
	+ wcDocker.EVENT.VISIBILITY_CHANGED
	+ wcDocker.EVENT.BEGIN_DOCK
    + wcDocker.EVENT.END_DOCK
	+ wcDocker.EVENT.GAIN_FOCUS,
	+ wcDocker.EVENT.LOST_FOCUS
	+ wcDocker.EVENT.CLOSED
	+ wcDocker.EVENT.BUTTON
	+ wcDocker.EVENT.ATTACHED
	+ wcDocker.EVENT.DETACHED
	+ wcDocker.EVENT.MOVE_STARTED
	+ wcDocker.EVENT.MOVE_ENDED
	+ wcDocker.EVENT.MOVED
	+ wcDocker.EVENT.RESIZE_STARTED
	+ wcDocker.EVENT.RESIZE_ENDED
	+ wcDocker.EVENT.RESIZED
	+ wcDocker.EVENT.SCROLLED

[2] The '*' denotes all the events generated by the Browser Tree
    (aciTree).

The extension modules can utilize these events to do some operations on
nodes, and panels.

This patch includes showing 'Reversed Engineered Query' for the selected
node (if allowed) using the above approch.

The ShowNodeSQL module looks for two events.
1. SQL Panel Visibility change.
   - Based on the visibility of that panel, we start/stop listening the
	 node selection event.
2. Node Selection in Browser tree
   - Based on the selected node type, it will look for 'hasSQL'
	 parameter of the node, and fetch the Query from the server, and
	 show it in the SQL editor.
2016-01-19 18:18:47 +05:30
Dave Page
694506453b Copyright updates for 2016. 2016-01-18 14:48:14 +00:00
Ashesh Vashi
e27e39a8f3 Added support for the infrastructure for on demand access/create the
server connection.

The BaseDriver and BaseConnection are two abstract classes, which allows
us to replace the existing driver with the currently used. The current
implementation supports to connect the PostgreSQL and Postgres Plus
Advanced Server using the psycopg2 driver.
2015-10-20 12:33:29 +05:30
Ronan Dunklau
eb6580b43a Introduced a PgAdmin class inherited from the Flask, which looks for
submodules inherited from the PgAdminModule instead of regular
Blueprint. This allows us to load the module automatically from the
under the pgadmin directory, and will work to extend the pgAdmin
extension module.

PgAdminModule is inherited from the Blueprint, and bring several
methods:
-  get_own_stylesheets, which returns the stylesheets used by the module
   (excluding its submodules stylesheets)
- get_own_javascripts
- menu_items, which returns a dictionray mapping the old hook names
  (context_items etc) to a list of MenuItem instances

For more specialized modules (as for now, any module that should be part
of the browser tree construction), one can define an abstract base class
defining additional methods.

For example, the BrowserPluginModule abstract base class defines the
following methods:
- jssnippets
- csssnipeets
- node_type
- get_nodes
2015-06-29 12:28:41 +05:30
Dave Page
fe834d1ed2 Re-organise node structure and loading to make things somewhat more
simple. This also adds the ability to display servers on the treeview.
2015-03-10 13:09:11 +00:00