Commit Graph

742 Commits

Author SHA1 Message Date
Murtuza Zabuawala
2da3a710a1 Added support for restoring a tar/custom type backup file in a object.
Tweaked by Ashesh Vashi as below:
- Integrated it with the background process executor, and observer.
- Improved the message format of the backup module messages.
- Created an item in TODO list to list down the objects in the selected
  backup file.
2016-05-15 20:00:02 +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
Ashesh Vashi
491bd3605b Fixed an issue creating extensions 'postgis_topology', and
'postgis_tiger_geocoder'.

Current implementation changes the schema name, whenever we chance the
name, which is wrong. We should have not change the schema for this
event.

Thanks Fahar Abbas for reporting.
2016-05-14 15:42: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
Neel Patel
4dc7f84761 Added functionality to Pause/Resume replay of WAL on the database
server.

Tweaked a little bit by Ashesh.
2016-05-14 01:41:20 +05:30
Harshal Dhumal
14839bf5de Always make sure - we convert the psasword to string in the as_dict
function.
2016-05-14 01:14:26 +05:30
Surinder Kumar
cc91a538e0 Fixed the canDrop function of the node menus does not get called during
enable/disable menu checks.

Tweaked a little bit by Ashesh.
2016-05-14 01:10:20 +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
Surinder Kumar
938ea21f40 Fixed following issues:
1) Grant wizard close issue.
   2) Moved grant wizard specific css from wizard.css to grant_wizard.css
   3) removed 'ajs_content' css from wizard.css causing padding issue in alertify dialog
2016-05-13 15:04:36 +05:30
Murtuza Zabuawala
174363c9a7 Fixed typo for acl in tablespace node 2016-05-13 13:43:35 +05:30
Harshal Dhumal
4816f5ed12 Change server password feature 2016-05-13 13:21:20 +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
512e11c47c 'pgadmin.utils.storage' has been renamed to 'pgadmin.utils.paths'. Resolved the typo. 2016-05-13 00:36:45 +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
Harshal Dhumal
180630ce0e Fixed variable scope issue in server.js 2016-05-10 18:16:08 +05:30
Murtuza Zabuawala
83b6a04763 Added input validation and title of the prompt for 'Named Restore point' functionality 2016-05-10 16:04:47 +05:30
Harshal Dhumal
585daddce2 Destroy the existing Select2 object before rerendering the control. 2016-05-12 16:14:06 +05:30
Ashesh Vashi
d768faf2ea Do not validate the attributes on saving, because - sometimes it results
into an error, and does not call the callback - 'success/fail'
internally.

And, that will not close the property dialog in those cases.

Reported by Harshal Dhumal.
2016-05-12 15:51:21 +05:30
Harshal Dhumal
a4d981cced Remove all the object view control within the subnode control, whenever
we remove it.

It will remove all the events, controls, elements, etc associated with
the subnode control.
2016-05-12 15:47:36 +05:30
Murtuza Zabuawala
40a9490382 Check for the connection status before executing the statement for
checking the 'server in recovery' information.

Thanks Khushboo for reporting the issue.
2016-05-12 13:23:24 +05:30
Ashesh Vashi
7f790a7f49 Use the same cursor object of a connection object only from the same
server.

Current implementation keeps the cursor object in the 'g' (current
request context) object identified by the connection-id.
But - it fails to identify a different connection object request, when
we have same database name in different database server, it does not
able to identify it as separate request, Hence - now we will use
server-id qualified identifier for the same object.

Thanks Neel Patel for pointing out the issue.
2016-05-12 13:08:38 +05:30
Dave Page
81e59be1bd Fix menu width. 2016-05-11 16:34:25 +01:00
Murtuza Zabuawala
23f0cf07ca Allow creation of named restore points. 2016-05-11 16:13:14 +01:00
Ashesh Vashi
7513cebd8c Load only one set of CSS files per module.
There are times, a module is loaded multiple times, and returns same set
of CSS files mulitple times, in order to avoid loading the same file
multiple times, we will create a set out of the list of CSS files.
2016-05-11 12:46:16 +05:30
Surinder Kumar
01e83f1807 Adding missing dependency 'underscore.string' in the 'menu.js'. 2016-05-11 12:11:06 +05:30
Murtuza Zabuawala
ce043fbe07 Python 3 compatibility fix - iteritems() is deprecated. 2016-05-10 17:01:11 +01:00
Ashesh Vashi
9cae686c65 Allow the modules to define the i18n messages, and other messages
required by its javascript module.

This will allow us to load the javascript modules as a static file, and
not as a Jinja2 template. This will increase the load time, as it will
decrease number of templates to be processed during loading those
javascripts.
2016-05-10 16:07:48 +05:30
Ashesh Vashi
d8cbee3850 Adding the timeout for the connection on the configuration database.
While accessing the configuration database from multiple session, it
results in to the error - OperationError, because - sqlite locks all the
database, and does not allow to access it simultaneously. We added the
timeout to give some time window for accessing it simultaneously.
2016-05-10 15:59:04 +05:30
Neel Patel
8cfca280d4 Fixed issue 'Reload Configuration' option is also enabled on database node while it should only be enabled on server node 2016-05-09 23:22:35 +05:30
Harshal Dhumal
176b99c90b Added the multiple selection support in the Select2Cell 2016-05-10 13:48:54 +05:30
Sanket Mehta
817bdd0108 Fixed typos in FTS DICTIONARY node 2016-05-10 12:53:39 +05:30
Harshal Dhumal
baae12dfcc Improve the password error message color on the 'Change Password' page. 2016-05-10 12:47:51 +05:30
Khushboo Vashi
dd7bde5ab8 Introduced the dependencies logic functionality (used in the backform),
which will allow us to add dependencies other model attributes on custom
backgrid cell.
2016-05-10 12:40:56 +05:30
Khushboo Vashi
7a400bacf3 Do not send the incomplete definition of a node object to the server
instead show proper message.

Tweaked by Ashesh for adding the proper message
2016-05-10 12:34:24 +05:30
Ashesh Vashi
e8b4bb909b Do not honour the session-id, longer than 40 characters, instead create
new session-id in that case.
2016-05-09 00:04:37 +05:30
Ashesh Vashi
b383c67fa5 Treat the Array different from the Object to make sure session tracking
works well with it.
2016-05-08 23:55:57 +05:30
Khushboo Vashi
e522ebbcca Ensure delete/drop works without JS errors. 2016-05-06 15:47:21 +01:00
Khushboo Vashi
f3d05279a7 In IE10, the Save/Reset buttons are not getting enabled after changing fields. 2016-05-06 15:29:32 +01:00
Murtuza Zabuawala
3eb51e93e7 Allow Werkzeug to be configured to bind to adaptors other than localhost for testing. 2016-05-06 15:25:52 +01:00
Neel Patel
4190933909 Allow the server config to be reloaded. 2016-05-06 15:08:22 +01:00
Khushboo Vashi
86c4dd06b5 Fix dependents/dependency icons. 2016-05-06 14:50:17 +01:00
Murtuza Zabuawala
94303867dd Fix a typo introduced in a merge. 2016-05-06 13:58:31 +01:00
Karen Blatchley
949e536bae First round of string review and cleanup. 2016-05-06 13:53:48 +01:00
Akshay Joshi
894002b06d Fixed below review comments for QueryTool
- The button bar be moved out into an HTML template
 - create.sql should perhaps be renamed to insert.sql
 - The "Add Row" button only works if you're on the last page of the resultset.
 - Use one wcDocker instead of two
 - Added support of code folding
2016-05-06 18:09:04 +05:30
Akshay Joshi
7867adaa53 Added dependency of messages 'pgadmin.browser.messages' in backfrom.pgadmin.js 2016-05-06 17:55:50 +05:30
Neel Patel
149c59aa4f Fixed below review comments
- Removed the "lineWrapping" option from the codemirror textarea because
  it was creating issue in the code folding.
- Handle the values while depositing during debugging.
- Properly handle the Array values while saving it to sqlite database
  and displayed in input dialog.
- SQL code folding was not supported in codemirror so added the same.
2016-05-06 16:05:32 +05:30
Dave Page
1efba422bc Fix comment marker. 2016-05-06 10:23:17 +01:00
Dave Page
c3762c9059 Ensure we update the error message on dashboard grids when it changes. 2016-05-06 08:49:28 +01:00
Dave Page
0628ee0425 Dashboards v1 2016-05-05 16:42:16 +01:00
Ashesh Vashi
07e0de5399 Resolved an issue, a copy-paste issue (was using field instead of the
column object) in NodeAjaxOptionsCell.

It was regression of '32e0a0d4b62462d45da88c177ffc6966de3dbcbb' commit.

Thanks Harshal for reporting this.
2016-04-29 17:25:43 +05:30
Ashesh Vashi
1b5037afe7 Show the resize handle on the alertify dialog. 2016-04-29 16:19:29 +05:30
Surinder Kumar
c15b7c6cae Remove unnecessary extra classes set in the SqlFieldControl, and also
removed the unnecessary classes for the same in the overrides.css file.
2016-04-29 16:05:55 +05:30
Ashesh Vashi
9ef7132e83 Set proper context object, when triggering the 'pgadmin-session' events
in order to resolve few corner cases for validation.
2016-04-29 15:56:56 +05:30
Ashesh Vashi
32e0a0d4b6 Clear the node cache, when an node is created/updated to make sure - we
will always have latest data related to that type of node. Also, fixed
the cache_level for different node types.

This commit also contains fixes for the following issue:
* In extension module - use the 'node-list-by-name' instead of using a
  custom 'node-ajax-options' control, and removed redundant template
  schemas from it.
* When we tries to destroy the select2 object from
  Select2Cell/Select2Control while releasing the properties view,
  sometimes select2 can not find the instance related it for some
  unknown reason. Hence - before removing it we will check for manual
  instance existance using $.data('select2').
* When we traverse through the browser tree nodes very quickly, it tries
  to remove the object before it gets created completely, and results
  into an exception.
* Icon in the select2 drop down list was not visible due to some CSS
  issues.

Apart of that, we will generate two new browser events -
'pgadmin-node:created:<NODE-TYPE>', 'pgadmin-node:updated:<NODE-TYPE>'
whenever a new node is created, or an existing node will be updated.
2016-04-29 15:50:38 +05:30
Murtuza Zabuawala
dac514a4ae Added a new control for rendering the notes to be used by different
tools/utitilities dialog.

Modified a little bit by Ashesh Vashi.
2016-04-28 11:52:06 +05:30
Khushboo Vashi
970e0c3540 [Python 3] Fixed an issue iterate the keys from the session loaded from
the sqlite.
2016-04-26 16:16:29 +05:30
Ashesh Vashi
9dd3aeadb5 Do not close the menu, when clicking on the menu with checkbox.
Introduced a class 'noclose'. Then - menu-item having this class will
not propograte the events to its parent, hence - it will not be closed.

Some of the CSS applicable only to the immediate buttons only, and not
the grand-children.
2016-04-25 22:06:42 +05:30
Ashesh Vashi
26e9ceaf48 Do not reset the driver registry when the 'load_driver' method of
DriverRegistry is executed second time.

Also, initialize the driver before registering different blueprints,
which uses those driver inside them.

Thanks Khushboo for reporting the issue.
2016-04-25 15:33:54 +05:30
Ashesh Vashi
52aa32a4d2 background-position-x and background-position-y are not supported on the
browser, using background-position instead which is supported in all the
supported browsers.
2016-04-25 13:45:54 +05:30
Murtuza Zabuawala
973e2b1b4a Match the border style of the inline-fieldset with the other control. 2016-04-25 13:34:51 +05:30
Ashesh Vashi
0e50f4b1f3 Fixed the issue - preferences were saved.
It was regression of the commit-id:
533aaa2fa3.
2016-04-25 11:54:02 +05:30
Ashesh Vashi
1b44aed456 Resolved an issue - rendering the SQL control refering to the undefined
variable.

It was regression of the commit-id:
085ce50545.
2016-04-22 22:55:54 +05:30
Sanket Mehta
244f5d59d2 Resolved an issue - fetching the source, and target type functions in
the CAST module. Make the changes in the CAST module too for the
changes done in the NodeAjaxOptionsControl in the commit-id:
944bdbb96c.

We've changed the signature (arguments) of the 'options' & 'transform'
functions.
2016-04-22 18:04:09 +05:30
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
a5aa6d159a Updated the CodeMirror to the latest stable version (5.14.2).
It has now the 'sql/x-pgsql' mode, which will make the queries more
familiar, and lot more improved addons.
2016-04-22 15:28:34 +05:30
Dave Page
471cd72bb9 Cleanup debugger dashboard 2016-04-20 09:00:25 -04:00
Ashesh Vashi
ef7737c709 Added missing dependent javascript 'jquery.aciFragment' required by the
aciTree.

Also - fixed few CSS specifically for the preferences dialog.
Returning the sorted preferences from the server, so that - it lists
down in correct order.
2016-04-19 23:48:10 +05:30
Neel Patel
37699a9820 Don't try to use the template engine's gettext on Javascript variables, as it won't work as the templates are evaluated before any JS is executed. 2016-04-18 08:39:25 -04:00
Neel Patel
4f8b018b39 Various tweaks and improvements to the debugger 2016-04-18 08:34:18 -04:00
Ashesh Vashi
09cc78bd0a Adding missing query templates required for the server module. 2016-04-18 14:57:35 +05:30
Ashesh Vashi
9aee9794c1 Fix the properties toolbar at the top of the panel so it's always
visible.

This patch also introduce a callback 'onCreate' for each panel, and
frame, which will be called whenever a panel/frame is being created.
2016-04-18 12:38:56 +05:30
Ashesh Vashi
7522d89890 We would not like to make the overflow hidden for the main panel class
''pg-panel-content'.

This reverts commit 8dd8fc57a4.
2016-04-18 12:12:47 +05:30
Khushboo Vashi
2d8633d4ca Fixed few typos/issues in the datamodel.js 2016-04-18 12:10:19 +05:30
Ashesh Vashi
8dd8fc57a4 Revert "Revert "Fix the properties toolbar at the top of the panel so it's always visible.""
This reverts commit e210d2b580.
2016-04-18 12:10:19 +05:30
Priyanka Shendge
98d473a7ec Initial version of a regression test framework 2016-04-17 10:39:08 -04:00
Arun Kollan
ffa348fe5d Fix wizard core styling. 2016-04-17 09:08:03 -04:00
Dave Page
e176190256 Core infrastructure for dashboards. 2016-04-16 17:51:44 +01:00
Surinder Kumar
e7902d4b45 Support procedures and ignore packages that look like schemas properly in PPAS 2016-04-16 10:01:28 +01:00
Seçkin Alan
26aa5607ad Fix dropping of server groups. 2016-04-16 09:55:38 +01:00
Dave Page
e210d2b580 Revert "Fix the properties toolbar at the top of the panel so it's always visible."
This reverts commit 6e42e48244.
2016-04-15 15:47:14 +01:00
Arun Kollan
533aaa2fa3 Restyle alertify dialogues so they look like the rest of the app. Still some tweaks needed, but we're 95% of the way there. 2016-04-15 15:30:50 +01:00
Ashesh Vashi
34ba5bef24 Improvised the data clean up, in some cases, it was calling validation
due to internal 'set' function call from the internal 'reset' function.

We will stop the session management, before doing any clean up for
ignoring such events.
2016-04-15 19:29:30 +05:30
Ashesh Vashi
6e42e48244 Fix the properties toolbar at the top of the panel so it's always visible. 2016-04-15 14:44:09 +01:00
Khushboo Vashi
de0864a92c Fix SQL Help on older browsers without string.endsWith(). 2016-04-15 14:26:32 +01:00
Ashesh Vashi
7ca939dcaf Fix dialogue close issue. 2016-04-15 14:02:21 +01:00
Dave Page
4d7d3bd5e1 Icon and toolbar cleanup/consistency. 2016-04-15 13:32:17 +01:00
Ashesh Vashi
58fcbd943a Deleting the object (model & nested model/collection) during showing
the node properties.
2016-04-15 16:14:22 +05:30
Dave Page
1c0e477823 Icon for the grant wizard. 2016-04-15 11:17:16 +01:00
Dave Page
cf80db66a6 Confine whitespace prewrap to the SQL Editor's output grid to prevent it breaking subnode forms. 2016-04-15 11:11:32 +01:00
Dave Page
9c65b73f31 Fix "View Filtered Rows" option. 2016-04-15 08:52:27 +01:00
Ashesh Vashi
af680b724d Improvise the Select2Cell
Select2 does not allow to scroll any of the parent container once it was
opened, and if it was not properly closed.

Also, resolved an issue - existing selection was not working, while
re-rendering the Select2Cell.
2016-04-15 11:01:14 +05:30
Seçkin Alan
7b344185b4 Validate the model on save. 2016-04-14 21:51:07 +01:00
Seçkin Alan
290e6949f8 Require a server hostname/address to be specified. 2016-04-14 21:46:01 +01:00
Neel Patel
12ae40fe62 Procedural language debugger. 2016-04-14 21:36:04 +01:00
Sanket Mehta
1b442cff41 FTS Dictionary support (icons) 2016-04-14 20:54:14 +01:00
Sanket Mehta
7305986e14 FTS Dictionary support. 2016-04-14 20:53:14 +01:00
Sanket Mehta
b47577390a Fix issue renaming FTS Parser. 2016-04-14 20:14:32 +01:00
Dave Page
e09aa90614 Rename "Parameters" to "Arguments" and "Variables" to "Parameters" for consistency with the PG docs.
Per Susan Douglas.
2016-04-14 20:11:55 +01:00
Dave Page
dc06f92bb3 Update message catalog 2016-04-14 15:49:23 +01:00
Murtuza Zabuawala
49e433db4f Type fixes:
- Renaming or changing the schema for a shell type should not be allowed.

- I'm allowed to try to add ACL entries or security labels to an
existing shell type. This should be disallowed.

- Changing the schema on a (non-shell) type doesn't work - the type
name is omitted, e.g.

ALTER TYPE pem
    SET SCHEMA pemhistory;

Which should be:

ALTER TYPE pem.foo
    SET SCHEMA pemhistory;
2016-04-14 15:46:25 +01:00
Akshay Joshi
c6acbcb5ad Query tool/data editor initial version 2016-04-14 15:04:03 +01:00
Dave Page
0420210076 Fix favicon routing 2016-04-14 13:40:01 +01:00
Murtuza Zabuawala
c047abd8a4 Fix various issues with Types, per discussion 2016-04-14 12:37:19 +01:00
Ashesh Vashi
8a39b3a700 Backend changes to fetch the statistics for the database and server
nodes, along with the front-end changes for those node.

NOTE:
We've not yet added the support to show them on the front-end.
2016-04-14 16:45:34 +05:30
Ashesh Vashi
6f58170894 Bind the current panel with the temporary functions, so that - it works
on the object everytime, it hits the buttons, and the callback functions
are being executed. The original implementation was not using the same
panel, when it was recalled from other function. And, results into
unexpected behaviour like not able to work with Edit object again.

Thanks Murtuza for reporting the issue.
2016-04-14 12:50:20 +05:30
Ashesh Vashi
30d189f499 Load the codemirror as package in the require.js, which will allow us to
load the codemirror addons without any modification.
2016-04-14 12:34:17 +05:30
Seçkin Alan
af1e38a97a [Python 3 compability] Fixed the issue introduced by the Grant Wizard,
which fixes a issue with the Python 3.
2016-04-14 11:54:29 +05:30
Surinder Kumar
40c592a988 Grant wizard. 2016-04-13 16:11:43 +01:00
Murtuza Zabuawala
6e237d16ca Add canAddRow/canEditRow/canDeleteRow functionality for Backgrid.
This will allow user to check condition on individual opration(add/edit/delete row) rather than only while rendering the control.
2016-04-13 15:54:17 +01:00
Arun Kollan
0fb0820c64 Fix CodeMirror borders on dialogues. 2016-04-13 12:24:46 +01:00
Ashesh Vashi
9e2d349591 Improvements to frame management. 2016-04-13 11:25:04 +01:00
Dave Page
dd5e86bcf4 Fix label 2016-04-13 10:55:12 +01:00
Seçkin Alan
de2e7bf8f1 Fix the mouse pointer on the top-level menus. 2016-04-13 09:58:38 +01:00
Akshay Joshi
03d6fce53c Add support for an affected row count property to the DB interface. 2016-04-12 17:02:54 +01:00
Dave Page
edf9f25691 Fix general category default. 2016-04-12 17:00:12 +01:00
Dave Page
fc8c3db33f Remove unnecessary line of code. 2016-04-12 13:39:06 +01:00
Dave Page
62fcfd928d Add context-sensitive SQL help. 2016-04-12 13:36:06 +01:00
Ashesh Vashi
9b9126da15 Improvised Select2Cell, and SwitchCell.
Removed the use of separate editor for both of these cell types. There
were two instance of select2 were getting created in the Select2Cell,
one in the Select2Cell itself, and another in Select2CellEditor. And,
loosing the focus mysteriously, and making the scrollbar in the property
dialog non-responsive.

Also, modified the NodeAjaxOptionsCell to use the above logic, and
removed its own version of render function to make it consitent across
the system.

This patch [changes sent by Murtuza] also includes improvisation in the
DeleteCell, and ObjectCell, which will honour now 'canRemoveRow', and
''canEditRow' respective properties of Column.
2016-04-12 16:53:21 +05:30
Dave Page
787b35c326 Couple of typo fixes. 2016-04-11 15:41:41 +01:00
Ashesh Vashi
c304d3e90e Save the database OID of the maintenance database. 2016-04-11 17:15:55 +05:30
Ashesh Vashi
e07ebdc049 Moving the messages used in common utilities in a separate javascript. 2016-04-11 17:07:58 +05:30
Dave Page
d53ab31eb8 Button bar styling:
- Left justify the top button bar and match the style of the query tool
- Allow buttons to have tooltips and optional labels
2016-04-08 11:58:47 +01:00
Ashesh Vashi
66441e673a The icons in the Select2Cell, and Select2Control were not visible due to
some CSS change.
2016-04-08 11:10:34 +05:30
Ashesh Vashi
95ffc908ce Changed the logic of transform function as per new implementation logic
of Select2Control.

Also, added missing translation functions for few strings.
2016-04-08 11:10:34 +05:30
Ashesh Vashi
944bdbb96c Improvised the 'transform/options' function usage with the Select2Cell.
The current implementaton binds the cell/control object, and the ajax
data in the asychronous Cells/Controls with the 'options' functions
extended from the Select2Cell.

The problem starts when we try to fetch the current model from that
options/transform/filter function to do some operation, which does not
require in most of the cases. Except the privileges control - where we
needed the current model for omitting the existing selected object
during transformation, and filtering.

In order resolved the issue, we need a common object, which is shared
among the Cell. In backgrid, the 'Column' object is mong the cell,
hence - implementation logic has been changed to bid the 'Column' object
with the 'options' function and, passed the 'Cell' object as an
arguments.

Because - we do use the common function 'transform' between 'Control'
and 'Cell', we needed make changes in the Select2Control to pass the
Control object as an arguments.

And, make the changes in the privileges control to use the new
implementation. The same logic is also required in some of the
operations, we will be/are working on the table/column nodes.
2016-04-08 11:10:34 +05:30
Dave Page
4ec4b4f43e Improve dialog title bar colouring. 2016-04-07 22:05:55 +01:00
Dave Page
34a803fc68 FTS Parser support 2016-04-07 20:59:09 +01:00
Sanket Mehta
d6d6361de5 FTS Parser support 2016-04-07 20:58:29 +01:00
Dave Page
680339ff20 Fix node type label 2016-04-07 20:57:45 +01:00
Dave Page
441a29f59c String tweaks. 2016-04-07 20:51:31 +01:00
Sanket Mehta
95566ed5e1 FTS Template support. 2016-04-07 15:01:56 +01:00
Arun Kollan
22841f8664 Cleanup styling of wcDocker tab control buttons. 2016-04-07 13:40:16 +01:00
Murtuza Zabuawala
ca277bc8b6 Type support 2016-04-07 12:27:33 +01:00
Murtuza Zabuawala
3914f5095a Fix sub-node error display. 2016-04-07 11:51:16 +01:00
Ashesh Vashi
1ba0814377 Added support for 'array' type in the schema of Node model to treat as
an object, and handle it well in the toJSON(..) with session
transformation.
2016-04-06 15:05:39 +05:30
Dave Page
01d6b46838 Minor adjustment to the menu font sizing. 2016-04-05 17:10:12 +01:00
Dave Page
34ef5790ba Revert style change introduced in commit f7e4e8bea0 as it's removing padding from all grids. 2016-04-05 16:45:38 +01:00
Khushboo Vashi
2add0155a3 Add support for domains. 2016-04-05 16:32:36 +01:00
Surinder Kumar
d1eb3fd9d5 Utility functions for trigger and rule nodes, centralised because they're also utilised by the view node. 2016-04-05 16:19:55 +01:00
Khushboo Vashi
5ed7015ebc Add support for functions and procedures. 2016-04-05 16:14:10 +01:00
Ashesh Vashi
40165f2d1e Honour the 'show_system_object' flag when generating the list of schema nodes. 2016-04-05 16:37:54 +05:30
Neel Patel
e585ddbdaf Improvise the PostgreSQL driver to fetch the status message.
At the moment, we will only allow to fetch status messages from the
asynchronous connection only, later - we may implement to fetch the
status message from the normal connection too.
2016-04-05 13:29:20 +05:30
Murtuza Zabuawala
f7e4e8bea0 Use separate editor for Select2Cell.
This allows us to use the Backgrid key navigation as expected.

This has also resulted into an issue - related unresponsive scrollbar
issue in the SubNodeControl.
2016-04-04 15:36:31 +05:30
Akshay Joshi
5331075ab0 Improvise the psycopg2 wrapped driver for PostgreSQL to show formatted
message on demand.

Also - resolved an issue identifying the aborted transaction while using
the asychronous connection.
2016-04-04 12:29:43 +05:30
Harshal Dhumal
43d532321b Allow to close the create/edit dialog after successful 'save'
operation.

Some of the nodes do not return id as result, when they were created.
Modified the logic to allow to open the parent node in such conditions.
2016-04-01 15:34:29 +05:30
Khushboo Vashi
35a1390251 Resolved few issues in the collection controls. UniqueCollectionControl
was not honouring the change events after execution of the function -
'render' more than one time. Change the label of the Add button to make
it consistent with the Unique Collection Control.
2016-04-01 15:26:15 +05:30
Murtuza Zabuawala
1a5eb0c417 Updated the template for the NodeAjaxOptionsControl, which was not honouring
the disabled attribute due to missing quotes around values.
2016-04-01 15:17:31 +05:30
Ashesh Vashi
0654bae816 Adding the font used by jQuery-contextmenu (v2.1.0) 2016-04-01 11:57:55 +05:30
Ashesh Vashi
d70535385b Upgraded the jQuery-contextMenu to v2.1.0 (latest stable version) in
order to fix the issue rendering the context menu for longer text.

Needs to do some modification in the existing pgAdmin4 CSS theme to make
it looks like/near the existing look and feel.
2016-03-30 19:08:27 +05:30
Ashesh Vashi
067c269fc8 Convert the value in proper format, as we may only get string values
for integer and numeric type.
2016-03-24 14:29:49 +05:30
Ashesh Vashi
242d5f47f6 Loading the jquery.aciSortable.min.js javascript, as when we destroy
the jquery-aciTree from preferences dialog, it throws an exception,
which uses functions from this javascript.
2016-03-24 14:23:44 +05:30
Ashesh Vashi
7bce6dd903 The changed value of a multiline/text control was not saved in the
configuration database due to unable to identify the change properly.
Thanks Dave for reporting.

This also includes a support to use a 'text' type of preference, and
show help string next to the control.
2016-03-24 13:00:15 +05:30
Ashesh Vashi
a28df1e0a2 Allow to show help string in each of the contorl. 2016-03-24 13:00:15 +05:30
Dave Page
2a2374329e String improvements. 2016-03-23 16:03:22 +00:00
Dave Page
72f6353561 String improvements. 2016-03-23 16:00:26 +00:00
Dave Page
1ac16cbc0f We have defaults for switch display now, so no need to set the options explicitly. 2016-03-23 11:53:07 +00:00
Dave Page
258c7f3589 Don't display packages as schemas. 2016-03-23 11:52:11 +00:00
Murtuza Zabuawala
0e044e1216 Fixed the refresh issue when a server gets disconnected. 2016-03-23 16:52:21 +05:30
Dave Page
a6e96c5576 Set appropriate default values for the boolean switch control. 2016-03-23 10:24:19 +00:00
Harshal Dhumal
219f208317 Evaluate the disabled option in SwitchControl.
Also - for consistency reason use the same evaluation logic in each of
the control.
2016-03-23 12:51:29 +05:30
Murtuza Zabuawala
12a0cb1ba1 [Python 3] Fixed the issue loading the value for the session key from the sqlite. 2016-03-23 12:40:11 +05:30
Harshal Dhumal
709311b77c Fix issues with multiple subnode forms being open at once when adding rows to a grid. 2016-03-22 17:04:46 +00:00
Harshal Dhumal
ddd4768937 Backform control for selecting multiple columns.
Usage:

