Commit Graph

4715 Commits

Author SHA1 Message Date
Ashesh Vashi
d9f349b60b Chagned the variable control to use the new format of
generateSchemaView(...) output. Also, set the value in proper format
before rendering them using DynamicVariableCell.
2016-01-18 14:49:40 +05:30
Ashesh Vashi
7e621c9d7f Using the new logic after using generateViewSchema(...) function for
generating schema properly for the collection for rendering the grid.
2016-01-17 22:31:54 +05:30
Ashesh Vashi
0edf29b534 Fixed the missing translation in the 'Connetion' group, while defining
the schema.
2016-01-17 22:21:59 +05:30
Ashesh Vashi
6a071292aa Adding two new controls tab and fieldset for better layout management
used in some of the nodes.
2016-01-17 22:21:05 +05:30
Ashesh Vashi
e7bcba0050 Send the consistent data from both menus and context menus. 2016-01-15 19:46:45 +05:30
Murtuza Zabuawala
45240f3850 Use the same schema parameter 'visible' instead of separate one (i.e.
show) for both control and cell, while generating the columns and field
Schema. And, it was resulting into wrong behaviour because of that.

Also - includes the server changes, which was using 'show' parameter
earlier for showing version, when server was connected.
2016-01-15 19:26:03 +05:30
Harshal Dhumal
4e5e7755b5 Make the privilege control to work as expected. Using the
NodeListByNameCell for selecting the grantee.

This patch includes:
- Change the RolePrivilegesModel schema to allow to use the
  NodeListByNameCell for showing grantee, and granter information.
- When setting some value - do not use the silent flag in Select2Cell, which
  will allow the session manager to take the value in account, which is
  used by the NodeListByNameCell.
- Set the top object in the children of the UniqueControl collections.
  [Ashesh Vashi]
- Pass on the node information to the actual data model, so that - we can use
  node information by the control itself. [Ashesh Vashi]
- While adding the new privilege, set the granter to the current user.
  [Ashesh Vashi]
2016-01-15 19:10:49 +05:30
Harshal Dhumal
1ce0db3b58 Introducing NodeAjaxOptionsCell, NodeListByNameCell, NodeListByIdCell
for using them with Backgrid.

It has similar functionality which we have done for fetching node
options for select2 cell using ajax at the time of initialization to use
it with Backgrid.
2016-01-15 18:25:34 +05:30
Ashesh Vashi
3a06758b94 Integrate the new mechanism for the data session management in the
variable control, privilege control, which specifies the keys - which
helps identify the data from the collection. Also, resolved an version
compatibility issue with the variable control.
2016-01-15 16:47:22 +05:30
Ashesh Vashi
586b81b162 Data management within the properties dialog in Create/Edit mode is not
done using the Backbone event management.

Emitting 'pgadmin-session:*' for different operations, when we
create/modify the data within the properties dialog.

We will keep track of each child node using the handler object within
the Model, and Collection objects, also - provides them the name of the
attribute, it represents. It will be used to identify the invalid nested
objects within the existing object.

Also, provide the array of modified variables, which were modified in
the validation function to avoid checking each, and every thing in the
validation function. We will need to validate that particular and the
dependent attributes only.

Also - avoid multiple validation operations from the parent object to
improve performance. And, depends on the event based operations for
validation, instead of integrate the data operation and view operation
within one operation. We do maintain the invalid objects, and validate
them only from the collection objects, which also helps improve the
performance during validation.
2016-01-15 16:41:36 +05:30
Ashesh Vashi
eab12f21af Do proper validation in the server panel. 2016-01-12 22:21:33 +05:30
Ashesh Vashi
4feea580aa Using the events to track the session changes, and enable/disable Save,
Reset buttons.

Also - setting/reseting the error messages on status-bar when data are
not valid.
2016-01-12 22:21:33 +05:30
Ashesh Vashi
185ac442fc Fixes few UI issue with the backform controls.
1. NodeAjaxOtions needs to check 'version_compability' in field, and not
   'ver_in_limit' variable. (Thanks Murtuza for pointing that out.)
2. Override the input control to catch the change properly in it.
3. Updated the UniqueCollectionControl and Variable Control to render
   proper template in the header.
2016-01-12 13:40:36 +05:30
Ashesh Vashi
27040a22a7 Make the select2 control disabled (when required). 2016-01-12 12:08:18 +05:30
Ashesh Vashi
5b9b55ee8e Passing the version_compability information in the controls, and use
them in the custom controls.

This commit also includes the patch from Harshal regarding the broken
updateInvalidate(..) function.
2016-01-12 12:01:47 +05:30
Ashesh Vashi
f8fd93c207 Update the user and datbaase information everytime, we connect the
server. And, delete them as soon as all connections are released.
2016-01-12 01:06:56 +05:30
Ashesh Vashi
fc926d7200 Resolved an issue of selection in the Select2Cell, when the value is of
type string and not an array.
2016-01-12 00:09:00 +05:30
Ashesh Vashi
3887c84446 Update the server-information, when connected, and added. 2016-01-11 22:52:13 +05:30
Ashesh Vashi
932ed358e8 Adding the current user information in the server information (when
connected).
2016-01-11 22:11:10 +05:30
Ashesh Vashi
c90c673900 Override the updateInvalid function for uniquer-cotrols. 2016-01-11 21:32:09 +05:30
Ashesh Vashi
2bdd449bd0 Changed the way - we saw the title in the panel to allow the node to
decide, what to saw.
2016-01-11 21:30:46 +05:30
Ashesh Vashi
ca2c693ce4 Renamed the macro DROP to RESET for variables (configuration
parameters).
2016-01-11 13:06:45 +05:30
Ashesh Vashi
97cf27c6b0 Added new custom template hasAny to check if the request has one of the
given key in it or not.
2016-01-11 13:05:35 +05:30
Ashesh Vashi
65f70b46ce Remove the objects from the session while JSONify the objects, sent to
the server.

