Commit Graph

27 Commits

Author SHA1 Message Date
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
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
Dave Page
62fcfd928d Add context-sensitive SQL help. 2016-04-12 13:36:06 +01:00
Ashesh Vashi
e07ebdc049 Moving the messages used in common utilities in a separate javascript. 2016-04-11 17:07:58 +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
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
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
Dave Page
5ea822f33e Preferences dialogue. Patch by Ashesh and Khushboo Vashi. 2016-03-07 11:48:53 +00:00
Dave Page
2a52462dbf Add a simple version check mechanism to warn the user if a new release is available. 2016-02-08 16:28:20 +00:00
Ashesh Vashi
91c0388a47 Adding the Login/Group Role Node.
Also - includes:
* Added 'parent_id' in the 'generate_browser_node' function of the Nodes
  to allow them to move around the parents objects (specially through
  update/save functionality).

* Handles the issue related to adding the older object back to the
  collection (DataModel).

Author: Ashesh Vashi
Reviewed by: Neel Patel, and Akshay Joshi.
2016-02-05 09:48:38 +05:30
Ashesh Vashi
2acba32c86 Moving the data model and collection to separate module for better code
handling.
2016-01-19 10:16:02 +05:30
Dave Page
694506453b Copyright updates for 2016. 2016-01-18 14:48:14 +00:00
Dave Page
94bed721bd Bump the version requirement for Flask-Gravatar to 0.4.2.
This version has been restructured and plays nicely with our runtime.
2016-01-18 13:27:40 +00:00
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
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
ed8600ef89 Adding support for collection browser node. 2015-11-17 11:53:14 +05:30
Murtuza Zabuawala
209ee78b25 First round of Python 3 compatibility fixes. 2015-11-06 10:23:19 +00:00
Ashesh Vashi
e27e39a8f3 Added support for the infrastructure for on demand access/create the
server connection.

The BaseDriver and BaseConnection are two abstract classes, which allows
us to replace the existing driver with the currently used. The current
implementation supports to connect the PostgreSQL and Postgres Plus
Advanced Server using the psycopg2 driver.
2015-10-20 12:33:29 +05:30
Ashesh Vashi
9d372a4555 Updated wcDocker to the latest version 2015-07-20 16:06:17 +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
eb6580b43a Introduced a PgAdmin class inherited from the Flask, which looks for
submodules inherited from the PgAdminModule instead of regular
Blueprint. This allows us to load the module automatically from the
under the pgadmin directory, and will work to extend the pgAdmin
extension module.

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

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

For example, the BrowserPluginModule abstract base class defines the
following methods:
- jssnippets
- csssnipeets
- node_type
- get_nodes
2015-06-29 12:28:41 +05:30
Dave Page
fe834d1ed2 Re-organise node structure and loading to make things somewhat more
simple. This also adds the ability to display servers on the treeview.
2015-03-10 13:09:11 +00:00
Dave Page
613df8b596 Copyright year fixes and doc tweaks. 2015-02-25 20:25:41 +00: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
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