Re: [pgAdmin4][Patch]: Improvise the treeview element selection

2017-07-24 Thread Shirley Wang
Hi Surinder,

This change seems to be different from the other patterns for selected /
highlighted options. Is there a reason why this needs to be more visible
than it already is? In terms of feedback on the tree, we have not heard any
pains from users that this is not visible enough.

Shirley

On Mon, Jul 24, 2017 at 12:47 PM Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi All,
>
> Changes:
>
> 1. Highlight the full selected tree item instead of highlighting only
> label.
> 2. Set selected item background color to dark blue that is more visible to
> eyes.[same as in pgAdmin3]
>
> Please find attached patch and review.
>
> Thanks,
> Surinder
>


Re: [pgAdmin4][Patch]: Improvise the treeview element selection

2017-07-24 Thread Dave Page
On Mon, Jul 24, 2017 at 8:51 AM, Shirley Wang  wrote:

> Hi Surinder,
>
> This change seems to be different from the other patterns for selected /
> highlighted options. Is there a reason why this needs to be more visible
> than it already is? In terms of feedback on the tree, we have not heard any
> pains from users that this is not visible enough.
>

Yeah, I'm inclined to agree. What's your motivation for this change? I've
also never heard of any complaints about this.


>
> Shirley
>
> On Mon, Jul 24, 2017 at 12:47 PM Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi All,
>>
>> Changes:
>>
>> 1. Highlight the full selected tree item instead of highlighting only
>> label.
>> 2. Set selected item background color to dark blue that is more visible
>> to eyes.[same as in pgAdmin3]
>>
>> Please find attached patch and review.
>>
>> Thanks,
>> Surinder
>>
>


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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


[RM2579][pgAdmin4] Set default file listing layout as list instead of grid

2017-07-24 Thread Harshal Dhumal
Hi,

Please find attached patch to set default layout of file listing as a list
in file manager.
Also replaced alertify with out custom alertifywrapper in file manager
utils.js