Also - set width of the select2 container to 100% under backgrid.
2016-01-09 21:55:21 +05:30
Ashesh Vashi
429f585a62 Resolved an issue found generating the URL for some other node from some
other.

i.e.
While fetching the database nodes from the role nodes, it was generating
the wrong URL.

Used the parent_type in each node to identify maximum node URL level
using the priority set in the tree node hearachy information, and
generate URL up to that level only.
2016-01-09 19:54:53 +05:30
Ashesh Vashi
8f733aabd0 Added support for select2 control for using select2 instead of simple
select input.
2016-01-09 18:08:48 +05:30
Ashesh Vashi
d2897a334f Using simplejson for jsonify the data of type Decimal, which will used
for numeric type of PostgreSQL, in python using psycopg2.
2016-01-09 18:05:18 +05:30
Ashesh Vashi
1ba9067c60 Introduced the VariableControl, which will be used in role(s),
database(s), and tablespace(s).

Thanks Harshal Dhumal for sharing the original patch.

I've modified a lot to work by fetching the variables later by giving a
url.

Also,
- Introduced the template macros for SECURITY LABELS and VARIABLES.
- Improvised the Backform.Control with better syntactic approach.
- Introduced a jquery function pgMakeVisible(..) to make it visible
  under any obj which can be identified by unique class.
2016-01-09 18:00:02 +05:30
Murtuza Zabuawala
b1dbcd0932 [Python 3 compatibility] 'qtLiteral' functions needs to return data in
unicode.
2016-01-07 19:33:51 +05:30
Murtuza Zabuawala
30a316ad09 Use the new functionality to add 'Drop' node in server node, and set
minimum, maximum value for the port.
2016-01-07 18:52:12 +05:30
Murtuza Zabuawala
6062343bf5 Set the value in the model when the value is valid in the
IntegerControl.
2016-01-07 18:50:15 +05:30
Ashesh Vashi
a611f84aad data stringification was not done, when object was not modified, and
passed as it is and that leads to error during fetching the modified
SQL.

Thanks Neel for the point out.
2016-01-07 18:31:13 +05:30
Harshal Dhumal
fe05f2d0c6 Resolved an issue setting proper optionsValues for the Select2Cell. 2016-01-07 13:30:46 +05:30
Harshal Dhumal
df594d56e5 Resolving issue setting proper value for options in Select2Cell 2016-01-07 10:55:22 +05:30
Ashesh Vashi
5e67ca959d JSONinfy all data in new mode for the Backbone.Model.
Also, takes care about not quoting the identifier, when found any digit
in the name (except it starts with a digit).
2016-01-07 09:40:45 +05:30
Ashesh Vashi
a086820288 Allow to pass array as an input to the qtIdent. 2016-01-07 08:38:55 +05:30
Ashesh Vashi
ee3efc369d Stringify the data only during GET mode. 2016-01-07 08:37:14 +05:30
Harshal Dhumal
67a80ce8dd Adding Select2Cell, which uses select2. 2016-01-07 08:35:20 +05:30
Ashesh Vashi
753793820b Resolved an issue in the sesion tracking, and generating the data
properly.

Also, takes care of setting options to empty array, when it couldn't
fetch the options for the NodeAjaxOptionsControl.

And, generating proper url for 'msql' url in the SQL tab, when creating
new node from the same type of node.
2016-01-06 19:20:55 +05:30
Ashesh Vashi
456f5bc5b7 Making minor changes:
* Start tracking changes immediatedly depends on the handler.
* Attaching control with the filter in the NodeListByNameControl.
* Generating proper data for the NodeListByNameControl.
2016-01-06 02:25:13 +05:30
Murtuza Zabuawala
675e79daab Adding the IntegerControl for the backform.
(With few cosmetic changes by Ashesh.)
2016-01-05 16:50:00 +05:30
Ashesh Vashi
bd3492afdf Pass the model properly, while checking enable/disable for Select control. 2016-01-05 15:02:45 +05:30
Ashesh Vashi
d498b473c7 Changing the caching mechanism to allow it to store at particular level.
Some data will be applicable to parent level, even though - it has
been fetched it from a particular node.

i.e.
roles will be applicable to server level (not particular role level).
2016-01-05 14:36:33 +05:30
Ashesh Vashi
9f8a46c820 Passing the control, and field information along with the model while
rendering the Select control.
2016-01-05 13:18:49 +05:30
Ashesh Vashi
aec96b4933 Adding the node at correct place in the browser tree after creating new object. 2016-01-05 13:02:00 +05:30
Ashesh Vashi
7beaefd1c6 Resolving few issues with the drop/drop cascade object function at front-end.
Also, modified the translation messages as per Dave (Thanks Akshay Joshi for the patch).

Modified the way, we show the error message dialog.
2016-01-05 12:36:33 +05:30
Ashesh Vashi
1945872e3f Send ajax request as 'application/json', while fetching the modified sql
from the dialog properties.
2016-01-05 02:17:40 +05:30
Ashesh Vashi
faa984debc Append the new node under the collection, when it should be. 2016-01-05 02:15:22 +05:30
Ashesh Vashi
8cd0fda406 Pass the data of the parent, not type, while checking in the isParent(..) function 2016-01-04 23:25:21 +05:30
Ashesh Vashi
3a261b429a Added select2 as dependency 2016-01-04 23:23:16 +05:30
Ashesh Vashi
fc9f94c1d0 Return the tuple (status, message) from the psycopg2 driver instead of
returning the response itself.
2016-01-04 21:59:24 +05:30
Ashesh Vashi
6b0f4790da Show the menus "Delete/Drop", and "Drop Cascade", when defined respective functions canDrop(..), and canDropCascade(..) for the node. 2016-01-04 21:57:18 +05:30
Ashesh Vashi
cd40a07ac3 Resolved a typo in the backform.pgadmin.js, while extending the
Backform.Control.prototype.render(..) function.
2016-01-04 19:27:54 +05:30
Ashesh Vashi
ec7e98e6a7 Allow a node to have two types of parents, modified the code to handle
such situation. This has been modified specifically for the children
under the schema, and catalog nodes.