{
  id: 'columns', label: '{{ _('Columns') }}',
  type: 'collection', group: '{{ _('Definition') }}', editable:true,
  canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
  deps: ['index'], node: 'column',
  model: pgBrowser.Node.Model.extend({
    keys: ['column'],
    defaults: {
      column: undefined
    }
  })
}

Note: When using this control model should have column attribute. And node property should be column.
2016-03-22 16:52:34 +00:00
Surinder Kumar
03349f4af6 Update the backform control to support sql-fields.
Following are the enhancements:
1. Added border to control which was missing earlier.
2. Allows user to provide height to sql-field control by specifying extraClasses field in model schema.
3. Defined new classes for sql-field control height in overrides.css
4. Added scrollbar to the control.

Usage:

{
  id: 'definition', label:'{{ _("Definition") }}', cell: 'string',
  type: 'text', mode: ['create', 'edit'], group: 'Definition',
  control: Backform.SqlFieldControl, extraClasses:['custom_height_css_class']
}
2016-03-22 16:36:54 +00:00
Ashesh Vashi
b3c625f135 Graceful server reconnections. 2016-03-22 15:35:11 +00:00
Ashesh Vashi
3c366fafe7 Server side session management support. 2016-03-22 15:05:43 +00:00
Harshal Dhumal
8189b39b1e Configuration options for switch control from different places should be merged together and not overridden. 2016-03-22 14:28:13 +00:00
Arun Kollan
06c0cf607d Make tabsets look consistent, and square off the properties sections a little. 2016-03-22 13:31:48 +00:00
Khushboo Vashi
8ca134871f Update the Browser Tree Node Icon after editing. 2016-03-22 13:14:38 +00:00
Ashesh Vashi
87f9834951 Allow to create sub-menu/menu-group by specify the same category in
multiple menu-items (not just the 'create' menu-group).

Moved all the main menu/context menu generation implementation in the
'menu' javascript menu.

In this implementation, if more than one menu-items specify same type
of categories, they will be created withing that group, otherwise - it
will be created separately (unless 'single' property of that category is
set to true).

We can also provide icon, priority, separator(s) above/below it for the
individual sub-menu too using pgAdmin.Browser.add_menu_category
function(...).
2016-03-21 23:56:08 +05:30
Ashesh Vashi
79d6d50dcc The minimal refresh functionality, which will not unload the whole
tree, when 'refresh' on any node was selected.
2016-03-21 22:44:59 +05:30
Ashesh Vashi
b056ba7bb7 Speed up the expansion/collapsing of nodes.
[as per Thom Brown <thom@linux.com>]

Also, we will not like to wait for 500 microsecond before initialing the
tree items, load them asap.
2016-03-21 22:44:59 +05:30
Murtuza Zabuawala
530f58e66b Add support for inline fieldsets. 2016-03-18 16:54:43 +00:00
Khushboo Vashi
8a99282e07 Add support for domain dependencies/dependents. 2016-03-18 15:20:41 +00:00
Murtuza Zabuawala
3432481f9a Properly name the dbo and sys catalogs in PPAS. 2016-03-18 15:16:18 +00:00
Ashesh Vashi
84c5c29b92 Resolved an issue using wrong variable name for backbone-model, while
triggering events.

Thanks Khushboo Vashi for reporting.
2016-03-18 17:29:52 +05:30
Ashesh Vashi
4c9bbff28b Renaming a server, when it was connected, should not lose the existing
connections.

Thanks Neel for reporting the issue.

Also, resolved an issue related fetching properties of all the servers.
2016-03-18 17:12:40 +05:30
Ashesh Vashi
9dabd5bf3b Resolved an issue related to not able to select grantee in the
privileges control.

It was a regression introduced in the commit -
'4adea4dc2596fb495c4df8129745b87c35b062a6'.
2016-03-18 16:53:38 +05:30
Ashesh Vashi
611c9c4ae7 Disable the menu to create database and tablespace, if:
* Database server is not connected.
* Do not have adequate permission to create.
2016-03-18 10:31:57 +05:30
Ashesh Vashi
09bdf1fab7 On Python 2, use urllib2 instead of urllib, which allows us to specify timeout
parameter.
2016-03-18 10:08:51 +05:30
Ashesh Vashi
328428ab22 Adding a timeout of 5 seconds (while fetching the latest pgAdmin version), it
stucks at rendering the main page (browser.html) in the broken network.
2016-03-18 09:58:00 +05:30
Ashesh Vashi
0fcfaa4ff2 Updated the font-awesome to 4.5 (latest) version. 2016-03-18 01:34:45 +05:30
Ashesh Vashi
96b33d1aa8 Updated the jQuery-contextMenu to 1.9.2 (latest stable) version.
Also, added the missing license information about it in the libraries.txt.
2016-03-18 01:11:22 +05:30
Ashesh Vashi
1448a8f551 Log exceptions raised under the servers module. 2016-03-17 22:50:38 +05:30
Sanket Mehta
71badac203 Support "show system objects" in casts. 2016-03-17 11:49:11 +00:00
Neel Patel
3969e91563 Add support for Foreign data wrappers, servers and user mappings. 2016-03-17 11:39:38 +00:00
Arun Kollan
05e527505d First pass at improving the dialogue borders. 2016-03-16 17:12:41 +00:00
Khushboo Vashi
3df180831f Support textareas in backgrid. 2016-03-16 14:48:09 +00:00
Dave Page
41805d40b5 Sort all nodes when loading. 2016-03-16 10:31:20 +00:00
Dave Page
2fb6ccf5b2 Re-shuffle server properties. 2016-03-16 09:58:14 +00:00
Khushboo Vashi
a18553bd8c Add a data type reader utility. 2016-03-16 09:54:30 +00:00
Ashesh Vashi
40ceabb082 Do not rely on the individual model (instead use the first level 'top'
model) to fetch the node_info, because - when loading the data in the
collection, it may not initialize all the parameters.
2016-03-15 21:18:52 +05:30
Dave Page
62bd1a21cc Improve message display. 2016-03-15 15:45:40 +00:00
Arun Kollan
c814698328 Fix security label sizing. 2016-03-15 15:07:40 +00:00
Akshay Joshi
218cc3ec0c As 'show_system_objects' has been implemented, I have fixed an issue for dependencies/dependents.
With previous implementation each node will have to send the values of 'show_system_objects'
while calling get_dependencies/get_dependents function. Now I have changed the logic to use the
value directly into the base class functions.
2016-03-15 14:16:33 +00:00
Dave Page
2711d3492d Reduce column header letter spacing a touch. 2016-03-15 14:12:54 +00:00
Ashesh Vashi
4adea4dc25 Resolved an issue related to no proper valid/invalid event was
generated for the privilege control. Also, made changes in the
PrivilegeRoleModel, to allow to select a grantee only once for the
current user (as grantor), and omit them from other cell objects.

