This significantly speeds up loading of the application; in an average of 3 tests, v1.6
loaded in 11.5s in the runtime on a Mac, whilst the webpacked version of the code
loaded in 5.53s.
algorithm.
This patch takes care of:
* Consistent behaviour during create, update operation on any node.
- It should return the node data during creating a new object, or
updating the existing one.
* Now that - we have consistent behaviour during these operations, we
can consistently move, update the tree item based the node data from
the server.
* Implemented the methods for each node to get the information about
that particular node only.
* Using the above changes to implement the 'refresh' operation on tree
node properly.
I must thank Surinder, and Harshal for helping me implement the 'node'
method, and also changed the behaviour of create & update methods to
return the node data for most of the nodes.
Fixes#1244
Made backend changes for:
* Taking care of the connection status in the psycopg2 driver. And, when
the connection is lost, it throws a exception with 503 http status
message, and connection lost information in it.
* Allowing the flask application to propagate the exceptions even in the
release mode.
* Utilising the existing password (while reconnection, if not
disconnected explicitly).
* Introduced a new ajax response message 'service_unavailable' (http
status code: 503), which suggests temporary service unavailable.
Client (front-end) changes:
* To handle the connection lost of a database server for different
operations by generating proper events, and handle them properly.
Removed the connection status check code from different nodes, so that
- it generates the proper exception, when accessing the non-alive
connection.
Fixes#1387
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.
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.
known events, when any activity happens on the browser layout.
The following types of events will be triggered through the browser
event manager.
- pgadmin-browser:frame:* [1]
- pgadmin-browser:frame-<name>:* [1]
- pgadmin-browser:panel:* [1]
- pgadmin-browser:panel-<name>:* [1]
- pgadmin-browser:panel
- pgadmin-browser:frame
- pgadmin-browser:tree
- pgadmin-browser:tree:* [2]
[1] The '*' denotes some of the events generated by the wcDocker, which
can be useful to do some operations.
These events are:
+ wcDocker.EVENT.UPDATED
+ wcDocker.EVENT.VISIBILITY_CHANGED
+ wcDocker.EVENT.BEGIN_DOCK
+ wcDocker.EVENT.END_DOCK
+ wcDocker.EVENT.GAIN_FOCUS,
+ wcDocker.EVENT.LOST_FOCUS
+ wcDocker.EVENT.CLOSED
+ wcDocker.EVENT.BUTTON
+ wcDocker.EVENT.ATTACHED
+ wcDocker.EVENT.DETACHED
+ wcDocker.EVENT.MOVE_STARTED
+ wcDocker.EVENT.MOVE_ENDED
+ wcDocker.EVENT.MOVED
+ wcDocker.EVENT.RESIZE_STARTED
+ wcDocker.EVENT.RESIZE_ENDED
+ wcDocker.EVENT.RESIZED
+ wcDocker.EVENT.SCROLLED
[2] The '*' denotes all the events generated by the Browser Tree
(aciTree).
The extension modules can utilize these events to do some operations on
nodes, and panels.
This patch includes showing 'Reversed Engineered Query' for the selected
node (if allowed) using the above approch.
The ShowNodeSQL module looks for two events.
1. SQL Panel Visibility change.
- Based on the visibility of that panel, we start/stop listening the
node selection event.
2. Node Selection in Browser tree
- Based on the selected node type, it will look for 'hasSQL'
parameter of the node, and fetch the Query from the server, and
show it in the SQL editor.