Also, override the Backform.Control.prototype.render function to allow
to provide the control data to the evaluable functions (i.e. disabled,
visible, required).
2016-01-04 17:52:34 +05:30
Ashesh Vashi
84843f8c37 Pass the tree item object to the menu objects, which could be used by
the disabled function to make it enable/disable based on the current
selected item.
2016-01-04 17:22:06 +05:30
Murtuza Zabuawala
b309b1ffb8 [Python 3 compability] decode function used in 'needsQuoting' function
is not available on Python 3.
2016-01-04 17:09:15 +05:30
Harshal Dhumal
eed1590a51 Do not close the privilege cell editor, when clicked one of its own
children.

Also, resolved an issue related showing 'unknown' instead of privileges,
when loading existing privileges.
2016-01-04 16:59:47 +05:30
Harshal Dhumal
9d9f17c163 Clear the status-bar on the 'on-status-clear' event of the model 2016-01-04 16:54:06 +05:30
Ashesh Vashi
7358549524 Allow to specify the number of arguments in the qtTypeIdent to make it work
with schema specified object name.

You can use the qtTypeIdent template filter as:
conn|qtTypeIdent(name)
or,
conn|qtTypeIdent(schema_name, name)
2016-01-04 13:41:57 +05:30
Harshal Dhumal
6057259bdc Create the status-bar in the properties dialog, and it will listen for
on-status event from the model.
2016-01-04 13:35:11 +05:30
Ashesh Vashi
1ba5d79978 Allow to specify the number of arguments in the qtIdent to make it work
with schema specified object name. This will also works with
EntepriseDB's package too.

Also, added dependency on the current connection object, it will allow
us to use the keywords list specific to the database server in futuer.

You can use the qtIdent template filter as:
conn|qtIdent(name)
or,
conn|qtIdent(schema_name, name)
2016-01-04 13:13:46 +05:30
Ashesh Vashi
613be3b6fe Resolved a typo introduced in the previous commit. 2016-01-04 12:58:29 +05:30
Ashesh Vashi
aedf970748 Allow to use the url with/without the node id in the node ajax options
control, also - allow to specify the filter function in the nodes-by-id,
and nodes-by-name control.
2016-01-04 12:43:27 +05:30
Surinder Kumar
f451bd0a83 Set options fetched from the server as it is only when transform function is not provided. 2016-01-04 12:19:00 +05:30
Ashesh Vashi
49373df02d Resolved issues regarding the rows, and column description not return by
the given query in the execute_dict and execute_2darray function in the
psycopg2 driver.
2016-01-04 12:11:52 +05:30
Ashesh Vashi
109b367fc3 Allow to specify the options as a function, which returns array in form
of (label, value) tuple in the SelectControl.

We will apply the transform function, while rendering the control, and
not during intialization. This will allow us to generate different
options data based on the dependent values.
2016-01-04 11:34:43 +05:30
Murtuza Zabuawala
574105ce5e Resolved an issue related to logging the error message.
Also, fetch the datlastsysoid when making the connection.
2016-01-04 11:18:04 +05:30
Murtuza Zabuawala
cf802cb23f Resolved an issue in the node control related using existing cached data 2016-01-04 11:12:03 +05:30
Ashesh Vashi
ef3f54378c Introduced an ajax response 'not_implemented' with HTTP status code 501. 2016-01-02 14:55:13 +05:30
Ashesh Vashi
2aeae06882 Added support for qtIdent, qtTypeIdent, qtLiteral for quoting the
inputs.

In order to do the proper quoting around the identifier, different type,
and literal, we introduced respective functions qtIdent, qtTypeIdent,
qtLiteral in psycopg2 driver. Also, introduced them as the Jinja's
custom filter for using it directly inside the templates.

Also, created an utility - generate_keywords.py in order to generate
keyword lists from the latest PostgreSQL installation.
2016-01-02 14:54:05 +05:30
Ashesh Vashi
eb83d57c5a Introduced new controls to show the list of a node type (by name and id) as properties of other node.
Resolved a typo in privileges control.
Removed duplicate lines in backform.pgadmin.js
2015-12-28 01:00:20 +05:30
Murtuza Zabuawala
d56ddb9fa4 Adding the SQL tab for the nodes, with 'hasSQL' property set to true, in
create/edit mode. It will fetch the modified sql using the 'msql' url
specific to that node.

Also, modified by Ashesh before committing it.
i.e. Added code comments, cleanup code for the control, etc.
2015-12-26 16:15:40 +05:30
Ashesh Vashi
402e89e535 Keep all the information in the tree node data in the
getTreeNodeHierarchy(..) function, and make changes to make the
generate_url function to work with it.
2015-12-26 14:22:29 +05:30
Ashesh Vashi
15daf44e19 Moving children function within the PGChildNodeView itself, instead of
putting it in separate class PGChildNode, because - it has not been used
anywhere else.
2015-12-26 11:29:12 +05:30
Ashesh Vashi
d55b02aeab Resolved a typo in collection.js, which leads to not adding the
properties of a node in backgrid list with mode parameter.

