Commit Graph

44 Commits

Author SHA1 Message Date
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