-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/index.html b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
index 1933895..80c85fb 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/index.html
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
@@ -26,8 +26,8 @@
 
 
-
-
+
+
 
 
 
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
index f74430d..fcc242d 100644
--- a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
@@ -2,7 +2,7 @@
  "options": {
   "culture": "en",
   "lang": "py",
-  "defaultViewMode": "grid",
+  "defaultViewMode": "list",
   "autoload": true,
   "showFullPath": false,
   "dialog_type": "{{data.dialog_type}}",
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
index fd8f25c..56be16a 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
@@ -1601,7 +1601,8 @@ pgAdmin.FileUtils = {
 
   // create a new folder
   var getFolderName = function(value) {
-var fname = value;
+var fname = value,
+alertifyWrapper = new AlertifyWrapper();
 
 if (fname != '') {
   foldername = fname;
@@ -1609,14 +1610,17 @@ pgAdmin.FileUtils = {
   $.getJSON(pgAdmin.FileUtils.fileConnector + '?mode=addfolder&path=' + $('.currentpath').val() + '&name=' + foldername, function(resp) {
 var result = resp.data.result;
 if (result.Code === 1) {
-  alertify.success(lg.successful_added_folder);
+  alertifyWrapper.success(lg.successful_added_folder);
   getFolderInfo(result.Parent);
 } else {
-  alertify.error(result.Error);
+  alertifyWrapper.error(result.Error);
 }
+  }).
+  fail(function (resp) {
+alertifyWrapper.error(gettext('Error occurred while saving folder.'));
   });
 } else {
-  alertify.error(lg.no_foldername);
+  alertifyWrapper.error(lg.no_foldername);
 }
   };
 


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

2017-07-24 Thread Murtuza Zabuawala
Hi Dave,

Please find updated patch.

On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala  wrote:

> Hi Shirley,
>
> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:
>
>> Hi!
>>
>> I can't seem to get the patch to completely work on my computer, only the
>> close icon shows up plus the dialog and success/error messages, but here
>> are some comments:
>>
>> Because  we are just cancelling the active running query, so if the start
> of the session is 'Active' when you cancel it will simply goto 'Idle' stat.
>
>> +1 to Dave's comment about refreshing after the cancel operation
>>
>> I'll fix this.
>
>> - We're working on a patch for updating alerts in the Dashboard tab which
>> updates the grays in the Database activities panel and changes the border
>> around the refresh button and search bar to 1px. This hasn't been submitted
>> yet but just a heads up as you work on the alignment.
>>
>> - Something to consider is how a super user will identify which session
>> should be closed. Is that information there?
>>
>> I think super user can cancel everything except main connection session &
> as Dave mentioned in previous email that background workers in PG10.
>
>> - Are there sessions that should never be closed? If so, do they also
>> need close buttons? (Probably not, because that will lead the user to an
>> error message, which is not fun)
>>
>> In Backgrid, we can not exclude specific column from certain rows if it
> renders in one row then it will render for every row in the grid, What we
> can do is, it will throw an error when user is not eligible to cancel the
> active running query.
>
>> - Perhaps this is a good feature to review with Chethana! :)
>>
>> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:
>>>
 Hi

 On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> 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"
>
> Some comments:

 - The action here is to cancel the active query in the backend, not the
 session - so messages etc. should say things like "Cancel Active Query?"


>>> - The grid should refresh following the cancel operation.

 - Can you fix the vertical alignment while you're working on this? The
 new button really makes the poor alignment stand out.

 - This should not be superuser only - regular users should be able to
 cancel their own queries.

 - On PG10, background workers are also shown in the dashboard. Should
 we prevent attempts to cancel their work (they'll fail anyway I believe).

 Thanks!


>>> Sure, I'll work on these comments & send updated patch.
>>>
 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

>>>
>
diff --git a/web/pgadmin/dashboard/__init__.py 
b/web/pgadmin/dashboard/__init__.py
index b91ccb2..a4c18c9 100644
--- a/web/pgadmin/dashboard/__init__.py
+++ b/web/pgadmin/dashboard/__init__.py
@@ -456,3 +456,30 @@ 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
+"""
+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
+)
diff --git a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js 
b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
index 8bd62d6..205639d 100644
--- a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
+++ b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
@@ -1,9 +1,11 @@
 define('pgadmin.dashboard', [
 'sources/url_for', 'sources/gettext', 'require', 

pgAdmin 4 commit: Ensure the appropriate entry is focussed when enterin

2017-07-24 Thread Dave Page
Ensure the appropriate entry is focussed when entering the history tab.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=fe95b7670b539b1957a41ee77b9c304fef31825f
Author: Joao Pedro De Almeida Pereira 

Modified Files
--
web/pgadmin/static/jsx/history/query_history.jsx   | 19 -
.../javascript/history/query_history_spec.jsx  | 47 ++
2 files changed, 50 insertions(+), 16 deletions(-)



Re: [pgadmin-hackers][patch]

2017-07-24 Thread Dave Page
Thanks, applied.

On Fri, Jul 21, 2017 at 10:38 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi hackers,
> With the last commits, the behavior of focusing on a selected entry when
> entering the History Tab was not working as expected.
> This patch will bring this behavior back.
>
> Thanks
> Joao & Matt
>



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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [RM2579][pgAdmin4] Set default file listing layout as list instead of grid

2017-07-24 Thread Dave Page
Hi

On Mon, Jul 24, 2017 at 11:34 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to set default layout of file listing as a list
> in file manager.
> Also replaced alertify with out custom alertifywrapper in file manager
> utils.js
>

This isn't a bad idea on the face of it, but there are some things to
fix/consider:

- The HTML file seems to be missing translation markers. Can you add them
throughout please?
- We should save the users preference in the config database.
- The grid view seems to underline the file size and for no apparent reason
change the mouse cursor to ? on mouseover. Let's change the text style to
be consistent and get rid of the mouseover.

Thanks!

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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Jenkins build is back to normal : pgadmin4-master-python36 #257

2017-07-24 Thread pgAdmin 4 Jenkins
See 





pgAdmin 4 commit: Allow queries to be cancelled from the dashboards. Fi

2017-07-24 Thread Dave Page
Allow queries to be cancelled from the dashboards. Fixes #1812

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=617e9dbb3a466507a7cfdd6ba144c0dca5955dec
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/dashboard/__init__.py  |  27 
.../dashboard/templates/dashboard/js/dashboard.js  | 165 -
web/pgadmin/static/css/bootstrap.overrides.css |  10 +-
web/pgadmin/static/js/alerts/alertify_wrapper.js   |  17 ++-
web/pgadmin/static/scss/_alert.scss|  33 +
web/pgadmin/static/scss/_alertify.overrides.scss   |   8 +-
6 files changed, 220 insertions(+), 40 deletions(-)



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

2017-07-24 Thread Dave Page
Thanks, applied.

How much effort do you think it would take to turn the table into a subnode
control so we can show the SQL query and other missing fields from
pg_stat_activity on that tab?

On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patch.
>
> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Shirley,
>>
>> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:
>>
>>> Hi!
>>>
>>> I can't seem to get the patch to completely work on my computer, only
>>> the close icon shows up plus the dialog and success/error messages, but
>>> here are some comments:
>>>
>>> Because  we are just cancelling the active running query, so if the
>> start of the session is 'Active' when you cancel it will simply goto 'Idle'
>> stat.
>>
>>> +1 to Dave's comment about refreshing after the cancel operation
>>>
>>> I'll fix this.
>>
>>> - We're working on a patch for updating alerts in the Dashboard tab
>>> which updates the grays in the Database activities panel and changes the
>>> border around the refresh button and search bar to 1px. This hasn't been
>>> submitted yet but just a heads up as you work on the alignment.
>>>
>>> - Something to consider is how a super user will identify which session
>>> should be closed. Is that information there?
>>>
>>> I think super user can cancel everything except main connection session
>> & as Dave mentioned in previous email that background workers in PG10.
>>
>>> - Are there sessions that should never be closed? If so, do they also
>>> need close buttons? (Probably not, because that will lead the user to an
>>> error message, which is not fun)
>>>
>>> In Backgrid, we can not exclude specific column from certain rows if it
>> renders in one row then it will render for every row in the grid, What we
>> can do is, it will throw an error when user is not eligible to cancel the
>> active running query.
>>
>>> - Perhaps this is a good feature to review with Chethana! :)
>>>
>>> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:

> Hi
>
> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> 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"
>>
>> Some comments:
>
> - The action here is to cancel the active query in the backend, not
> the session - so messages etc. should say things like "Cancel Active 
> Query?"
>
>
 - The grid should refresh following the cancel operation.
>
> - Can you fix the vertical alignment while you're working on this? The
> new button really makes the poor alignment stand out.
>
> - This should not be superuser only - regular users should be able to
> cancel their own queries.
>
> - On PG10, background workers are also shown in the dashboard. Should
> we prevent attempts to cancel their work (they'll fail anyway I believe).
>
> Thanks!
>
>
 Sure, I'll work on these comments & send updated patch.

> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

>>
>


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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

2017-07-24 Thread Murtuza Zabuawala
Hi Dave,

On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:

> Thanks, applied.
>
> How much effort do you think it would take to turn the table into a
> subnode control so we can show the SQL query and other missing fields from
> pg_stat_activity on that tab?
>
I think around 2-3 days would be needed.

>
>
On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please find updated patch.
>>
>> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Shirley,
>>>
>>> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:
>>>
 Hi!

 I can't seem to get the patch to completely work on my computer, only
 the close icon shows up plus the dialog and success/error messages, but
 here are some comments:

 Because  we are just cancelling the active running query, so if the
>>> start of the session is 'Active' when you cancel it will simply goto 'Idle'
>>> stat.
>>>
 +1 to Dave's comment about refreshing after the cancel operation

 I'll fix this.
>>>
 - We're working on a patch for updating alerts in the Dashboard tab
 which updates the grays in the Database activities panel and changes the
 border around the refresh button and search bar to 1px. This hasn't been
 submitted yet but just a heads up as you work on the alignment.

 - Something to consider is how a super user will identify which session
 should be closed. Is that information there?

 I think super user can cancel everything except main connection session
>>> & as Dave mentioned in previous email that background workers in PG10.
>>>
 - Are there sessions that should never be closed? If so, do they also
 need close buttons? (Probably not, because that will lead the user to an
 error message, which is not fun)

 In Backgrid, we can not exclude specific column from certain rows if it
>>> renders in one row then it will render for every row in the grid, What we
>>> can do is, it will throw an error when user is not eligible to cancel the
>>> active running query.
>>>
 - Perhaps this is a good feature to review with Chethana! :)

 On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> 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"
>>>
>>> Some comments:
>>
>> - The action here is to cancel the active query in the backend, not
>> the session - so messages etc. should say things like "Cancel Active 
>> Query?"
>>
>>
> - The grid should refresh following the cancel operation.
>>
>> - Can you fix the vertical alignment while you're working on this?
>> The new button really makes the poor alignment stand out.
>>
>> - This should not be superuser only - regular users should be able to
>> cancel their own queries.
>>
>> - On PG10, background workers are also shown in the dashboard. Should
>> we prevent attempts to cancel their work (they'll fail anyway I believe).
>>
>> Thanks!
>>
>>
> Sure, I'll work on these comments & send updated patch.
>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


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

2017-07-24 Thread Dave Page
On Mon, Jul 24, 2017 at 1:12 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:
>
>> Thanks, applied.
>>
>> How much effort do you think it would take to turn the table into a
>> subnode control so we can show the SQL query and other missing fields from
>> pg_stat_activity on that tab?
>>
> I think around 2-3 days would be needed.
>

OK - can you add a Redmine and work on that please? It's been a known
deficiency for quite a while, and whilst working on this patch I realised
just how badly we really need to see the SQL there.

Thanks.


>
>>
> On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Please find updated patch.
>>>
>>> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Shirley,

 On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:

> Hi!
>
> I can't seem to get the patch to completely work on my computer, only
> the close icon shows up plus the dialog and success/error messages, but
> here are some comments:
>
> Because  we are just cancelling the active running query, so if the
 start of the session is 'Active' when you cancel it will simply goto 'Idle'
 stat.

> +1 to Dave's comment about refreshing after the cancel operation
>
> I'll fix this.

> - We're working on a patch for updating alerts in the Dashboard tab
> which updates the grays in the Database activities panel and changes the
> border around the refresh button and search bar to 1px. This hasn't been
> submitted yet but just a heads up as you work on the alignment.
>
> - Something to consider is how a super user will identify which
> session should be closed. Is that information there?
>
> I think super user can cancel everything except main connection
 session & as Dave mentioned in previous email that background workers in
 PG10.

> - Are there sessions that should never be closed? If so, do they also
> need close buttons? (Probably not, because that will lead the user to an
> error message, which is not fun)
>
> In Backgrid, we can not exclude specific column from certain rows if
 it renders in one row then it will render for every row in the grid, What
 we can do is, it will throw an error when user is not eligible to cancel
 the active running query.

> - Perhaps this is a good feature to review with Chethana! :)
>
> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 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"

 Some comments:
>>>
>>> - The action here is to cancel the active query in the backend, not
>>> the session - so messages etc. should say things like "Cancel Active 
>>> Query?"
>>>
>>>
>> - The grid should refresh following the cancel operation.
>>>
>>> - Can you fix the vertical alignment while you're working on this?
>>> The new button really makes the poor alignment stand out.
>>>
>>> - This should not be superuser only - regular users should be able
>>> to cancel their own queries.
>>>
>>> - On PG10, background workers are also shown in the dashboard.
>>> Should we prevent attempts to cancel their work (they'll fail anyway I
>>> believe).
>>>
>>> Thanks!
>>>
>>>
>> Sure, I'll work on these comments & send updated patch.
>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>

>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

EnterpriseDB UK: http:

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

2017-07-24 Thread Murtuza Zabuawala
Sure.

RM created: https://redmine.postgresql.org/issues/2597.

On Mon, Jul 24, 2017 at 6:04 PM, Dave Page  wrote:

>
>
> On Mon, Jul 24, 2017 at 1:12 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:
>>
>>> Thanks, applied.
>>>
>>> How much effort do you think it would take to turn the table into a
>>> subnode control so we can show the SQL query and other missing fields from
>>> pg_stat_activity on that tab?
>>>
>> I think around 2-3 days would be needed.
>>
>
> OK - can you add a Redmine and work on that please? It's been a known
> deficiency for quite a while, and whilst working on this patch I realised
> just how badly we really need to see the SQL there.
>
> Thanks.
>
>
>>
>>>
>> On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 Please find updated patch.

 On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Shirley,
>
> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang 
> wrote:
>
>> Hi!
>>
>> I can't seem to get the patch to completely work on my computer, only
>> the close icon shows up plus the dialog and success/error messages, but
>> here are some comments:
>>
>> Because  we are just cancelling the active running query, so if the
> start of the session is 'Active' when you cancel it will simply goto 
> 'Idle'
> stat.
>
>> +1 to Dave's comment about refreshing after the cancel operation
>>
>> I'll fix this.
>
>> - We're working on a patch for updating alerts in the Dashboard tab
>> which updates the grays in the Database activities panel and changes the
>> border around the refresh button and search bar to 1px. This hasn't been
>> submitted yet but just a heads up as you work on the alignment.
>>
>> - Something to consider is how a super user will identify which
>> session should be closed. Is that information there?
>>
>> I think super user can cancel everything except main connection
> session & as Dave mentioned in previous email that background workers in
> PG10.
>
>> - Are there sessions that should never be closed? If so, do they also
>> need close buttons? (Probably not, because that will lead the user to an
>> error message, which is not fun)
>>
>> In Backgrid, we can not exclude specific column from certain rows if
> it renders in one row then it will render for every row in the grid, What
> we can do is, it will throw an error when user is not eligible to cancel
> the active running query.
>
>> - Perhaps this is a good feature to review with Chethana! :)
>>
>> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page 
>>> wrote:
>>>
 Hi

 On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> 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"
>
> Some comments:

 - The action here is to cancel the active query in the backend, not
 the session - so messages etc. should say things like "Cancel Active 
 Query?"


>>> - The grid should refresh following the cancel operation.

 - Can you fix the vertical alignment while you're working on this?
 The new button really makes the poor alignment stand out.

 - This should not be superuser only - regular users should be able
 to cancel their own queries.

 - On PG10, background workers are also shown in the dashboard.
 Should we prevent attempts to cancel their work (they'll fail anyway I
 believe).

 Thanks!


>>> Sure, I'll work on these comments & send updated patch.
>>>
 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

>>>
>

>>>

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

2017-07-24 Thread Shirley Wang
2-3 days is a lot of valuable engineering time. Is this a 'drop everything now' 
kind of feature or can this wait for some user validation on a mock up first? 

> On Jul 24, 2017, at 20:41, Murtuza Zabuawala 
>  wrote:
> 
> Sure.
> 
> RM created: https://redmine.postgresql.org/issues/2597.
> 
>> On Mon, Jul 24, 2017 at 6:04 PM, Dave Page  wrote:
>> 
>> 
>>> On Mon, Jul 24, 2017 at 1:12 PM, Murtuza Zabuawala 
>>>  wrote:
>>> Hi Dave,
>>> 
 On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:
 Thanks, applied.
 
 How much effort do you think it would take to turn the table into a 
 subnode control so we can show the SQL query and other missing fields from 
 pg_stat_activity on that tab?
>>> 
>>> I think around 2-3 days would be needed. 
>> 
>> OK - can you add a Redmine and work on that please? It's been a known 
>> deficiency for quite a while, and whilst working on this patch I realised 
>> just how badly we really need to see the SQL there.
>> 
>> Thanks.
>>  
  
> On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala 
>  wrote:
> Hi Dave,
> 
> Please find updated patch.
> 
>> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala 
>>  wrote:
>> Hi Shirley,
>> 
>>> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:
>>> Hi!
>>> 
>>> I can't seem to get the patch to completely work on my computer, only 
>>> the close icon shows up plus the dialog and success/error messages, but 
>>> here are some comments:
>>> 
>> Because  we are just cancelling the active running query, so if the 
>> start of the session is 'Active' when you cancel it will simply goto 
>> 'Idle' stat. 
>>> +1 to Dave's comment about refreshing after the cancel operation
>>> 
>> I'll fix this. 
>>> - We're working on a patch for updating alerts in the Dashboard tab 
>>> which updates the grays in the Database activities panel and changes 
>>> the border around the refresh button and search bar to 1px. This hasn't 
>>> been submitted yet but just a heads up as you work on the alignment.
>>> 
>>> - Something to consider is how a super user will identify which session 
>>> should be closed. Is that information there?
>>> 
>> I think super user can cancel everything except main connection session 
>> & as Dave mentioned in previous email that background workers in PG10. 
>>> - Are there sessions that should never be closed? If so, do they also 
>>> need close buttons? (Probably not, because that will lead the user to 
>>> an error message, which is not fun)
>>> 
>> In Backgrid, we can not exclude specific column from certain rows if it 
>> renders in one row then it will render for every row in the grid, What 
>> we can do is, it will throw an error when user is not eligible to cancel 
>> the active running query. 
>>> - Perhaps this is a good feature to review with Chethana! :)
>>> 
 On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala 
  wrote:
> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:
> Hi
> 
>> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala 
>>  wrote:
>> 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"
>> 
> Some comments:
> 
> - The action here is to cancel the active query in the backend, not 
> the session - so messages etc. should say things like "Cancel Active 
> Query?"
>  
> - The grid should refresh following the cancel operation.
> 
> - Can you fix the vertical alignment while you're working on this? 
> The new button really makes the poor alignment stand out.
> 
> - This should not be superuser only - regular users should be able to 
> cancel their own queries.
> 
> - On PG10, background workers are also shown in the dashboard. Should 
> we prevent attempts to cancel their work (they'll fail anyway I 
> believe). 
> 
> Thanks!
>  
 
 Sure, I'll work on these comments & send updated patch. 
> -- 
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>>>

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

2017-07-24 Thread Dave Page
On Mon, Jul 24, 2017 at 3:28 PM, Shirley Wang  wrote:

> 2-3 days is a lot of valuable engineering time. Is this a 'drop everything
> now' kind of feature or can this wait for some user validation on a mock up
> first?
>

Most of the time will likely be on the infrastructure to change the display
to a subnode control. If you have some cycles to mockup potential layouts
for the subnode view and have them validated, please feel free, however,
that seems like an awful lot of work to me to display some missing SQL
using a standard control.


>
> On Jul 24, 2017, at 20:41, Murtuza Zabuawala  enterprisedb.com> wrote:
>
> Sure.
>
> RM created: https://redmine.postgresql.org/issues/2597.
>
> On Mon, Jul 24, 2017 at 6:04 PM, Dave Page  wrote:
>
>>
>>
>> On Mon, Jul 24, 2017 at 1:12 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:
>>>
 Thanks, applied.

 How much effort do you think it would take to turn the table into a
 subnode control so we can show the SQL query and other missing fields from
 pg_stat_activity on that tab?

>>> I think around 2-3 days would be needed.
>>>
>>
>> OK - can you add a Redmine and work on that please? It's been a known
>> deficiency for quite a while, and whilst working on this patch I realised
>> just how badly we really need to see the SQL there.
>>
>> Thanks.
>>
>>
>>>

>>> On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patch.
>
> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Shirley,
>>
>> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang 
>> wrote:
>>
>>> Hi!
>>>
>>> I can't seem to get the patch to completely work on my computer,
>>> only the close icon shows up plus the dialog and success/error messages,
>>> but here are some comments:
>>>
>>> Because  we are just cancelling the active running query, so if the
>> start of the session is 'Active' when you cancel it will simply goto 
>> 'Idle'
>> stat.
>>
>>> +1 to Dave's comment about refreshing after the cancel operation
>>>
>>> I'll fix this.
>>
>>> - We're working on a patch for updating alerts in the Dashboard tab
>>> which updates the grays in the Database activities panel and changes the
>>> border around the refresh button and search bar to 1px. This hasn't been
>>> submitted yet but just a heads up as you work on the alignment.
>>>
>>> - Something to consider is how a super user will identify which
>>> session should be closed. Is that information there?
>>>
>>> I think super user can cancel everything except main connection
>> session & as Dave mentioned in previous email that background workers in
>> PG10.
>>
>>> - Are there sessions that should never be closed? If so, do they
>>> also need close buttons? (Probably not, because that will lead the user 
>>> to
>>> an error message, which is not fun)
>>>
>>> In Backgrid, we can not exclude specific column from certain rows if
>> it renders in one row then it will render for every row in the grid, What
>> we can do is, it will throw an error when user is not eligible to cancel
>> the active running query.
>>
>>> - Perhaps this is a good feature to review with Chethana! :)
>>>
>>> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 On Mon, Jul 17, 2017 at 3:01 PM, Dave Page 
 wrote:

> Hi
>
> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> 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"
>>
>> Some comments:
>
> - The action here is to cancel the active query in the backend,
> not the session - so messages etc. should say things like "Cancel 
> Active
> Query?"
>
>
 - The grid should refresh following the cancel operation.
>
> -

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

2017-07-24 Thread Harshal Dhumal
-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Mon, Jul 24, 2017 at 8:11 PM, Dave Page  wrote:

>
>
> On Mon, Jul 24, 2017 at 3:28 PM, Shirley Wang  wrote:
>
>> 2-3 days is a lot of valuable engineering time. Is this a 'drop
>> everything now' kind of feature or can this wait for some user validation
>> on a mock up first?
>>
>
> Most of the time will likely be on the infrastructure to change the
> display to a subnode control. If you have some cycles to mockup potential
> layouts for the subnode view and have them validated, please feel free,
> however, that seems like an awful lot of work to me to display some missing
> SQL using a standard control.
>
Regarding SQL display: Developing simple control to show codemirror in
disabled state (for now) wont take that much time.


>
>
>>
>> On Jul 24, 2017, at 20:41, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>> Sure.
>>
>> RM created: https://redmine.postgresql.org/issues/2597.
>>
>> On Mon, Jul 24, 2017 at 6:04 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Mon, Jul 24, 2017 at 1:12 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 On Mon, Jul 24, 2017 at 4:44 PM, Dave Page  wrote:

> Thanks, applied.
>
> How much effort do you think it would take to turn the table into a
> subnode control so we can show the SQL query and other missing fields from
> pg_stat_activity on that tab?
>
 I think around 2-3 days would be needed.

>>>
>>> OK - can you add a Redmine and work on that please? It's been a known
>>> deficiency for quite a while, and whilst working on this patch I realised
>>> just how badly we really need to see the SQL there.
>>>
>>> Thanks.
>>>
>>>

>
 On Mon, Jul 24, 2017 at 11:45 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please find updated patch.
>>
>> On Tue, Jul 18, 2017 at 8:05 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Shirley,
>>>
>>> On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang 
>>> wrote:
>>>
 Hi!

 I can't seem to get the patch to completely work on my computer,
 only the close icon shows up plus the dialog and success/error 
 messages,
 but here are some comments:

 Because  we are just cancelling the active running query, so if the
>>> start of the session is 'Active' when you cancel it will simply goto 
>>> 'Idle'
>>> stat.
>>>
 +1 to Dave's comment about refreshing after the cancel operation

 I'll fix this.
>>>
 - We're working on a patch for updating alerts in the Dashboard tab
 which updates the grays in the Database activities panel and changes 
 the
 border around the refresh button and search bar to 1px. This hasn't 
 been
 submitted yet but just a heads up as you work on the alignment.

 - Something to consider is how a super user will identify which
 session should be closed. Is that information there?

 I think super user can cancel everything except main connection
>>> session & as Dave mentioned in previous email that background workers in
>>> PG10.
>>>
 - Are there sessions that should never be closed? If so, do they
 also need close buttons? (Probably not, because that will lead the 
 user to
 an error message, which is not fun)

 In Backgrid, we can not exclude specific column from certain rows
>>> if it renders in one row then it will render for every row in the grid,
>>> What we can do is, it will throw an error when user is not eligible to
>>> cancel the active running query.
>>>
 - Perhaps this is a good feature to review with Chethana! :)

 On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page 
> wrote:
>
>> Hi
>>
>> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> 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 

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

2017-07-24 Thread Shirley Wang
>
>
> On Mon, Jul 24, 2017 at 8:11 PM, Dave Page  wrote:
>
>>
>>
>> On Mon, Jul 24, 2017 at 3:28 PM, Shirley Wang  wrote:
>>
>>> 2-3 days is a lot of valuable engineering time. Is this a 'drop
>>> everything now' kind of feature or can this wait for some user validation
>>> on a mock up first?
>>>
>>
>> Most of the time will likely be on the infrastructure to change the
>> display to a subnode control. If you have some cycles to mockup potential
>> layouts for the subnode view and have them validated, please feel free,
>> however, that seems like an awful lot of work to me to display some missing
>> SQL using a standard control.
>>
> Regarding SQL display: Developing simple control to show codemirror in
> disabled state (for now) wont take that much time.
>
>
Part of a product designer's job is to make sure there is a definitive need
for a feature and that the interface for the feature is designed in such a
way that the user gets all intended value from it. Time spent validating
now will decrease the time spent later on redesigning / reimplementing.

If everyone is aware of what that value is and confident that how it'll be
displayed is right, there's little risk in starting to develop it. If we're
wrong, it'll add to feature bloat and detract from the experience.

Would Chethana be able to take on some of the design work? It would be
valuable for the dev team to also be part of design process.