Valid/Invalid event was not properly triggered, whenever the child
attribute is a collection/model within a model (nested mode/collection
within model). This patch tried to take care of all such scenarios in
general.
2016-03-15 19:00:58 +05:30
Ashesh Vashi
b52a5736ff Improvements in the form/properties dialog control generation, and data
change events.

- In input & textarea control, call the change event on key up (but -
  not on every key up events, wait for sometime before trigger that
  event, so that - we do not overdo that).
- In unique/subnode control, whenever we create new model object, set
  all the required static fields used by pgAdmin form generation logic.
- In NodeAjaxListCell, we don't need to call the list generation
  operation (ajax operation) for each and every cell. They use the same
  shared column object.
2016-03-15 18:58:22 +05:30
Neel Patel
ff424850f8 Fix a bug in the database drive poll() function where we could try to reference a non-existant variable. 2016-03-15 13:01:28 +00:00
Arun Kollan
cdd7a1f637 Subnode collection layout improvements, with additional tweaks from me. 2016-03-15 12:30:01 +00:00
Murtuza Zabuawala
9220dcaa97 Fix an issue with uneditable text fields containing large amounts of data, 2016-03-14 09:31:36 +00:00
Dave Page
fd05dec29c Default owner for new event triggers. 2016-03-11 16:58:46 +00:00
Murtuza Zabuawala
b6f7202448 Add support for collations. 2016-03-11 13:40:28 +00:00
Dave Page
c0086b092f Fix a number of minor issues with catalog objects:
- Remove unnecessary columns from collection property lists.
- Standardise property names and groupings.
- pg_attribute doesn't have an OID column, so use attnum instead (of atttypid!?!)
2016-03-11 10:09:23 +00:00
Dave Page
470881ac46 Fix cast SQL formatting. 2016-03-11 09:45:43 +00:00
Khushboo Vashi
2f334673a3 Fix a couple of issues with the unique-collection control:
- Pass the data to evaluation functions like canEdit, canAdd
- Properly honour the canAdd option.
2016-03-11 09:36:26 +00:00
Dave Page
d21e60cc60 Fix default height for text areas. 2016-03-11 09:24:05 +00:00
Murtuza Zabuawala
b747a5b5eb Update ACL parsing for tablespaces to use newer infrastructure. 2016-03-11 09:05:58 +00:00
Murtuza Zabuawala
5347bdb886 Added support for the catalog objects under special catalogs. (also,
added support for columns under it).
2016-03-11 01:09:06 +05:30
Ashesh Vashi
87623cb997 Resolved few typos, comments, and also some query correction in the SQL
templates for different nodes.
2016-03-11 01:02:25 +05:30
Dave Page
b7f6df34ab Fixup some SQL formatting, per Khushboo 2016-03-10 17:23:59 +00:00
Dave Page
ce5d7b7d60 Fix gettext calls per Khushboo 2016-03-10 17:18:42 +00:00
Dave Page
649b719845 Variables should have their own tab on dialogues. 2016-03-10 17:15:58 +00:00
Dave Page
83a662f798 Fix all manner of inconsistencies in object properties display:
- Don't display the OID on Edit dialogues
- Use the ACL summary display in the properties panel, not the subnode editor.
- s/Oid/OID/g
- Ensure all security properties are displayed in the Security group
- Ensure all object definition values are stored in the Definition (or a more precise) group, not General.
- Fix the ordering of General properties so the comment is always show last.
2016-03-10 17:08:27 +00:00
Dave Page
62537429d1 Show the ACL summary on the properties panel for databases. 2016-03-10 16:21:17 +00:00
Dave Page
2b6c8dff0b Fix various inconsistencies with databases and tablespaces:
- Display the ACL string in properties, not the subnode panel.
- Offer default values for the owner of new objects.
- Add missing context menu option to create a tablespace from a server node.
2016-03-10 16:14:26 +00:00
Dave Page
f95b9f06ca Add some default connection parameters. 2016-03-10 15:58:17 +00:00
Arun Kollan
17ed27fbcd Make the dialogue control sizing slightly more compact and properly control textarea resizing. 2016-03-10 15:31:43 +00:00
Harshal Dhumal
def1a30251 Add support for Sequences. 2016-03-10 15:23:04 +00:00
Harshal Dhumal
986375d60e Add support for Event Triggers. 2016-03-10 13:38:31 +00:00
Khushboo Vashi
3b03c17f2b Allow enabling/disabling of the Edit button of a sub-node collection grid. 2016-03-10 12:03:33 +00:00
Khushboo Vashi
d32e861a47 Updated Privileges macros under Schema node.
The changes are required due to previous commit (8a7ec6b452) regarding "parse_priv_to_db" function.
2016-03-10 12:01:13 +00:00
Ashesh Vashi
77ae220f1e Resolved typos in SQL templates for PPAS
Thanks Khushboo Vashi for reporting.
2016-03-10 14:56:46 +05:30
Murtuza Zabuawala
8a7ec6b452 Update "parse_priv_to_db" function to return list a instead of a string.
This will also allow us to operate on individual privileges & also we
needed this functionality for column nodes.