Thanks Akshay Joshi for reporting the issue.
2015-12-23 18:11:30 +05:30
Ashesh Vashi
c51ecc69e4 Resolved few intialization issue with Node model data, moved the
privileges functionality out of the backform.pgadmin.js to make it more
modular. Now - privileges will expect the privileges data in following
format:
<name_of_the_property> : [{
    "privileges": [{
        "privilege_type": <privilege_type>,
        "privilege": true,
        "with_grant": false
    },
    ...
    ],
    "grantee": <grantee>,
    "grantor": <grantor>
    },
   ...
]

Example:
acl": [{
    "privileges": [{
        "privilege_type": "CONNECT",
        "privilege": true,
        "with_grant": false
     	}],
    "grantee": '',
    "grantor": 'ashesh'
},{
    "privileges": [{
        "privilege_type": "CREATE",
        "privilege": true,
        "with_grant": false
    },{
        "privilege": true,
        "privilege_type": "TEMPORARY",
        "with_grant": false
    }],
    "grantee": test,
    "grantor": ashesh
}]
2015-12-23 12:10:23 +05:30
Ashesh Vashi
bf5170bc89 Changed the server properties a little bit to in-corporate suggestions
from Dave. Also - remove unwanted round cornor from the menu item.
2015-12-22 10:50:33 +05:30
Murtuza Zabuawala
5f890dadc9 Remove any unwanted white-spaces while renderting any template in template code 2015-12-22 10:43:24 +05:30
Ashesh Vashi
1391003e03 Added the backgrid cell for bootstrap switch for representing the
boolean properties.
2015-12-17 19:19:59 +05:30
Ashesh Vashi
cd34ee6dd7 Switch Control was not honouring the user's options for bootstrap switch 2015-12-17 18:41:36 +05:30
Ashesh Vashi
0273c29283 Introduction of the privilege support for database object (Patch:
Murtuza Zabuawala), and Unique column control for backform (Harshal
Dhumal).

Also, includes some fixes for the model, & collection handling.
2015-12-17 18:30:42 +05:30
Ashesh Vashi
ca0b1f20df Fixed the issue while parsing, and assigning the data properly in the Node. 2015-12-17 16:13:36 +05:30
Ashesh Vashi
c796eee2a7 Do not show the properties in property windows, when they're not
applicable. i.e. not supported by that version.
2015-12-16 16:02:17 +05:30
Ashesh Vashi
54d4cdcd51 Fixed few issues with the backform custom controls.
- Fixed the server backend version check for any schema object.
- Fixed the switch control, it was not enable to toggle the values properly.
- Fixed the editableCell to work properly in the collection properties.
2015-12-16 13:43:04 +05:30
Ashesh Vashi
2f1eac1243 Removed the undo manager from the node implementation, as it is causing some issue, which rendering some code, which requires detailed attention. 2015-12-16 13:37:49 +05:30
Ashesh Vashi
d891a9d4d7 Log the executing SQL stataments and error propertly from the psycopg2 driver 2015-12-16 13:34:12 +05:30
Ashesh Vashi
8611e29c60 Pass on the browser tree events by generating node specific 'browser-node' events.
Added a test event in test.js
2015-12-16 13:27:08 +05:30
Murtuza Zabuawala
c3b517cb91 Using bootstrap-swtich for creating a custom backform control for
boolean values. (Modified quite a lot by Ashesh, before committing).

This patch also allow to set the header class in the backgrid through
setting  'cellHeaderClass' property of the schema object for any of the
node. It will allow us to set the different behaviour of the cell in the
list. One of the test case for it is: this will allow us to set the
different width of each column in the list using CSS class(es).
2015-12-04 17:16:49 +05:30
Murtuza Zabuawala
a04ef2de43 Fixed an issue related taking input as raw_input on Python 2.
This is regression, introduced in the commit-id:
209ee78b25
2015-12-04 15:37:06 +05:30
Ashesh Vashi
57d6c3b406 Do validation before enabling the Save button. 2015-12-04 15:33:16 +05:30
Ashesh Vashi
537df154fe Fixing few issues with context menu icon missing.
Introduced a new ajax function to return the HTTP Status code 410 (GONE).
Changed the location of the javascript from each modules, it loads.

Added .swp, .swo files in the .gitignore file
2015-12-04 14:47:18 +05:30
Ashesh Vashi
b36e264fd3 Load collection.js along with the node.js from browser.js 2015-11-28 20:19:29 +05:30
Ashesh Vashi
6d46dfbfba Added new url rules for each node by change NodeView class:
- Renamed the URL 'nodes' to 'children', because - we'll return the
  children for the current node.
- Using the URL 'nodes' to fetch all nodes of its type, when not
  specified the node-id, otherwise regenerate that node info using the
  node-id (it will be used by the refresh function).

- Added the URL 'msql' for fetching modified SQL for the modified
  objects.
- Separated the URL 'deps' (GET/POST methods) to 'dependency' and
  'dependent', because - it will be used to fetch the properties of the
  object, not manipulate it. (as suggested by Dave).

This commit includes the changes related to it in the specific nodes.
(i.e. server-group, and server).

Also, includes a javascript change to ask the user (if they really want
to leave the page, and it is not an accidental navigation by keyboard
shortcuts).
2015-11-23 13:57:43 +05:30
Ashesh Vashi
9bc9025075 Issues resolved related to connection management and collection nodes:
- Allow to release connection using the database OID (did).
- Generate correct url for the collection nodes.
- Removed the server-type from the collection node module, from the
  generate_browser_collection_node(...) function.
- Show version string, and not version integer in the server properties
  (when connected).
2015-11-20 14:55:55 +05:30
Murtuza Zabuawala
e52fd0d349 Resolved an issue related Python 3.x compability regarding setting
property name was same as variable.
2015-11-20 11:34:27 +05:30
Ashesh Vashi
d753374977 Resolved a typo in the version check condition during schema generation.
Also, resolved an issue related showing the correct server variant in
properties dialog, it is a regression introduced by the patch server
version check.
2015-11-20 10:45:35 +05:30
Ashesh Vashi
5ff09223a2 Allow to generate events from the nodes, whenever some any events.
i.e.
'server-connect' and 'server-disconnected' events will be generated
while server gets connected and disconnected respectively.

