public inbox for [email protected]
help / color / mirror / Atom feedFrom: Pradip Parkale <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Cyril Jouve <[email protected]>
Subject: Re: RM5841: server.username can be empty when using .pg_service.conf
Date: Tue, 22 Sep 2020 12:10:22 +0530
Message-ID: <CAJ9T6StT3ZjShxLUToGhiLPrW4V8Tcr2aKE=XLRXJJEkVnJEmQ@mail.gmail.com> (raw)
In-Reply-To: <CAJ9T6SsYhopg_gboy+0Mt=6rGAhN141yDoam3qGpt470yRnNrQ@mail.gmail.com>
References: <CANhjAHxpK_j_w1Zmu5Keofsqz4bbcpsnKR8ybNPZUqQNN-DANg@mail.gmail.com>
<CANxoLDfvOYp=iyQ8Yqob6X7ywLKVe1xD=0u0YmaJ7X1p2WsA5A@mail.gmail.com>
<CAJ9T6SsYhopg_gboy+0Mt=6rGAhN141yDoam3qGpt470yRnNrQ@mail.gmail.com>
Hi Akshay,
Please find the updated patch.
On Mon, Sep 21, 2020 at 4:41 PM Pradip Parkale <
[email protected]> wrote:
> Hi Akshay,
>
>
> On Mon, Sep 21, 2020 at 9:30 AM Akshay Joshi <
> [email protected]> wrote:
>
>> Hi Pradip
>>
>> Can you please review the patch as that condition we have added for
>> Shared Server implementation?
>>
> Yes, we have added this for the shared server implementation. Please find
> the attached for this issue.
>
>>
>> On Sat, Sep 19, 2020 at 6:22 PM Cyril Jouve <[email protected]> wrote:
>>
>>> fix for https://redmine.postgresql.org/issues/5841
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Sr. Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>
--
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation
Attachments:
[application/octet-stream] RM5841_v2.patch (5.3K, 3-RM5841_v2.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index ed8fae0f0..af845e531 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -194,14 +194,6 @@ class ServerModule(sg.ServerGroupPluginModule):
# set to true
continue
- # if hide_shared_server or \
- # shared_server.name == auto_detected_server:
- # # Don't include shared server if hide shared server is
- # # set to true
- # continue
-
- # if shared_server.name == auto_detected_server:
- # continue
server = self.get_shared_server_properties(server,
shared_server)
connected = False
@@ -1280,8 +1272,9 @@ class ServerNode(PGChildNodeView):
if server is None:
return bad_request(self.not_found_error_msg())
- # Return if username is blank
- if server.username is None:
+ # Return if username is blank and the server is shared
+ if server.username is None and not server.service and \
+ server.shared:
return make_json_response(
status=200,
success=0,
@@ -1819,6 +1812,7 @@ class ServerNode(PGChildNodeView):
tunnel_identity_file=server.tunnel_identity_file,
errmsg=errmsg,
_=gettext,
+ service=server.service,
prompt_tunnel_password=prompt_tunnel_password,
prompt_password=prompt_password
)
@@ -1832,6 +1826,7 @@ class ServerNode(PGChildNodeView):
server_label=server.name,
username=server.username,
errmsg=errmsg,
+ service=server.service,
_=gettext,
)
)
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 37942da08..8a4be22b4 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -1208,7 +1208,7 @@ define('pgadmin.node.server', [
$.get(server_url)
.done(function(res) {
if (res.shared && _.isNull(res.username) && data.user_id != current_user.id){
- if (selectedTreeNodeData._type == 'server'){
+ if (selectedTreeNodeData._type == 'server' && !res.service){
pgAdmin.Browser.Node.callbacks.show_obj_properties.call(
pgAdmin.Browser.Nodes[tree.itemData(item)._type], {action: 'edit'}
);
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/password.html b/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
index 641d44e09..9b2c425e3 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
@@ -1,7 +1,13 @@
<form name="frmPassword" id="frmPassword" style="height: 100%; width: 100%" onsubmit="return false;">
<div>
- <div><span class="font-weight-bold" >{{ _('Please enter the password for the user \'{0}\' to connect the server - "{1}"').format(username,
- server_label) }}</span></div>
+ <div><span class="font-weight-bold" >
+ {% if service %}
+ {{ _('Please enter the password for the user to connect the server - "{0}"').format(server_label) }}
+ {% else %}
+ {{ _('Please enter the password for the user \'{0}\' to connect the server - "{1}"').format(username,
+ server_label) }}
+ {% endif %}
+ </span></div>
<div class="input-group row py-2">
<label for="password" class="col-sm-2 col-form-label" aria-hidden="true">{{ _('Password') }}</label>
<div class="col-sm-10">
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html b/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
index ea1dc178c..5de642f85 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
@@ -23,7 +23,13 @@
</div>
{% endif %}
{% if prompt_password %}
- <div><label class="font-weight-bold" for="password">{{ _('Database server password for the user \'{0}\' to connect the server "{1}"').format(username, server_label) }}</label></div>
+ <div><label class="font-weight-bold" for="password">
+ {% if service %}
+ {{ _('Database server password for the user to connect the server "{0}"').format(server_label) }}
+ {% else %}
+ {{ _('Database server password for the user \'{0}\' to connect the server "{1}"').format(username, server_label) }}
+ {% endif %}
+ </label></div>
<div class="input-group py-2">
<div class="w-100">
<input id="password" class="form-control" name="password" type="password">
view thread (5+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: RM5841: server.username can be empty when using .pg_service.conf
In-Reply-To: <CAJ9T6StT3ZjShxLUToGhiLPrW4V8Tcr2aKE=XLRXJJEkVnJEmQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox