Commit Graph

2576 Commits

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