public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
5+ messages / 2 participants
[nested] [flat]
* [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
@ 2021-04-06 08:12 Yogesh Mahajan <[email protected]>
2021-04-06 10:37 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Akshay Joshi <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Yogesh Mahajan @ 2021-04-06 08:12 UTC (permalink / raw)
To: pgadmin-hackers
Hello,
Please find a patch which diables change of connection from query tool
while query tool transaction is in progress.
Thanks,
Yogesh Mahajan
EnterpriseDB
Attachments:
[application/octet-stream] RM6082_v1.patch (2.0K, 3-RM6082_v1.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/sqleditor/execute_query.js b/web/pgadmin/static/js/sqleditor/execute_query.js
index 2c966550c..60ca49296 100644
--- a/web/pgadmin/static/js/sqleditor/execute_query.js
+++ b/web/pgadmin/static/js/sqleditor/execute_query.js
@@ -13,6 +13,7 @@ import url_for from '../url_for';
import axios from 'axios';
import * as httpErrorHandler from './query_tool_http_error_handler';
import * as queryTxnStatus from 'sources/sqleditor/query_txn_status_constants';
+import * as SqlEditorUtils from 'sources/sqleditor_utils';
class LoadingScreen {
constructor(sqlEditor) {
@@ -59,6 +60,7 @@ class ExecuteQuery {
const self = this;
self.explainPlan = explainPlan;
+ SqlEditorUtils.disable_connection_dropdown(true);
const sqlStatementWithAnalyze = ExecuteQuery.prepareAnalyzeSql(sqlStatement, explainPlan);
@@ -98,6 +100,7 @@ class ExecuteQuery {
// Highlight the error in the sql panel
self.sqlServerObject._highlight_error(httpMessageData.data.result);
}
+ SqlEditorUtils.disable_connection_dropdown(false);
}).catch(function (error) {
self.onExecuteHTTPError(error);
}
diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js
index 5f5b149e0..e51cab57b 100644
--- a/web/pgadmin/static/js/sqleditor_utils.js
+++ b/web/pgadmin/static/js/sqleditor_utils.js
@@ -57,6 +57,17 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'],
return string.charAt(0).toUpperCase() + string.slice(1);
},
+ // Disables arrow to change connection
+ disable_connection_dropdown: function (status) {
+ if (status){
+ $('.conn-info-dd').prop('disabled',true);
+ $('.connection-data').css({pointerEvents: 'none', cursor: 'arrow'});
+ }else{
+ $('.conn-info-dd').prop('disabled',false);
+ $('.connection-data').css({pointerEvents: 'auto', cursor: 'pointer'});
+ }
+ },
+
// Status flag
previousStatus: null,
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
2021-04-06 08:12 [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
@ 2021-04-06 10:37 ` Akshay Joshi <[email protected]>
2021-04-07 08:10 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Akshay Joshi @ 2021-04-06 10:37 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-hackers
Hi Yogesh
The issue is not fixed yet. I am able to change the connection while the
transaction is in progress. Please check and resend the patch.
On Tue, Apr 6, 2021 at 1:43 PM Yogesh Mahajan <
[email protected]> wrote:
> Hello,
>
> Please find a patch which diables change of connection from query tool
> while query tool transaction is in progress.
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
2021-04-06 08:12 [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
2021-04-06 10:37 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Akshay Joshi <[email protected]>
@ 2021-04-07 08:10 ` Yogesh Mahajan <[email protected]>
2021-04-08 10:44 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Yogesh Mahajan @ 2021-04-07 08:10 UTC (permalink / raw)
To: pgadmin-hackers; +Cc: Akshay Joshi <[email protected]>
Hello,
Sorry for the inconvenience.
Please update the patch.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Tue, Apr 6, 2021 at 4:07 PM Akshay Joshi <[email protected]>
wrote:
> Hi Yogesh
>
> The issue is not fixed yet. I am able to change the connection while the
> transaction is in progress. Please check and resend the patch.
>
> On Tue, Apr 6, 2021 at 1:43 PM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hello,
>>
>> Please find a patch which diables change of connection from query tool
>> while query tool transaction is in progress.
>>
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>
Attachments:
[application/octet-stream] RM6082_v2.patch (3.0K, 3-RM6082_v2.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/sqleditor/execute_query.js b/web/pgadmin/static/js/sqleditor/execute_query.js
index 2c966550c..8b3e1d91b 100644
--- a/web/pgadmin/static/js/sqleditor/execute_query.js
+++ b/web/pgadmin/static/js/sqleditor/execute_query.js
@@ -13,6 +13,7 @@ import url_for from '../url_for';
import axios from 'axios';
import * as httpErrorHandler from './query_tool_http_error_handler';
import * as queryTxnStatus from 'sources/sqleditor/query_txn_status_constants';
+import * as SqlEditorUtils from 'sources/sqleditor_utils';
class LoadingScreen {
constructor(sqlEditor) {
@@ -75,6 +76,8 @@ class ExecuteQuery {
if (ExecuteQuery.isSqlCorrect(httpMessageData)) {
self.loadingScreen.setMessage('Waiting for the query to complete...');
+ // Disable drop down arrow to change connections
+ SqlEditorUtils.disable_connection_dropdown(true);
self.updateSqlEditorStateWithInformationFromServer(httpMessageData.data);
@@ -161,6 +164,10 @@ class ExecuteQuery {
self.loadingScreen.hide();
self.sqlServerObject.update_msg_history(false, 'Execution Cancelled!', true);
}
+ // Enable dropdown arrow to change connection if status is not Busy
+ if(! ExecuteQuery.isQueryStillRunning(httpMessage)){
+ SqlEditorUtils.disable_connection_dropdown(false);
+ }
}
).catch(
error => {
@@ -168,6 +175,8 @@ class ExecuteQuery {
self.sqlServerObject.resetQueryHistoryObject(self.sqlServerObject);
self.loadingScreen.hide();
+ // Enable dropdown arrow to change connection
+ SqlEditorUtils.disable_connection_dropdown(false);
self.sqlServerObject.setIsQueryRunning(false);
if (self.sqlServerObject.is_query_tool) {
self.enableSQLEditorButtons();
@@ -229,6 +238,7 @@ class ExecuteQuery {
this.loadingScreen.hide();
this.enableSQLEditorButtons();
+ SqlEditorUtils.disable_connection_dropdown(false);
if (ExecuteQuery.wasConnectionLostToPythonServer(httpMessage.response)) {
this.handleConnectionToServerLost();
return;
diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js
index 5f5b149e0..e51cab57b 100644
--- a/web/pgadmin/static/js/sqleditor_utils.js
+++ b/web/pgadmin/static/js/sqleditor_utils.js
@@ -57,6 +57,17 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'],
return string.charAt(0).toUpperCase() + string.slice(1);
},
+ // Disables arrow to change connection
+ disable_connection_dropdown: function (status) {
+ if (status){
+ $('.conn-info-dd').prop('disabled',true);
+ $('.connection-data').css({pointerEvents: 'none', cursor: 'arrow'});
+ }else{
+ $('.conn-info-dd').prop('disabled',false);
+ $('.connection-data').css({pointerEvents: 'auto', cursor: 'pointer'});
+ }
+ },
+
// Status flag
previousStatus: null,
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
2021-04-06 08:12 [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
2021-04-06 10:37 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Akshay Joshi <[email protected]>
2021-04-07 08:10 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
@ 2021-04-08 10:44 ` Yogesh Mahajan <[email protected]>
2021-04-08 12:46 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Akshay Joshi <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Yogesh Mahajan @ 2021-04-08 10:44 UTC (permalink / raw)
To: pgadmin-hackers; +Cc: Akshay Joshi <[email protected]>
Hi,
Please discard the previous patch.
Here is the latest patch. This also fixes the issue of disappearing the
connection bar from the query tool on the resize pgAdmin window.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Wed, Apr 7, 2021 at 1:40 PM Yogesh Mahajan <
[email protected]> wrote:
> Hello,
>
> Sorry for the inconvenience.
> Please update the patch.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Tue, Apr 6, 2021 at 4:07 PM Akshay Joshi <[email protected]>
> wrote:
>
>> Hi Yogesh
>>
>> The issue is not fixed yet. I am able to change the connection while the
>> transaction is in progress. Please check and resend the patch.
>>
>> On Tue, Apr 6, 2021 at 1:43 PM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hello,
>>>
>>> Please find a patch which diables change of connection from query tool
>>> while query tool transaction is in progress.
>>>
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
Attachments:
[application/octet-stream] RM6082_v3.patch (3.0K, 3-RM6082_v3.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/sqleditor/execute_query.js b/web/pgadmin/static/js/sqleditor/execute_query.js
index 2c966550c..2ee9c321f 100644
--- a/web/pgadmin/static/js/sqleditor/execute_query.js
+++ b/web/pgadmin/static/js/sqleditor/execute_query.js
@@ -13,6 +13,7 @@ import url_for from '../url_for';
import axios from 'axios';
import * as httpErrorHandler from './query_tool_http_error_handler';
import * as queryTxnStatus from 'sources/sqleditor/query_txn_status_constants';
+import * as SqlEditorUtils from 'sources/sqleditor_utils';
class LoadingScreen {
constructor(sqlEditor) {
@@ -76,6 +77,9 @@ class ExecuteQuery {
if (ExecuteQuery.isSqlCorrect(httpMessageData)) {
self.loadingScreen.setMessage('Waiting for the query to complete...');
+ // Disable drop down arrow to change connections
+ SqlEditorUtils.disable_connection_dropdown(true);
+
self.updateSqlEditorStateWithInformationFromServer(httpMessageData.data);
// If status is True then poll the result.
@@ -161,6 +165,10 @@ class ExecuteQuery {
self.loadingScreen.hide();
self.sqlServerObject.update_msg_history(false, 'Execution Cancelled!', true);
}
+ // Enable connection list drop down again for query tool only
+ if(self.sqlServerObject.is_query_tool && !ExecuteQuery.isQueryStillRunning(httpMessage)){
+ SqlEditorUtils.disable_connection_dropdown(false);
+ }
}
).catch(
error => {
@@ -171,6 +179,7 @@ class ExecuteQuery {
self.sqlServerObject.setIsQueryRunning(false);
if (self.sqlServerObject.is_query_tool) {
self.enableSQLEditorButtons();
+ SqlEditorUtils.disable_connection_dropdown(false);
}
if(error.response) {
diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js
index 5f5b149e0..e51cab57b 100644
--- a/web/pgadmin/static/js/sqleditor_utils.js
+++ b/web/pgadmin/static/js/sqleditor_utils.js
@@ -57,6 +57,17 @@ define(['jquery', 'underscore', 'sources/gettext', 'sources/url_for'],
return string.charAt(0).toUpperCase() + string.slice(1);
},
+ // Disables arrow to change connection
+ disable_connection_dropdown: function (status) {
+ if (status){
+ $('.conn-info-dd').prop('disabled',true);
+ $('.connection-data').css({pointerEvents: 'none', cursor: 'arrow'});
+ }else{
+ $('.conn-info-dd').prop('disabled',false);
+ $('.connection-data').css({pointerEvents: 'auto', cursor: 'pointer'});
+ }
+ },
+
// Status flag
previousStatus: null,
diff --git a/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss b/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
index 9d5ba4deb..8ba3e5ebd 100644
--- a/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
+++ b/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
@@ -52,8 +52,6 @@
#editor-panel {
z-index: 0;
- position: absolute;
- top: $sql-editor-panel-top;
bottom: 0;
left: 0;
right: 0;
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running
2021-04-06 08:12 [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
2021-04-06 10:37 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Akshay Joshi <[email protected]>
2021-04-07 08:10 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
2021-04-08 10:44 ` Re: [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
@ 2021-04-08 12:46 ` Akshay Joshi <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Akshay Joshi @ 2021-04-08 12:46 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Thu, Apr 8, 2021 at 4:15 PM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> Please discard the previous patch.
> Here is the latest patch. This also fixes the issue of disappearing the
> connection bar from the query tool on the resize pgAdmin window.
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Wed, Apr 7, 2021 at 1:40 PM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hello,
>>
>> Sorry for the inconvenience.
>> Please update the patch.
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Tue, Apr 6, 2021 at 4:07 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Hi Yogesh
>>>
>>> The issue is not fixed yet. I am able to change the connection while the
>>> transaction is in progress. Please check and resend the patch.
>>>
>>> On Tue, Apr 6, 2021 at 1:43 PM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hello,
>>>>
>>>> Please find a patch which diables change of connection from query tool
>>>> while query tool transaction is in progress.
>>>>
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2021-04-08 12:46 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 08:12 [pgAdmin][Patch] RM 6082 - Able to change connection when a long query is running Yogesh Mahajan <[email protected]>
2021-04-06 10:37 ` Akshay Joshi <[email protected]>
2021-04-07 08:10 ` Yogesh Mahajan <[email protected]>
2021-04-08 10:44 ` Yogesh Mahajan <[email protected]>
2021-04-08 12:46 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox