Re: pgadmin4 - Use classic style interface, don't launch browser?

From: Dave Page <dpage(at)pgadmin(dot)org>
To: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
Cc: Avin Kavish <avinkavish(at)gmail(dot)com>, "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: pgadmin4 - Use classic style interface, don't launch browser?
Date: 2019-07-29 09:26:43
Message-ID: CA+OCxowDQCFh=qbfsBCz3c=wTM0c1dCNoAhj2xxsvmnJ4EjYFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

To try to bring some clarity here:

- Version 1.x and 2.x used a built-in browser as is being requested. We had
builds based on QtWebEngine and QtWebKit (the runtime is built on Qt, the
other option being wxWidgets - which we used and had many, many problems
with - for pgAdmin3). QtWebKit was rapidly falling out of support and had
rendering and other issues, and QtWebEngine was the primary cause of
countless complaints of poor performance from users. Moving to use an
external browser for the UI solved *many* issues, albeit at the cost of the
slightly less convenient client/server architecture.

- We have looked at various other alternatives to use a built-in browser.
None of them were feasible for us (either immature or unmaintained code, or
would require more effort than we could give to work on all supported
platforms).

- The only option that has appeared feasible is to use Electron, for which
we have an early PoC branch of the code at
https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=shortlog;h=refs/heads/electron,
and a more recent branch at
https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=shortlog;h=refs/heads/electron2/.
The second branch is based on the work of the first - it was just easier to
rebase all the changes into a new branch than to merge everything from
master back into the original electron branch. There's also a rough TODO
list at
https://redmine.postgresql.org/projects/pgadmin4/wiki/Electron_TODO_list

As this is a "nice to have" rather than a bug or feature that gives more
direct benefit to users, I, and the team at EDB that work on pgAdmin have
been hacking on it in spare time. If someone wants to take this on as a
project, their input would be more than welcome.

On Sun, Jul 28, 2019 at 7:55 PM richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
wrote:

> Avin,
>
> Let me start by saying;
> [image: grinning_face_with_smiling_eyes.png]
>
>
> On Sun, Jul 28, 2019 at 3:43 AM Avin Kavish <avinkavish(at)gmail(dot)com> wrote:
>
>> They weren't aimed directly at anyone in particular. They were
>> suggestions for go-getters who like to take control of their own fate and
>> instead of waiting for the randomness of the universe to deliver unto them
>> what they seek. Maybe I should have put a warning saying "not for the faint
>> hearted, requires effort and reading docs to accomplish"
>> Your missive appeared directed at the fella who was complaining about the
>> problems that pgAdmin4 relying on a browser was causing him, especially in
>> regards to password management. I apologize if I misunderstood.
>>
>
>
>> so he would need to install nodejs, npm, nativefier, either open a
>> command line/terminal every time he wants to start pgAdmin4 or write a
>> batch/shell script to start it. He would also have to remember to start
>> the pgAdmin *server* separately and forget about using the "New pgAdmin
>> window" function. To add insult to injury, he'd have to have
>> separate scripts/commands if he should want a tray icon or to run it full
>> screen.
>>
>> ^ With the way you word things, even standing up sounds hard. It's all
>> perspective, it's accomplishable with a bit of effort. While it may not be
>> possible to get nativefier to behave as described above, because it's an
>> automated tool, you can script electron to do all of the above for you.
>> That depends on the person, for some people *putting in half a dozen
>> stitches *is accomplishable with a bit of effort (heck I've done it
>> myself, painful but surely doable). I would still recommend someone who's
>> sliced themselves open go to the emergency room, or at least see a doctor.
>> But I guess it's all a matter of *perspective* 😉.
>>
>
>
>
>> To add insult to injury,
>>
>> ^ There are no insults nor injuries mate, surely nothing physical. It
>> leads me to believe that you are referring to emotional injury. Which then
>> leads me to conclude that you are too emotional about this whole
>> business of administering a database thing. Or maybe you are a fan of
>> hyperbole, I don't know. Tone is up to interpretation in written
>> communication.
>>
> Actually that's called *a figure of speech *[ *no end users were
> harmed in the writing of the previous email*].
>
>>
>> quite often actually. I have *lots* of work to do that doesn't involve
>> a web browser.
>>
>> ^ Sure, do that work and also keep the web browser open? How does a web
>> browser window interrupt your work? How is it any different from having a
>> dedicated window open? Do you run out of RAM or something? Do you
>> accidentally start browsing memes when you have a browser open? What's the
>> problem? Be explicit about what's wrong with the browser.
>>
> In my case, I don't need it, and yes I *do* run out of RAM or
> something (Can I have just a *little more RAM sir? )😋.*
>
>>
>> pulling the tab out wouldn't do *anything* toward solving his problem,
>> which revolved around password management
>>
>> ^ It wasn't meant to solve the password problem but needing a standalone
>> window problem, which is also mentioned in the write up. In fact, this
>> email wasn't aimed at anyone in particular. It is a general write up with a
>> few suggestions for all the standalone window needs I've seen over the past
>> few days. I haven't directly addressed anyone. I'm not sure you who you
>> are referring to by "his". I'm just a developer sharing my knowledge in
>> hopes that someone would benefit from it.
>>
> I don't know, but I am pretty sure *most* people these days (with the
> possible exception of my over 70 father) know how to either pull off a tab,
> or start another instance of their web browser. '*His*' was the person
> who wrote the initial email complaining about pgAdmin4 running in a browser
> and making a mess of his password management.
>
>>
>> Personally I have my own issues with the decision to write pgAdmin4 as a *web
>> app* running in it's own self contained web server. However I don't
>> think that there is much of a desire among the *official* dev team to
>> change this
>>
>> ^ pgAdmin4 cannot be changed from a client-server architecture to
>> anything else. It is too late. A re-write would be required, which is a
>> breaking change. The only possibility is to affect the design decisions of
>> pgAdmin5 or 6. If anyone makes a factual and formal presentation of why the
>> existing client-server architecture should be replaced with something else
>> rather than improving it, we could have a serious discussion. But I doubt
>> it, I think everything can be improved within the current architecture.
>> Yes, as a developer I realize the work it would take at this stage to
>> create an actual client program as opposed to the embedded web server that
>> it is now. Which is why I wrote that I don't see much of a desire among
>> the official dev team to change things. If you, or any member of the dev
>> team wants to have a serious discussion about the merits and limitations of
>> the current architecture with a goal of possibly changing things, I'm all
>> for it. Unfortunately it appears that the design and road map have already
>> been determined by the current dev team. With the exception of reported
>> bugs, or unforeseen issues, they don't appear to be open to any substantial
>> changes.
>>
>
>
>> One thing I don't see in these emails is any credible facts and arguments
>> against browsers, just a statement of personal unhappiness at the change of
>> status quo. Maybe, if arguments based on facts that affect user experience,
>> security or performance were provided, the team would do something about
>> them, as they have been doing since the start. Instead, I see complaints. I
>> don't see constructive feedback on possible improvements on this topic. I
>> don't see solutions. I don't even see real problems.
>> Hmmm.. where to begin.
>>
>
> - not all browsers are supported (as evidenced by a bug report where I
> was told that Chromium isn't a *supported* browser)
> - you have to run the UI as a separate program from the program itself
> - you have to worry about collisions between a *particular* browser's
> short cuts and another's (Chrome is different from FireFox is different
> from Edge, etc.)
> - context (or right-click) menus aren't typical of a desktop program
> (no copy / paste option in the query window for example)
> - you are limited to a single *window *(tab)
> - you don't have true pop-ups/dialog boxes/notifications
> - if you detach a query editor panel, you can't reattach it (though
> that's hopefully just an unresolved bug)
> - your *session* is now open to attacks from malicious plugins or
> random people across the internet (it's a *browser* after all)
> - your user / password management is effected by your particular
> browser's cache or policy
> - you're limited to the sand boxed security restrictions of the
> particular browser you happen to be using (try loading a 10 GB file)
> - disruptions of the connection between the application and the UI,
> timeout's etc. occur (long running pgAdmin4 sessions can cause the UI to
> freeze under kubuntu).
>
> Not an exhaustive listing by any stretch, just what I could come up
> with off the top of my head.
>
>
>> so, your final suggestion is that, *if* he's a javascript developer he
>> could simply *write his own program* to fix a perceived pgAdmin4
>> shortcoming.
>>
>> ^ yeah absolutely, write your own programs without asking other people to
>> do it for you for free of charge !!!!????? It's open source software. No
>> one owes you anything. This is distributed without liability
>> <https://electronjs.org/docs/api/browser-window>. The existence of
>> postgresql and pgadmin itself are mere courtesies.
>>
>
> 😂 No one said that they were *owed* anything. No one is claiming
> anyone is *liable* for anything either. Saying that if you don't like it
> you should just write your own is rather short sighted. Unless the dev
> team is writing pgAdmin4 *only* for *themselves* then they should care
> about what the end users care about. Otherwise they may find that they are
> the only ones using it. 🤔
>
>>
>> I did not mean write an entirely new admin app, I meant embed pgAdmin4 in
>> Electron which literally takes 5 lines of code as a start
>> <https://electronjs.org/docs/api/browser-window>. 1. Create a browser
>> window. 2. Point it to pgAdmin4 URL. 3. Enjoy !!. If you know SQL, this is
>> definitely do-able. And no it's not like the normal browser window. It will
>> look like a normal app. Or you could increase the immersion by creating a
>> frameless window but you may not be able to close it normally.
>> https://electronjs.org/docs/api/frameless-window
>>
>> Here's a starting point. Follow this getting started
>> <https://electronjs.org/docs/tutorial/first-app> first and replace the
>> code in main.js
>>
>> const { app, BrowserWindow } = require('electron')
>> let win
>> function createWindow () {
>> win = new BrowserWindow({
>> width: 800,
>> height: 600,
>> webPreferences: {
>> nodeIntegration: true
>> }
>> })
>>
>> win.loadURL('http://127.0.0.1:45707/browser/') // <--- Fix the port number and point this address to it.
>>
>> win.on('closed', () => {
>> win = null
>> })
>> }
>>
>> app.on('ready', createWindow)
>>
>> app.on('window-all-closed', () => {
>> if (process.platform !== 'darwin') {
>> app.quit()
>> }
>> })
>>
>> app.on('activate', () => {
>> if (win === null) {
>> createWindow()
>> }
>> })
>>
>> That's all there is to it. Once you have that working, you can take it a
>> step further by getting electron to launch the pgadmin4 server if it is not
>> running already by using spawn
>> <https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options>
>>
>> It's nice that you included the above, but it's not terribly helpful to
>> the *non*-programmer. I could write the Lorentz transformation
>> equations to handle relative velocities in special relativity
>>
> [image: image.png]
>
> but unless you're familiar with differential calculus and special
> relativity it's not very helpful.
>
>
>> *Maybe an alternate launch option based on Electron should be an
>> officially supported feature ?*
>>
> Maybe. Though I think it would have to handle the above mentioned
> limitations, and be *built in* for it to help *most* people.
>
> So there, no attacks, insults, or other *negativity. * Just one man's
> opinion.
>
>>
>>
>> On Sun, Jul 28, 2019 at 1:07 AM richard coleman <
>> rcoleman(dot)ascentgl(at)gmail(dot)com> wrote:
>>
>>> Hi Avin,
>>>
>>> My $0.02
>>>
>>> On Sat, Jul 27, 2019 at 2:11 PM Avin Kavish <avinkavish(at)gmail(dot)com>
>>> wrote:
>>>
>>>> Hey,
>>>>
>>>> Here's some unofficial input on the topic.
>>>>
>>>> This request baffles me for two reasons.
>>>>
>>>> a. Why does one need a standalone window when they can have pgAdmin
>>>> open in a tab while multi-tasking. Is there ever a time when the web
>>>> browser is closed while using a pc in 2019? If you lose tabs you can pin
>>>> the tab and it will always be on the left side.
>>>>
>>> quite often actually. I have *lots* of work to do that doesn't involve
>>> a web browser.
>>>
>>>
>>>> b. If you want it to run in it's own window, you can drag and pull the
>>>> tab to it's own standalone window.
>>>>
>>> pulling the tab out wouldn't do *anything* toward solving his problem,
>>> which revolved around password management
>>>
>>>> If that doesn't solve your problem,
>>>>
>>>> You can try Nativefier but you might need to launch pgAdmin on the same
>>>> port each time. It basically wraps any web site in an electron app.
>>>> Electron fyi allows developing desktop apps using web technologies. It's
>>>> based on chromium and nodejs and renders web apps just like google chrome
>>>> would. https://github.com/jiahaog/nativefier
>>>>
>>> so he would need to install nodejs, npm, nativefier, either open a
>>> command line/terminal every time he wants to start pgAdmin4 or write a
>>> batch/shell script to start it. He would also have to remember to start
>>> the pgAdmin *server* separately and forget about using the "New pgAdmin
>>> window" function. To add insult to injury, he'd have to have
>>> separate scripts/commands if he should want a tray icon or to run it full
>>> screen.
>>>
>>>>
>>>> Or if you are a javascript developer you can write an electron app
>>>> yourself to encapsulate and extend upon the current functionality.
>>>> https://electronjs.org/
>>>>
>>> so, your final suggestion is that, *if* he's a javascript developer he
>>> could simply *write his own program* to fix a perceived pgAdmin4
>>> shortcoming.
>>>
>>>> Personally, I find it convenient to have it as a tab while reading docs
>>>> and other stuff and often prefer it to switching to my IDE.
>>>>
>>>> I'm glad that you find the current set up convenient, unfortunately it
>>> seems like this is a problem for at least Mark and tutiluren.
>>>
>>>> Once again, this is unofficial. I'm not part of the team.
>>>>
>>> neither am I.
>>>
>>> Personally I have my own issues with the decision to write pgAdmin4 as a *web
>>> app* running in it's own self contained web server. However I don't
>>> think that there is much of a desire among the *official* dev team to
>>> change this.
>>>
>>> rik.
>>>
>>>> Regards,
>>>> Avin
>>>>
>>>> On Sat, Jul 27, 2019 at 10:51 PM Murtuza Zabuawala <
>>>> murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I am afraid this is not possible at a moment, pgAdmin4 doesn't have
>>>>> its own UI rendering engine so it is dependent on the default web browser
>>>>> on the user's system.
>>>>>
>>>>> -- Murtuza
>>>>>
>>>>> On Fri, 26 Jul 2019, 21:32 Mark Murawski, <markm-lists(at)intellasoft(dot)net>
>>>>> wrote:
>>>>>
>>>>>> Hello!
>>>>>>
>>>>>> How can I go back to the traditional pgadmin4 interface where it runs
>>>>>> in
>>>>>> its own window. I do not want to launch it as a browser tab.
>>>>>>
>>>>>>
>>>>>>

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

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

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2019-07-29 10:02:01 Re: (Repeat.) Please give pgAdmin 4 its own GUI. The constant password inputs are driving me insane...
Previous Message Dave Page 2019-07-29 08:45:21 Re: (Repeat.) Please give pgAdmin 4 its own GUI. The constant password inputs are driving me insane...