For example,

*Earlier:* priv was string

GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};

*Now:* priv will be List, which we need to handle in jinja templates.

GRANT *{{ priv|join(', ') }}* ON {{ type }} TO {{ conn|qtIdent(role) }};
2016-03-09 17:10:03 +00:00
Arun Kollan
5d6c5bc74d Improve display of error messages on dialogues. 2016-03-09 16:03:24 +00:00
Akshay Joshi
f08aa6a313 Always fetch column info from the server, even if there are no rows. 2016-03-08 15:59:53 +00:00
Dave Page
a92d4841d1 Add support for Schemas and Catalogs.
Initial patch by Murtuza Zabuawala with further hacking by Ashesh Vashi and I.
2016-03-08 15:48:11 +00:00
Dave Page
5ea822f33e Preferences dialogue. Patch by Ashesh and Khushboo Vashi. 2016-03-07 11:48:53 +00:00
Ashesh Vashi
43116750b4 Honor the visible property of the model schema, and show/hide different
custom contorls based on it.
i.e.
UniqueCollectionControl, TabControl, FieldsetControl, etc.
2016-03-07 16:06:18 +05:30
Neel Patel
31ab9ebacc Using the correct member variable while fetching the notices/messages
from the psycopg2 connection.
2016-03-06 18:56:42 +05:30
Ashesh Vashi
6014448dd7 Trigger an event whenever a register script has been initialized from
the browser.
2016-03-06 18:52:22 +05:30
Ashesh Vashi
cc08708f23 Allow to specify special type - 'group' in schema for the browser node,
which allows to determine certain group to hide/show the whole
tab/fieldset control in the properties, and create dialog.

Using this functionality in the database for the
'default privileges - types', which is not allowed before PG < 9.2 using
the version check.
2016-03-06 18:50:10 +05:30
Ashesh Vashi
ee71cab51e Removed the wrong copyright information in the javascript file, which is
owned by pgAdmin IV.
2016-03-04 17:39:51 +05:30
Murtuza Zabuawala
fa97b5635e Enable/disable edit button functionality conditionally in backgrid. 2016-03-04 11:55:50 +00:00
Sanket Mehta
a4e819c68c Fix an error retrieving dependents and dependencies for casts. 2016-03-04 11:03:30 +00:00
Murtuza Zabuawala
6ed5e7183e Backform control enhancements:
1) Unique collection control: we have added 'Edit' button in grid, earlier it was only delete button.
2) Sql field control: We have added control to disabled & visible functionality which were not available.
2016-03-04 11:00:17 +00:00
Ashesh Vashi
0b43443151 Allow the connection driver to return notices/messages from the server. 2016-03-04 10:35:50 +00:00
Harshal Dhumal
d2e372114b Security Label and ACL template macros:
Way to use in template:

1) Security labels:

SECLABLE.SET(conn, object_type, object_name, provider, security_label,
object.schema)

SECLABLE.UNSET(conn, object_type, object_name, provider, object.schema)

2) Privileges:

PRIVILEGE.SET(conn, object_type, grantee, object_name,
privileges_without_grant, privileges_with_grant,
            object.schema)

PRIVILEGE.UNSETALL(conn, object_type, grantee, object_name, schema)

privileges_without_grant = comma separated string of privileges.
privileges_with_grant = comma separated string of privileges.
2016-03-03 15:12:37 +00:00
Khushboo Vashi
3ff06da772 Security Labels, Privileges and Variables macros for the functions modules.
Usage of the macros:

Security labels:

SECLABLE.SET(conn, 'FUNCTION', func_name, provider, security_label, func_schema, func_args)

SECLABLE.UNSET(conn, 'FUNCTION', func_name, provider, func_schema, func_args)

Privileges:

PRIVILEGE.SET(conn, 'FUNCTION', grantee, func_name, privileges_without_grant, privileges_with_grant, func_schema, func_args)

PRIVILEGE.UNSETALL(conn, 'FUNCTION', grantee, func_name, func_schema, func_args)

Variables:

VARIABLES.SET(conn, 'FUNCTION', func_name, options, func_schema, func_args)

VARIABLES.UNSET(conn, 'FUNCTION', func_name, options, func_schema, func_args)
2016-03-03 14:08:28 +00:00
Khushboo Vashi
789ece89fb In the current Backgrid implementation, a cell can be made editable through "editable: true/false" settings. It takes only a boolean value.
Add support for a function that can be set as an editable option value.

For Example:

editable: function(m) { return false; }
2016-03-03 14:03:59 +00:00
Akshay Joshi
e138ec53b6 Add support for asynchronous connections to the database server. 2016-03-02 13:29:15 +00:00
Ashesh Vashi
b41066a6b6 [Reversed Engineered SQL] Security Labels is not available for PostgreSQL <= 9.1 2016-03-01 15:36:52 +05:30
Ashesh Vashi
cf170821cb Security Labels is not available for PostgreSQL <= 9.1 2016-03-01 11:06:31 +05:30
Ashesh Vashi
1cb2a054ff Showing consitent reversed engineered SQL for the database node. 2016-03-01 10:42:04 +05:30
Ashesh Vashi
a6466c091c Resolved a regess of the previous commit, which introduced during
previous commit: 39d432ca2c.

[Thanks Neel Patel for pointing this out..]
2016-03-01 10:24:46 +05:30
Ashesh Vashi
39d432ca2c Remove some unnecessary imports from the pgadmin/__init__.py, and
removed the file hooks.py, which is not used any more with new
infrastructure.
2016-02-29 23:08:08 +05:30
Neel Patel
000c76871f Updated the misc module javascripts to work with latest wcDocker. 2016-02-29 19:37:24 +05:30