Hi Murtuza, Why are we doing this using templates? Can this be done with a request to the backend to get the image and then retrieve the Gravatar if it is defined or return a static image if not?
+ +{% if config.SERVER_MODE %} window.onload = function(e){ setTimeout(function() { - var gravatarImg = '<img src="{{ username | gravatar }}" width="18" height="18" alt="Gravatar image for {{ username }}"> {{ username }} <span class="caret"></span>'; + var gravatarImg = {{ IMG.PREPARE_HTML()|safe }} //$('#navbar-menu .navbar-right > li > a').html(gravatarImg); var navbarRight = document.getElementById("navbar-menu").getElementsByClassName("navbar-right")[0]; if (navbarRight) { what if we have var gravatarImg = '<img src="/user/{{username}}/gravatar" width="18" height="18" alt="Gravatar image for {{ username }}"> {{ username }} <span class="caret"></span>'; And then the endpoint /user/{{username}}/gravatar would be responsible for returning a Gravatar or not depending on the configuration? Thanks Joao On Mon, Mar 5, 2018 at 3:13 AM Murtuza Zabuawala < murtuza.zabuaw...@enterprisedb.com> wrote: > Hi, > > PFA patch to disable Gravatar image in Server mode. > > Requirments & Issues: > - For security reasons. > - For systems which do not have internet access. > - Hangs pgAdmin4 while loading the page if connection has no internet > access (as described in the ticket) > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > >