[pgAdmin4][runtime]: Fix RM #2558

2017-07-13 Thread Neel Patel
Hi,

Please find attached patch file for the fix of below issue in runtime.

  RM #2558 -  Tab bar on main window vanishes when closing child via
tab button

I have tested with all 3 platforms. Do review it and let me know for
comments.

Thanks,
Neel Patel


RM_2558.patch
Description: Binary data


Re: pgAdmin 4 commit: Fix IE11 alert layout again.

2017-07-13 Thread Murtuza Zabuawala
Hello Surinder,

Looks recent commits to alert css broke the fading out animation layout.

Steps to re-produce (tested on Chrome & FF):
1) Open query tool
2) Execute 'select 1;'
3) Alert will displays properly but now take a closer look when alert fades
out from screen, icon goes on top of alert message and layout becomes kind
of square shape.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Mon, Jul 10, 2017 at 6:19 PM, Dave Page  wrote:

> Fix IE11 alert layout again.
>
> Branch
> --
> master
>
> Details
> ---
> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=
> 33e56272ca2430a2a85184951568ad324796bf94
> Author: Surinder Kumar 
>
> Modified Files
> --
> web/pgadmin/static/scss/_alertify.overrides.scss | 4 
> 1 file changed, 4 insertions(+)
>
>


[pgAdmin4][Patch] Not to display PID comma separated in statistics panel

2017-07-13 Thread Murtuza Zabuawala
Hi,

PFA minor patch to fix the issue where PID column was displaying comma
separated in statistics panel.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/statistics/static/js/statistics.js 
b/web/pgadmin/misc/statistics/static/js/statistics.js
index 1377c1e..ab8fbb8 100644
--- a/web/pgadmin/misc/statistics/static/js/statistics.js
+++ b/web/pgadmin/misc/statistics/static/js/statistics.js
@@ -324,14 +324,23 @@ define([
   this.columns = [];
   for (var idx in columns) {
 var rawColumn = columns[idx],
-col = {
+cell_type = typeCellMapper[rawColumn['type_code']] || 'string';
+
+// Don't show PID comma separated
+if(rawColumn['name'] == 'PID') {
+  cell_type = cell_type.extend({
+orderSeparator: ''
+  });
+}
+
+var col = {
 editable: false,
 name: rawColumn['name'],
-cell: typeCellMapper[rawColumn['type_code']] || 'string'
-   };
-   if (_.indexOf(prettifyFields, rawColumn['name']) != -1) {
-col['formatter'] = SizeFormatter
-   }
+cell: cell_type
+};
+if (_.indexOf(prettifyFields, rawColumn['name']) != -1) {
+  col['formatter'] = SizeFormatter
+}
 this.columns.push(col);
 
   }


[pgAdmin4][Patch]: Allow user to cancel long running queries from dashboard

2017-07-13 Thread Murtuza Zabuawala
hiHi,

PFA patch to add functionality which will allow super user to cancel long
running queries from dashboard.
RM#1812

*Steps used to test:*
1) Open psql session, Connect to 'test' database on respective server
2) Execute "select pg_sleep(1000);"
3) Open pgAdmin4
4) Connect to respective server
5) Click on Dashboard
6) Check "Sessions" tab under "Server activity" section then look for
active sessions for test database.
7) Click on cancel button and cancel the active session
8) Check psql session now, you will see "ERROR:  canceling statement due to
user request"



--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/dashboard/__init__.py 
b/web/pgadmin/dashboard/__init__.py
index 8f813d7..897bfc0 100644
--- a/web/pgadmin/dashboard/__init__.py
+++ b/web/pgadmin/dashboard/__init__.py
@@ -409,3 +409,36 @@ def config(sid=None):
 :return:
 """
 return get_data(sid, None, 'config.sql')
+
+
+@blueprint.route(
+'/cancel_session//', methods=['DELETE']
+)
+@blueprint.route(
+'/cancel_session///', methods=['DELETE']
+)
+@login_required
+@check_precondition
+def cancel_session(sid=None, did=None, pid=None):
+"""
+This function cancel the specific session
+:param sid: server id
+:param did: database id
+:param pid: session/process id
+:return: Response
+"""
+user = g.manager.user_info
+if user and user.get('is_superuser'):
+sql = "SELECT pg_cancel_backend({0});".format(pid)
+status, res = g.conn.execute_scalar(sql)
+if not status:
+return internal_server_error(errormsg=res)
+
+return ajax_response(
+response=gettext("Success") if res else gettext("Failed"),
+status=200
+)
+else:
+return internal_server_error(
+errormsg=gettext("User must be a superuser to perform this task.")
+)
diff --git a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js 
b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
index 34a1ab7..35f5a2b 100644
--- a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
+++ b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
@@ -1,8 +1,9 @@
 define([
-'require', 'jquery', 'pgadmin', 'underscore', 'backbone', 
'sources/gettext', 'flotr2', 'wcdocker',
+'require', 'jquery', 'pgadmin', 'underscore', 'backbone', 
'sources/gettext',
+'alertify', 'sources/alerts/alertify_wrapper', 'flotr2', 'wcdocker',
 'pgadmin.browser', 'bootstrap'
 ],
-function(r, $, pgAdmin, _, Backbone, gettext) {
+function(r, $, pgAdmin, _, Backbone, gettext, alertify, AlertifyWrapper) {
 
   var wcDocker = window.wcDocker,
   pgBrowser = pgAdmin.Browser;
@@ -11,7 +12,65 @@ function(r, $, pgAdmin, _, Backbone, gettext) {
   if (pgAdmin.Dashboard)
 return;
 
-  var dashboardVisible = true;
+  var dashboardVisible = true,
+cancel_session_url = '',
+is_super_user = false;
+
+  // Custom BackGrid cell, Responsible for cancelling active sessions
+  var cancelSessionCell = Backgrid.Extension.DeleteCell.extend({
+render: function () {
+  this.$el.empty();
+  this.$el.html(
+""
+  );
+  this.delegateEvents();
+  return this;
+},
+deleteRow: function(e) {
+  var self = this;
+  e.preventDefault();
+  var _title = gettext('Cancel Active Session?'),
+_txtConfirm = gettext('Are you sure you wish to cancel this active 
session?');
+
+  if (self.model.get('state') == 'idle') {
+_title = gettext('Cancel Idle Session?');
+_txtConfirm = gettext('Are you sure you wish to cancel this idle 
session?');
+  }
+
+  alertify.confirm(
+_title,
+_txtConfirm,
+function(evt) {
+  $.ajax({
+url: cancel_session_url + self.model.get('pid'),
+type:'DELETE',
+success: function(res) {
+  var alertifyWrapper = new AlertifyWrapper();
+  if (res == gettext('Success')) {
+alertifyWrapper.success(gettext('Session cancelled 
successfully.'));
+  } else {
+alertifyWrapper.error(gettext('Error during canceling 
session.'));
+  }
+},
+error: function(xhr, status, error) {
+  try {
+var err = $.parseJSON(xhr.responseText);
+if (err.success == 0) {
+  var alertifyWrapper = new AlertifyWrapper();
+  alertifyWrapper.error(err.errormsg);
+}
+  } catch (e) {}
+}
+  });
+},
+function(evt) {
+  return true;
+}
+  );
+}
+  });
 
   pgAdmin.Dashboard = {
 init: function() {
@@ -63,6

pgAdmin 4 commit: Tag REL-1_6 has been created.

2017-07-13 Thread Dave Page
Tag REL-1_6 has been created.
View: https://git.postgresql.org/gitweb?p=pgadmin4.git;a=tag;h=refs/tags/REL-1_6

Log Message
---
Tag 1.6

pgAdmin 4 v1.6 Released!

2017-07-13 Thread Dave Page
The pgAdmin Development Team are pleased to announce the release of pgAdmin
4 version 1.6. This release of pgAdmin 4 includes over 70 bug fixes and a
dozen new features. For details, please see the release notes (
https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).

Notable changes in this release include:

* Significant performance improvements on Windows, massively reducing
initial load time and improving UI response for the vast majority of users
during testing.

* Enhancements to the Query Tool enabling the viewing of large query
resultsets far more quickly. For example, a simple test query with 96K rows
rendered results within 1 second vs. 22 seconds in pgAdmin III during
testing!

* A major rewrite of the Query History tab allows browsing of queries
executed in the query tool with full details including the entire query, in
a much nicer user interface.

* The Desktop Runtime now supports detachable tabs, allowing the Query Tool
and Debugger to be opened in new tabs and then moved to alternate displays
(from 1.5 this was possible in web mode only)

* The Query Tool's Results Grid has been overhauled with a new, sleek look
an feel supporting selection of arbitrary rows, columns or blocks of cells
with full copy support and column sizing retention.

* The Dashboard tab can now be closed if desired, to minimise query traffic
resulting from graph updates.

For more information, checkout the online documentation, and of course the
download page:

Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html

Download: https://www.pgadmin.org/download


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake


Testing out font changes in query editor tool

2017-07-13 Thread Shirley Wang
Hello!

We're trying out a new font in the query editor tool. Attached is a patch
that changes the font.

We'd like to know how this change affects your experience working in the
query tool.

Thanks!
George and Shirley


01-typography-prototype.diff
Description: Binary data


Re: pgAdmin 4 v1.6 Released!

2017-07-13 Thread Anthony DeBarros
Congrats to the team. This one seems like a milestone!

To the Pivotal team: Great work on the design!


On July 13, 2017 at 11:18:05 AM, Dave Page (dp...@pgadmin.org) wrote:

The pgAdmin Development Team are pleased to announce the release of pgAdmin
4 version 1.6. This release of pgAdmin 4 includes over 70 bug fixes and a
dozen new features. For details, please see the release notes (
https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).

Notable changes in this release include:

* Significant performance improvements on Windows, massively reducing
initial load time and improving UI response for the vast majority of users
during testing.

* Enhancements to the Query Tool enabling the viewing of large query
resultsets far more quickly. For example, a simple test query with 96K rows
rendered results within 1 second vs. 22 seconds in pgAdmin III during
testing!

* A major rewrite of the Query History tab allows browsing of queries
executed in the query tool with full details including the entire query, in
a much nicer user interface.

* The Desktop Runtime now supports detachable tabs, allowing the Query Tool
and Debugger to be opened in new tabs and then moved to alternate displays
(from 1.5 this was possible in web mode only)

* The Query Tool's Results Grid has been overhauled with a new, sleek look
an feel supporting selection of arbitrary rows, columns or blocks of cells
with full copy support and column sizing retention.

* The Dashboard tab can now be closed if desired, to minimise query traffic
resulting from graph updates.

For more information, checkout the online documentation, and of course the
download page:

Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html

Download: https://www.pgadmin.org/download


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake


pgadmin-for-web is going nowhere

2017-07-13 Thread Josh Berkus
Folks,

Installing pgadmin-for-web is painful, poorly documented, and broken.
As a result, it's not considered a real UI by anyone not on this team.

Six months ago, I jumped on this with the goal of solving it, partly
through use of linux containers.  However, I'm full stop because of the
emphasis on (a) having only one package which is both desktop and web,
and (b) treating the web version as the ugly stepchild.

See: https://redmine.postgresql.org/issues/2495#change-7635

If you read the conversation on pgsql-advocacy, for example, you'll see
that even people in our own community regard pgAdmin4 as not production
quality software.

As such, I'm done.  When y'all decide to get real with caring about
users' ability to install pgadmin for web, ping me.

--Josh Berkus



RE: pgAdmin 4 v1.6 Released!

2017-07-13 Thread Lazaro Garcia
The download links are wrong, the links downloads 1.5 and not 1.6.

 

Regards.

 

De: Dave Page [mailto:dp...@pgadmin.org] 
Enviado el: jueves, 13 de julio de 2017 11:18 a. m.
Para: pgAdmin Support; pgadmin-hackers
Asunto: pgAdmin 4 v1.6 Released!

 

The pgAdmin Development Team are pleased to announce the release of pgAdmin 4 
version 1.6. This release of pgAdmin 4 includes over 70 bug fixes and a dozen 
new features. For details, please see the release notes 
(https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).

 

Notable changes in this release include:

 

* Significant performance improvements on Windows, massively reducing initial 
load time and improving UI response for the vast majority of users during 
testing.

 

* Enhancements to the Query Tool enabling the viewing of large query resultsets 
far more quickly. For example, a simple test query with 96K rows rendered 
results within 1 second vs. 22 seconds in pgAdmin III during testing!

 

* A major rewrite of the Query History tab allows browsing of queries executed 
in the query tool with full details including the entire query, in a much nicer 
user interface.

 

* The Desktop Runtime now supports detachable tabs, allowing the Query Tool and 
Debugger to be opened in new tabs and then moved to alternate displays (from 
1.5 this was possible in web mode only)

 

* The Query Tool's Results Grid has been overhauled with a new, sleek look an 
feel supporting selection of arbitrary rows, columns or blocks of cells with 
full copy support and column sizing retention.

 

* The Dashboard tab can now be closed if desired, to minimise query traffic 
resulting from graph updates.

 

For more information, checkout the online documentation, and of course the 
download page: 

 

Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html

 

Download: https://www.pgadmin.org/download

 

 

-- 

Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake



Re: pgAdmin 4 v1.6 Released!

2017-07-13 Thread Shira Bezalel
I downloaded the Windows pgAdmin 1.6 version, and after launching it, it
simply shows a black display. My colleague also on Windows 10 had the same
experience.

Does this sound like a known problem?

Shira

On Thu, Jul 13, 2017 at 11:18 AM, Lazaro Garcia 
wrote:

> The download links are wrong, the links downloads 1.5 and not 1.6.
>
>
>
> Regards.
>
>
>
> *De:* Dave Page [mailto:dp...@pgadmin.org]
> *Enviado el:* jueves, 13 de julio de 2017 11:18 a. m.
> *Para:* pgAdmin Support; pgadmin-hackers
> *Asunto:* pgAdmin 4 v1.6 Released!
>
>
>
> The pgAdmin Development Team are pleased to announce the release of
> pgAdmin 4 version 1.6. This release of pgAdmin 4 includes over 70 bug fixes
> and a dozen new features. For details, please see the release notes (
> https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).
>
>
>
> Notable changes in this release include:
>
>
>
> * Significant performance improvements on Windows, massively reducing
> initial load time and improving UI response for the vast majority of users
> during testing.
>
>
>
> * Enhancements to the Query Tool enabling the viewing of large query
> resultsets far more quickly. For example, a simple test query with 96K rows
> rendered results within 1 second vs. 22 seconds in pgAdmin III during
> testing!
>
>
>
> * A major rewrite of the Query History tab allows browsing of queries
> executed in the query tool with full details including the entire query, in
> a much nicer user interface.
>
>
>
> * The Desktop Runtime now supports detachable tabs, allowing the Query
> Tool and Debugger to be opened in new tabs and then moved to alternate
> displays (from 1.5 this was possible in web mode only)
>
>
>
> * The Query Tool's Results Grid has been overhauled with a new, sleek look
> an feel supporting selection of arbitrary rows, columns or blocks of cells
> with full copy support and column sizing retention.
>
>
>
> * The Dashboard tab can now be closed if desired, to minimise query
> traffic resulting from graph updates.
>
>
>
> For more information, checkout the online documentation, and of course the
> download page:
>
>
>
> Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html
>
>
>
> Download: https://www.pgadmin.org/download
>
>
>
>
>
> --
>
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>

​


Re: pgAdmin 4 v1.6 Released!

2017-07-13 Thread Neel Patel
Hi,


Thanks,
Neel Patel

On Jul 14, 2017 5:31 AM, "Shira Bezalel"  wrote:

I downloaded the Windows pgAdmin 1.6 version, and after launching it, it
simply shows a black display. My colleague also on Windows 10 had the same
experience.

Does this sound like a known problem?


It is not an issue with 1.6. This is due to previous "ActiveQt" testing
build using different zoom level.
To resolve the issue press Ctrl 0.


Shira

On Thu, Jul 13, 2017 at 11:18 AM, Lazaro Garcia 
wrote:

> The download links are wrong, the links downloads 1.5 and not 1.6.
>
>
>
> Regards.
>
>
>
> *De:* Dave Page [mailto:dp...@pgadmin.org]
> *Enviado el:* jueves, 13 de julio de 2017 11:18 a. m.
> *Para:* pgAdmin Support; pgadmin-hackers
> *Asunto:* pgAdmin 4 v1.6 Released!
>
>
>
> The pgAdmin Development Team are pleased to announce the release of
> pgAdmin 4 version 1.6. This release of pgAdmin 4 includes over 70 bug fixes
> and a dozen new features. For details, please see the release notes (
> https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).
>
>
>
> Notable changes in this release include:
>
>
>
> * Significant performance improvements on Windows, massively reducing
> initial load time and improving UI response for the vast majority of users
> during testing.
>
>
>
> * Enhancements to the Query Tool enabling the viewing of large query
> resultsets far more quickly. For example, a simple test query with 96K rows
> rendered results within 1 second vs. 22 seconds in pgAdmin III during
> testing!
>
>
>
> * A major rewrite of the Query History tab allows browsing of queries
> executed in the query tool with full details including the entire query, in
> a much nicer user interface.
>
>
>
> * The Desktop Runtime now supports detachable tabs, allowing the Query
> Tool and Debugger to be opened in new tabs and then moved to alternate
> displays (from 1.5 this was possible in web mode only)
>
>
>
> * The Query Tool's Results Grid has been overhauled with a new, sleek look
> an feel supporting selection of arbitrary rows, columns or blocks of cells
> with full copy support and column sizing retention.
>
>
>
> * The Dashboard tab can now be closed if desired, to minimise query
> traffic resulting from graph updates.
>
>
>
> For more information, checkout the online documentation, and of course the
> download page:
>
>
>
> Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html
>
>
>
> Download: https://www.pgadmin.org/download
>
>
>
>
>
> --
>
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>

​


Re: Testing out font changes in query editor tool

2017-07-13 Thread Murtuza Zabuawala
Hi Shirley,

It's easy on the eyes :)

~M

On Thu, Jul 13, 2017 at 10:00 PM, Shirley Wang  wrote:

> Hello!
>
> We're trying out a new font in the query editor tool. Attached is a patch
> that changes the font.
>
> We'd like to know how this change affects your experience working in the
> query tool.
>
> Thanks!
> George and Shirley
>


Re: pgAdmin 4 v1.6 Released!

2017-07-13 Thread Pawel Hadam
Hi,

I have also installed "pgadmin4-1.6-x86.exe" on Windows 10 PRO (AMD
FX, 6 cores, 16 GB RAM, SSD) and tried to run it. After 1min 58 sec I
got a message saying "The application server could not be contacted".

pgAdmin 4 v 1.5 was starting successfully in 55-60 sec. before I did
this installation. Nothing else has changed, just reinstalled pgAdmin.

Anybody had the same error and any ideas what's wrong?

Thanks and regards
Pawel


On 14 July 2017 at 01:00, Shira Bezalel  wrote:
> I downloaded the Windows pgAdmin 1.6 version, and after launching it, it
> simply shows a black display. My colleague also on Windows 10 had the same
> experience.
>
> Does this sound like a known problem?
>
> Shira
>
> On Thu, Jul 13, 2017 at 11:18 AM, Lazaro Garcia 
> wrote:
>>
>> The download links are wrong, the links downloads 1.5 and not 1.6.
>>
>>
>>
>> Regards.
>>
>>
>>
>> De: Dave Page [mailto:dp...@pgadmin.org]
>> Enviado el: jueves, 13 de julio de 2017 11:18 a. m.
>> Para: pgAdmin Support; pgadmin-hackers
>> Asunto: pgAdmin 4 v1.6 Released!
>>
>>
>>
>> The pgAdmin Development Team are pleased to announce the release of
>> pgAdmin 4 version 1.6. This release of pgAdmin 4 includes over 70 bug fixes
>> and a dozen new features. For details, please see the release notes
>> (https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_1_6.html).
>>
>>
>>
>> Notable changes in this release include:
>>
>>
>>
>> * Significant performance improvements on Windows, massively reducing
>> initial load time and improving UI response for the vast majority of users
>> during testing.
>>
>>
>>
>> * Enhancements to the Query Tool enabling the viewing of large query
>> resultsets far more quickly. For example, a simple test query with 96K rows
>> rendered results within 1 second vs. 22 seconds in pgAdmin III during
>> testing!
>>
>>
>>
>> * A major rewrite of the Query History tab allows browsing of queries
>> executed in the query tool with full details including the entire query, in
>> a much nicer user interface.
>>
>>
>>
>> * The Desktop Runtime now supports detachable tabs, allowing the Query
>> Tool and Debugger to be opened in new tabs and then moved to alternate
>> displays (from 1.5 this was possible in web mode only)
>>
>>
>>
>> * The Query Tool's Results Grid has been overhauled with a new, sleek look
>> an feel supporting selection of arbitrary rows, columns or blocks of cells
>> with full copy support and column sizing retention.
>>
>>
>>
>> * The Dashboard tab can now be closed if desired, to minimise query
>> traffic resulting from graph updates.
>>
>>
>>
>> For more information, checkout the online documentation, and of course the
>> download page:
>>
>>
>>
>> Docs: https://www.pgadmin.org/docs/pgadmin4/dev/index.html
>>
>>
>>
>> Download: https://www.pgadmin.org/download
>>
>>
>>
>>
>>
>> --
>>
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>
>
>
>