For demo purpose - listening to the server connection from the test
script.
2015-11-19 23:42:01 +05:30
Ashesh Vashi
77834ccdda Changed the logic to identify the PostgreSQL server variant, when we
connect to the database server. Also, added modified the way, we do
check the node is supported by the server.

Instead of creating separate blueprint for the server types, they will
be independently works. In order to add different variant of the
PostgreSQL, we need to extend the ServerType class, and override the
'instanceOf' function for identification using version string. Please
take a look at the ppas.py for the example.

During checking the back-end support for the node, we will also check
the server type (variant) along with the version within the range of
maximum and minimum version for the node. And, the same support added
for the schema attributes in front-end (JavaScript).

Really thankful to Khushboo Vashi for her initial work in front-end. I
took it further from there.
2015-11-19 23:18:00 +05:30
Khushboo Vashi
3323543b5a Resolved few issues in connection creation in the psycopg2 (pgAdmin
driver)

1. Update correct variable for database information in the connection
   manager.
2. Raise exception, when database not found, instead of return the
   (boolean, error message) tupple.
2015-11-19 14:42:37 +05:30
Ashesh Vashi
80314a9aa3 Allow to connect any of the database using its OID using the connection
manager, once the connection to the maintenance database has been made,
because - we will have did (i.e. Database OID) most of the time for the
any node, and not its name as identifier.

This will allow us to work directly with OID, and we will not need to
bother about renaming of the database name.
2015-11-17 19:14:09 +05:30
Ashesh Vashi
9e67000e7b Removed debug code added in the commit:
ed8600ef89
2015-11-17 12:05:03 +05:30
Ashesh Vashi
3077da0062 Resolved an issue when refreshing any browser node 2015-11-17 11:54:32 +05:30
Khushboo Vashi
ed8600ef89 Adding support for collection browser node. 2015-11-17 11:53:14 +05:30
Murtuza Zabuawala
52b86b6fb4 Added NoneType exception handling in settings & server modules while returning json response. 2015-11-13 16:59:16 +00:00
Murtuza Zabuawala
64d74d0819 Login Issue fixed, As encryption/decryption returns output in bytes datatype it fails to authenticate in python3. 2015-11-13 16:54:49 +00:00
Murtuza Zabuawala
209ee78b25 First round of Python 3 compatibility fixes. 2015-11-06 10:23:19 +00:00
Ashesh Vashi
cbab08aaaf Do not set focus to the properties container, when selected any node.
As discussed with Khushboo, we need a negate function of disabled in the
backgrid cell.
2015-11-03 12:36:34 +05:30
Khushboo Vashi
a1170c4c82 Do not allow to edit data from the properties dialog 2015-11-03 11:31:35 +05:30
Ashesh Vashi
45596dffa0 Resolved few undo action on UI tabs - tabs were not getting activated
during undo-redo action. Also, resolved the focus losing issue, which
closing the subnode editor using undo action.

Also, resolved an issue related to 'beforeopen' failed on server node,
due to api changes on tree events.
2015-10-30 13:07:12 +05:30
Ashesh Vashi
30c560f33b Added undo action on some of the UI changes too.
i.e. Switch between the tabs, opening/closing the subnode in edit mode.

Also, removed the Save, Cancel buttons from the subnode editor, it was
looking very redudant. Ctrl+Z for undo, Ctrl+Shift+Z/Ctrl+Y for Redo
shortcut will be good enough for undoing all the changes in the
properties panel.
2015-10-30 02:03:29 +05:30
Ashesh Vashi
c1db54b2c2 Allow to save only the partial model changes, undo-redo operation
within the edit/create dialog/panel using the backbone.undo.js.
2015-10-28 22:54:30 +05:30
Khushboo Vashi
c1503ade47 Introducing the infrastructure for colleciton of the subnodes listing,
creation, and editing within the properties panel infrastructure.

We do use the backgrid.js for listing the subnode collection, and for
editing/creating new object for the subnode, we do use the same
infrastructure using the backform.
2015-10-28 22:36:09 +05:30
Ashesh Vashi
c53b57a013 Resolved couple of small bugs introduced during database server
connection management implementation.
2015-10-28 22:34:25 +05:30
Ashesh Vashi
a0cfddffdf Adding maximum session idle time in the config.py file 2015-10-22 11:49:53 +05:30
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
Ashesh Vashi
b52d72f176 Do flush the changes done after creating the require tables. Because -
it causes an issue performing DDL operations without sending DML to the
database, flush(..) does the job for us, it sends those operations to
the database without committing it.

And, this was causing the issue in current implemenation, while setting
'Administrator' role to the given email-id after the create_role, and
create_user operations during setup.
2015-09-22 11:19:50 +05:30
Ashesh Vashi
4e5e0c125f Resolved an issue related enabling the menus for the selected node 2015-09-21 10:15:41 +05:30
Ashesh Vashi
798398dba5 Fixed few bugs and changed the node create/edit view to use the dialog
(tabbed) UI.

Also, fixed few bugs pointed by Dave:
* Open the URL in separate browser tab/window.
* Fixed few CSS changes for look and feel for the dialog view
* Some of the panels were not listed in the context menu for the
  wcDocker.
