Commit Graph

47 Commits

Author SHA1 Message Date
Khushboo Vashi
ab54a6d39a Fix external utilities to run with Python 2.6. 2018-06-15 12:38:31 +01:00
Murtuza Zabuawala
be055ce57d Update Python and JS modules. Fixes #3154 2018-04-04 10:47:01 +01:00
Murtuza Zabuawala
c312b03f6f Pass the service name to external processes. Fixes #3195 2018-03-19 11:01:04 +00:00
Khushboo Vashi
63ba3402e8 Ensure SSL options are pushed down to external tools like pg_dump. Fixes #3122 2018-03-15 07:35:47 -04:00
Dave Page
3c686d3fbe PEP-8 fixes 2018-03-13 17:30:07 -04:00
Khushboo Vashi
802269910c Fix unicode handling in the external process tools and show the complete command in the process viewer. Fixes #2963. Fixes #3157. 2018-03-13 16:45:20 -04:00
Khushboo Vashi
a4124c2496 PEP8 fixes. 2018-03-02 09:37:11 +00:00
Murtuza Zabuawala
6f25f4d175 Fix PEP-8 issues in feature_tests, dashboard, about and misc module's python code. Fixes #3082 2018-02-09 12:57:37 +00:00
Ashesh Vashi
c32eb6bd37 Fixed the warnings/errors reported by eslint for all the static
javascripts.
2018-01-12 13:00:14 +05:30
Dave Page
89821c0d19 Update copyright notices for 2018. 2018-01-05 10:42:50 +00:00
Harshal Dhumal
7db7da5b0e Display process output as it happens. Fixes #2811 2017-11-27 13:00:47 +00:00
Alexander Lakhin
8f070f6095 Fix utility output capture encoding. Fixes #2854 2017-11-09 08:51:56 -05:00
Atul Sharma
788f7f3a69 Bundle fonts with pgAdmin so we have a standard set for all platforms.
Research by Shirley at Pivotal.
2017-09-13 16:01:14 +01:00
Ashesh Vashi
845025db8f Some cosmetic changes.
- Loading 'pgadmin' as 'sources/pgadmin', as found under the 'sources'
  reference directory to be consistent with other files.
- Removed the 'pgadmin' reference from the base.html template.
- Renamed 'pgadmin.slickgrid.editors.js', and
  'pgadmin.slickgrid.formatters.js' as 'editors.js', and 'formatters.js'
  respectively, as they're already in the 'pgadmin/static/js/slickgrid'
  directory.
- Removed the duplicate entry of 'translations' from the webpack.shim.js
2017-08-09 16:52:12 +05:30
Surinder Kumar
4a91bcde30 Webpack all the things! Fixes #2135
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.
2017-07-18 15:13:17 +01:00
Ashesh Vashi
1a7c9d5ca1 Using client-side 'url_for' implementation in the module - bgprocess
(background-processes).
2017-06-13 09:18:48 +05:30
Ashesh Vashi
ae80976689 Using the client-side translation using the client-side 'gettext'
implementation.

This is the first step towards 'Avoid creating the javascript modules
using Jinja templates'.
2017-06-07 15:53:05 +05:30
Murtuza Zabuawala
1cb2a62fa8 Ensure object names are properly escaped for external process management. Fixes #2405 2017-05-15 13:01:12 +01:00
Jonas Thelemann
65f21a8cd7 Replace all occurrences of "can not" with "cannot". 2017-04-05 13:38:14 +01:00
Ashesh Vashi
7767c085c3 Resolved an issue finding the python interpreter on *nix systems, and
Windows 2008 R2 (32 bit), while running the pgAdmin 4 as runtime for
the PostgreSQL one click installers.

- Found a typo in runtime code, we were appending the path using ';' on
  *nix systems too. We should have used ':', and that did not allow the
  os.environ['PATH'] to identify the correct path of the python
  interpreter under the 'venv' directory.

- On Windows 2008, it was not honouring the environment variables, set
  under the Qt application (e.g. pgAdmin4.exe runtime), in the python
  application. (e.g. pgAdmin4.py). We will need to assume that - the
  python interpreter resides under the 'venv' directory outside the
  'bin' directory.

- Also, on windows 2008, it was setting PYTHONHOME environment variable
  to the full path of the pgAdmin4.exe, we need to reset it to 'venv'
  directory, if we find the python interpreter under it.

Thanks Murtuza Zabuawala for tips, and help.
2017-03-10 21:19:06 +05:30
Murtuza Zabuawala
bc63652811 Fix the issue where Import/Export was failing in linux runtime. Fixes #2166
Issue:
Changes done by Ashesh in pgAdmin4.py file for setting up PYTHONHOME variable to sys.prefix was applicable only for windows only.

Additionally I have also added exception handling for file provided by user for Backup/Restore/Import/Export.
2017-03-09 09:54:55 +00:00
Jonas Thelemann
c34f5fd2d4 Use "could not" consistently, instead of "couldn't" which was used in some places. 2017-03-07 10:29:54 +00:00
Ashesh Vashi
f2fc1ceba8 Resolved quite a few file-system encoding/decoding related cases.
In order to resolve the non-ascii characters in path (in user directory,
storage path, etc) on windows, we have converted the path into the
short-path, so that - we don't need to deal with the encoding issues
(specially with Python 2).

We've resolved majority of the issues with this patch.
We still need couple issues to resolve after this in the same area.

TODO
* Add better support for non-ascii characters in the database name on
  windows with Python 3
* Improve the messages created after the background processes by
  different modules (such as Backup, Restore, Import/Export, etc.),
  which does not show short-paths, and xml representable characters for
  non-ascii characters, when found in the database objects, and the file
  PATH.

Fixes #2174, #1797, #2166, #1940

Initial patch by: Surinder Kumar
Reviewed by: Murtuza Zabuawala
2017-03-07 15:31:03 +05:30
Murtuza Zabuawala
a914ea088c Python 2.6 compatibility fixes. 2017-02-08 16:28:04 +00:00
Ashesh Vashi
b7c5039416 Fix process execution. Fixes #1679. Fixes #2144.
Re-engineer the background process executor, to avoid using sqlite as some builds of
components it relies on do not support working in forked children.
2017-02-04 15:26:57 +01:00
Dave Page
f221194bcc Update copyright notices for 2017. 2017-01-04 13:33:32 +00:00
Dave Page
29743ad3c4 Allow selection of process output and commands. 2016-11-18 12:05:19 +00:00
Murtuza Zabuawala
e6d018c44f Ensure we handle external processes that fail to start. Fixes #1679 2016-10-21 15:35:06 +01:00
Dave Page
790b28fb61 Flask-Babel 0.11+ compatibility. Fixes #1496 2016-07-25 17:23:10 +01:00
Dave Page
60659975ed Stop using deprecated imports. 2016-07-22 16:25:23 +01:00
Dave Page
78d329fc47 Don't blink the elapsed time - it's distracting. 2016-06-24 14:01:23 +01:00
Dave Page
7d0fe669ca Code tidy. 2016-06-21 14:21:06 +01:00
Dave Page
3026b470e9 Optimise Python imports. 2016-06-21 14:12:14 +01:00
Ashesh Vashi
a35288e25d Save the runtime status information in the application object for using
it other places.

globals() does not return consistent value across the application
context.

Thanks Neel Patel for reporting the issue.
2016-06-21 15:13:04 +05:30
Ashesh Vashi
bfe1b773b3 Do not rely on config.SERVER_MODE for determining (if it is running from
runtime, or time), instead check the environment variable PGADMIN_PORT
to do that as per Dave.
2016-06-20 22:00:16 +05:30
Ashesh Vashi
800d5d71d7 Use the python interpreter explicitly while running the background
process from the runtime.
2016-06-20 21:31:19 +05:30
Dave Page
f2b6ab816b Process manager UI cleanup. 2016-06-17 15:24:15 +01:00
Dave Page
fd6c43b393 String improvements. 2016-06-17 14:21:14 +01:00
Murtuza Zabuawala
b94b47f021 Fix issue which was showing incorrect datetime in Backup/Restore dialog. Fixes #1377 2016-06-17 13:54:31 +01:00
Neel Patel
da28dc8507 Added support for importing and exporting the table data. 2016-05-21 15:43:43 +05:30
Ashesh Vashi
76087f3df3 Fixed issue while using decode() without checking type of the variable. Type maybe string or byte. 2016-05-16 13:22:10 +05:30
Ashesh Vashi
ca62825c90 Set PGPASSWORD environment variable from the process executor before running
the external utility.
2016-05-15 22:29:17 +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
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
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