2015-08-11 19:19:29 +05:30
Ashesh Vashi
b0b964dd55 Adding the module.js route for each in the NodeView class. 2015-07-30 16:17:34 +05:30
Ashesh Vashi
7d9224ba8b Changed the disabled control looks different from the eneabled.
Changed the width of fieldset-content.
2015-07-23 18:32:05 +05:30
Khushboo Vashi
b4e20d9119 Updated alertify.js to 1.4.1
This release contains some features/bugs, which will be used by connection management functionality
2015-07-23 18:12:06 +05:30
Ashesh Vashi
ffa65f2bfb Using disconnected server icon from pgAdmin III 2015-07-22 22:44:54 +05:30
Ashesh Vashi
146e901327 Show the disabled control in view only mode of properties 2015-07-22 22:27:32 +05:30
Ashesh Vashi
86479453b3 Check for current schema version on startup and update the schema (if
required).
2015-07-22 22:12:42 +05:30
Ashesh Vashi
500271a2ed Showing the dockable pane looked like a dialog. 2015-07-22 17:56:17 +05:30
Ashesh Vashi
8a8c8bbae4 Try to make the look and feel of the UI same as it was earlier for consitency. 2015-07-22 09:46:11 +05:30
Ashesh Vashi
9d372a4555 Updated wcDocker to the latest version 2015-07-20 16:06:17 +05:30
Ashesh Vashi
59e87183a1 Resolved a bug introduced in last commit 2015-07-17 11:22:14 +05:30
Ashesh Vashi
dee3185bae Resolved a bug with the menu enable/disble logic.
Also, do not generate list disabled menu in the context menu
2015-07-17 10:06:04 +05:30
Ashesh Vashi
605f9aba32 Removed the readonly mode from the properties panel for any object.
Changed UI as per feedback from Dave
2015-07-14 13:15:59 +05:30
Ashesh Vashi
6ef2384e7f Allow to make change the behaviour of backform control based on other
attribute value.
2015-07-14 09:29:49 +05:30
Ashesh Vashi
544284ba89 Correcting the path of the minifized version of javascripts, when set
config.DEBUG to False (Reported by Khushboo Vashi)
2015-07-01 11:59:24 +05:30
Ashesh Vashi
aa150030eb Introduced a mechanism to load required javascripts at runtime
(lazy loading) using the require.js. This allows us to load the
javascript required for any node, only when it was loaded in the browser
tree. Also, introduced the mechanism to show/edit/create of any node in
a tab panel (wcDocker.Panel).
2015-06-30 11:21:57 +05:30
Ashesh Vashi
35d01bea3e Introduced a class - NodeView to achieve REST API required by the
PostgreSQL node(s).

Browser Tree Node (PostgreSQL object) requires more than just CRUD.
i.e.
   - CRUD (Create, Read, Update & Delete)
    - Reversed Engineered SQL for the object
    - Modified Query in edit mode
      i.e. ALTER TABLE ...
    - Statistics
    - List of dependents
    - List of dependencies
    - Children node list

This class can be inherited to achieve the different routes for each of
the object types/collections.

    OPERATION      |              URL       | Method
    ---------------+------------------------+--------
    List           | /obj/[Parent URL]/     | GET
    Properties     | /obj/[Parent URL]/id   | GET
    Create         | /obj/[Parent URL]/     | POST
    Delete         | /obj/[Parent URL]/id   | DELETE
    Update         | /obj/[Parent URL]/id   | PUT

    SQL (Reversed  | /sql/[Parent URL]/id   | GET
    Engineering)   |
    SQL (Modified  | /sql/[Parent URL]/id   | POST
    Properties)    |

    Statistics     | /stats/[Parent URL]/id | GET
    Dependencies   | /deps/[Parent URL]/id  | GET
    Dependents     | /deps/[Parent URL]/id  | POST

    Children Nodes | /nodes/[Parent URL]/id | GET

    NOTE:
    Parent URL can be seen as the path to identify the particular node.

    i.e.
     In order to identify the TABLE object, we requires information
     about the server -> database -> schema objects.

     Hence, the Parent URL for the TABLE object will be something like
     this as below:
     <int:sid>/<str:database>/<str:schema>

Inherited a new classes ServerGroupView and ServerView, which are
inherited from the NodeView for the implementation of above operations.
2015-06-29 13:41:56 +05:30
Ronan Dunklau
b626eec0fd Inherited the test, about & help module from PgAdminModule class to load
them automatically by PgAdmin.
2015-06-29 13:26:43 +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
Ronan Dunklau
9e0b011ec8 Fixed the letter case of the javascript file names.
Also, JSON data should be returned to the client using an
application/json MIME-TYPE using flask's jsonify function.
2015-06-29 12:23:11 +05:30
Dave Page
751f8383fa Handle standard menu items defined by Nodes in the browser.
The File menu now includes a "Create" submenu, and Delete/Rename
options. Nodes can offer Delete/Rename functionality, and the
options on the menu are automatically enabled/disabled based on
the selected node. Each node can also offer Create functionality,
and specify a list of node types (including itself) from which the
option should be made available. The menu is dynamically generated
based on the selected node.

The Context menu on the treeview works in a similar way, except that
nodes can offer any context menu items (we don't allow this on the
top menu, as that should stay consistent to avoid user confusion).
2015-03-13 10:35:12 +00:00
Dave Page
af7dcd49b4 Prevent treeview items from wrapping. 2015-03-11 15:39:54 +00:00
Dave Page
e451ad5ddc Make the SQL Pane "just another tab". This allows the user to position it
as required, and by default makes the UI less cluttered.
2015-03-10 14:31:49 +00:00
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
Dave Page
7f68d6fced Update the setup script and config database to handle versioning.
This allows us to update the configuration database schema as needed,
and use the setup script to update it to the current version.

NOTE: Existing databases will need to be recreated once following
this commit. It doesn't seem worth handling the "upgrade from v0"
case when I'm probably the only active developer right now.
2015-03-09 15:06:10 +00:00
Dave Page
f040efb473 Make the jQuery-contextMenu control globally available as it's used by wcDocker. 2015-03-09 13:14:20 +00:00
Dave Page
c9b0273a14 Fix iFrame panels on Firefox. 2015-03-09 09:57:51 +00:00
Dave Page
dd78a2650c Use the minimised version of the wcDockerSkeleton theme. 2015-03-09 09:46:52 +00:00
Dave Page
caff78053b Update to use the new skeleton CSS from wcDocker, and restore a default
layout if the saved one fails for any reason.
2015-03-05 11:13:15 +00:00
Dave Page
7441d98c49 Allow modules to create browser panels. 2015-03-03 16:23:19 +00:00
Dave Page
497164d741 Don't restyle scroll bars. 2015-03-03 16:22:28 +00:00
Dave Page
527620d34e Update wcDocker to enable properly translation of the context menu options. 2015-03-03 11:11:15 +00:00
Dave Page
cd059aaea3 Fix i18n for the docking system. 2015-03-03 10:51:29 +00:00
Dave Page
eef0a48823 Fix placeholder text. 2015-03-03 09:45:53 +00:00
Dave Page
06be3d39be Replace the browser layout code with a new system based on wcDocker.
This is far more powerful, giving us tearable tabsets, versatile docking
and various other features.
2015-02-27 13:47:48 +00:00
Dave Page
b050b871c0 Fix the positioning of the security forms and the colours of the dialogue buttons. 2015-02-26 10:06:22 +00:00
Dave Page
44c37da0a3 More misc fixes. 2015-02-25 20:30:09 +00:00
Dave Page
613df8b596 Copyright year fixes and doc tweaks. 2015-02-25 20:25:41 +00:00
Dave Page
0988245ccd Remove debug message. 2015-02-25 17:06:43 +00:00
Dave Page
83cbe87040 i18n support. 2015-02-25 17:06:00 +00:00
Dave Page
39089cca21 Add a Sphinx based help system, and include some initial docs on development. 2015-02-23 10:51:47 +00:00
Dave Page
bedaa52693 Fix the about menu option, only display menus if they have items on them,
and add a management menu for future use.
2015-02-20 10:43:50 -05:00
Dave Page
7179b79b8c Add an ID to main menu options. 2015-02-20 10:26:25 -05:00
Dave Page
a36cb5ae10 Make context menu items hookable. 2015-02-20 09:56:02 -05:00
Dave Page
37be918074 Move the JS code for the main browser out of the HTML template
and into the browser.js view.
2015-02-20 09:37:42 -05:00
Dave Page
b43580a19e Add a context menu to the treeview, with options to delete and rename server nodes.
TODO: Make the menu items hook in.
2015-02-18 22:06:12 -05:00
Dave Page
89cc11fb80 This is a big one campers; Add initial support for treeview nodes.
This commit adds the following:

- Storage of server groups in the configuration database
- Creation of a default server group on in the database
- A mechanism for plugging in treeview node types
- A node type for server groups with:
  - Treeview display
  - Custom per-node javascript implementing a menu option/dialogue to add new groups
  - Custom per-node CSS to style the treeview node
- JSON formatted data in response to AJAX requests, including:
  - Success/failure indication
  - Error message
  - Extra info (e.g. stack trace)
  - The original request data
  - Additional return data, e.g. node ID and label etc.
2015-02-15 17:10:53 -05:00
Dave Page
e2832351ed Miscellaneous fixes and cleanups. 2015-02-13 15:19:08 +00:00
Dave Page
b5abf2c640 Cleanup the way stylesheets and scripts are injected into pages by modules. 2015-02-13 14:48:31 +00:00
Dave Page
45d536f524 Remove "vendor" from the global JS path. 2015-02-13 13:36:00 +00:00
Dave Page
567c567351 Add the CodeMirror addons. I can see us needing the majority of these. 2015-02-13 13:29:24 +00:00
Dave Page
2f154bbed4 The previous commit inadvertently added parts of the browser treeview implementation.
This adds the rest (which still requires further work to make it do anything useful).
2015-02-13 13:24:13 +00:00
Dave Page
b09c1b6c68 Fix the gutter height of the editor when the parent is resized. 2015-02-13 13:13:36 +00:00
Dave Page
f4982efb19 Oh look, a syntax highlighting, line numbering, block folding, auto-complete-capable editor. 2015-02-13 11:57:23 +00:00
Dave Page
075bce2b40 Fix the navbar so it's responsive 2015-02-12 14:59:28 +00:00
Dave Page
dbd7974e2a Render settings related JS from the settings blueprint. 2015-02-12 10:57:09 +00:00
Dave Page
4c29f4385f Render browser settings into the template rather than using synchronous AJAX calls to get them. 2015-02-12 10:46:21 +00:00
Dave Page
bb6a3f9b5b Use minified output when not in debug mode, and non-minified when debugging.
Update jQuery while we're at it.
2015-02-12 10:28:15 +00:00
Dave Page
afb029e284 Factor out client side settings functions into their own JS file,
and add additional variations for getting ints, floats and bools.
2015-02-11 15:50:36 +00:00
Dave Page
adeb2f9e84 Allow multiple settings to be stored at once to avoid multiple requests. 2015-02-11 12:50:45 +00:00
Dave Page
e995104000 Initial cut at saving/retrieving the main browser layout.
Still needs some work to:

- Minimise AJAX calls by writing multiple settings at once.
- Move the settings storage/retrieval JS code into a global file
- Avoid using synchronous AJAX calls in the main thread
2015-02-11 10:00:57 +00:00
Thom Brown
506dd6437f Various HTML 5 fixes. 2015-02-06 13:15:36 +00:00
Dave Page
1b6d7edd01 Add the core of the main browser layout. 2015-02-05 14:06:20 +00:00
Dave Page
afd5626fe4 Add a simple module for storing and retrieving settings from the
config database.
2015-02-03 11:48:15 +00:00
Dave Page
e4bec5ad1e Use the full screen width. 2015-01-28 18:02:13 +00:00
Dave Page
9d94848af4 Minor tweaks to the dialog code. 2015-01-28 17:56:13 +00:00
Dave Page
65dc4320f1 Replace bootstrap-dialog with Alertify.js, which is more configurable
and supports non-modal dialogs.
2015-01-28 15:57:03 +00:00
Dave Page
53d649de70 Add support for creating dialogs, and add an About dialog.
This adds bootstrap-dialog to help with creation of nice dialogs,
and adds the ability for modules to render Javascript into the
browser, and specify onclick handlers in the menu system.

Also add a basic About dialog, using the new infrastructure and
showing some useful info about the application.
2015-01-27 16:54:39 +00:00
Dave Page
d86c90fa73 Blacklist the test module by default. 2015-01-27 14:25:40 +00:00
Dave Page
d492da3ca1 Add automatic browser menu integration for modules.
Modules may now include functions that return lists of menu items
that will be included on the main browser window menu. While we're
at it, move the test views into a separate module.
2015-01-27 14:18:27 +00:00
Dave Page
0cff5fca2c Restructure templates to avoid conflicts between modules. 2015-01-26 16:27:16 +00:00
Dave Page
7c60fb3377 Support a desktop authentication mode.
This uses a single default user in the config database, which is
auto-logged into the app when SERVER_MODE = False. In this mode we
also hide/remove user-related functions in the UI.
2015-01-26 15:20:28 +00:00
Dave Page
10515431c7 Add authentication and the basis of the browser module.
A user authentication module based on flask-security is added, which
allows users to login and change/recover passwords etc. Custom templates
are included for the user/password UIs.

A new setup script will initialise the user (and later settings) DB,
adding the first user and granting them an Administrator role.

A redirects blueprint module is added to handle simple URL redirects.

A browser module is added and currently renders a skeleton page with
a menu bar, gravatar and jumbotron.

NOTE FOR LATER: Currently this code might make the nice basis for any
web app that needs user management and plugins. Hmmm....
2015-01-22 15:56:23 +00:00
Dave Page
7fa40d7671 Use Python docsctrings 2015-01-21 12:00:13 +00:00
Dave Page
df5054f253 No need for content here now. 2015-01-21 11:18:02 +00:00
Dave Page
5a485e7ab8 Add a base template with Bootstrap and jQuery ready to go. 2015-01-20 17:02:04 +00:00
Dave Page
47e779266b Enable templates and static files in the utils module. Refactor to
ease use as a template for other modules in the future.
2015-01-20 13:57:51 +00:00
Dave Page
dd40207617 Don't run the webserver in debug mode as it breaks the runtime. 2015-01-20 13:51:20 +00:00
Dave Page
0df7225561 Put the favicon in the right place. 2015-01-20 12:32:44 +00:00
Dave Page
7b8cb207ab Support dynamically loaded modules. 2015-01-20 12:32:06 +00:00
Dave Page
bb3efff063 Remove incorrectly placed static dir. 2015-01-20 12:29:29 +00:00
Dave Page
2c1688e6f4 Use Flask blueprints for modularisation, per Khushboo Vashi. 2015-01-19 16:38:47 +00:00
Dave Page
ca6ef66b61 Disable the DEBUG log handler so our own is used. 2014-12-18 17:56:17 +00:00
Dave Page
b9bf6d9aa3 Restructure to enable use of modules for different components of pgAdmin. 2014-12-18 17:49:09 +00:00
Dave Page
255d6c1437 Improve commenting 2014-12-17 15:27:54 +00:00
Dave Page
417ad2c6ee Make the application name and version details configurable. 2014-12-17 12:52:43 +00:00
Dave Page
3e6436bc9b Prevent werkzeug starting up it's own stream handler so that all
messages are routed through pgAdmin's handlers.
2014-12-17 12:44:07 +00:00
Dave Page
a0628f4a84 Ensure requests to the web server hit the file log too. 2014-12-16 18:21:26 +00:00
Dave Page
53389d6ee0 Enable static file handling. 2014-12-16 18:10:07 +00:00
Dave Page
c791d2a15f Add favicon. 2014-12-16 17:55:19 +00:00
Dave Page
cdcafa66f2 Fix typo. 2014-12-16 17:47:33 +00:00
Dave Page
a1a6e5356f More basic setup. 2014-12-16 17:37:53 +00:00
Dave Page
ba939f27d7 Use multiple logging handlers so we can have messages going to both
the console and a file, with differing formats and levels.
2014-12-16 17:14:48 +00:00
Dave Page
2d21ea059b Add a basic logging system. 2014-12-16 15:54:29 +00:00
Dave Page
cd9d005c49 Remove CherryPy from the source tree, and change references to Flask
instead. Add support to the runtime to allow the user to specify the
Python path. This needs to be more automated for release, but will be
useful for debugging and development.
2014-12-16 12:53:09 +00:00
Dave Page
e120c43663 Add a "ping" handler. 2013-10-04 21:48:01 +01:00
Dave Page
457a842cec Find a random port number to use for the application server to avoid conflicts
with any other apps that may have already bound to the default port used by CP.
2013-10-04 21:48:01 +01:00
Dave Page
28f45ea9f9 Initial PoC of a CherryPy app integrate with the runtime.
Upon startup, the runtime will attempt to locate pgAdmin4.py in a
number of different relative locations. Once found, it will execute
it in a new thread. The main window is then created and the brower's
initial page is set to the root of the CherryPy server. At present,
that's http://127.0.0.1:8080.
2013-06-21 23:21:11 +01:00