* [pve-devel] pve-manager/www: API for external plugins?
@ 2022-11-03 10:28 Roland Kammerer
2022-11-04 13:46 ` Thomas Lamprecht
0 siblings, 1 reply; 3+ messages in thread
From: Roland Kammerer @ 2022-11-03 10:28 UTC (permalink / raw)
To: pve-devel
Dear PVE devs,
I'm the maintainer of the linstor-proxmox plugin and thanks to your
storage plugin API we have a strong FLOSS and customer user base. What
would be nice for our users is better integration in the web GUI,
especially in "Datacenter -> Storage -> Add".
I'm not a web dev at all, I just patched in a new entry into
pvemanagerlib.js. From what I see in the Makefile that itself is just
the concatenated version of several .js files. Would it be possible to
have an extra "plugin.js" that then just includes all .js from some
/i/dont/know/plugins/ directory? I also saw that there is at least one
dict that glues things together (storageSchema in Utils.js), so there
probably would be some need to "register" external plugins into these
data structures. And that is where I stop showing my entire lack of web
development knowledge :).
Could you provide some kind of API that allows external plugins to
integrate into the GUI? Or maybe it even exists and I did not see it?
Thanks, rck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] pve-manager/www: API for external plugins?
2022-11-03 10:28 [pve-devel] pve-manager/www: API for external plugins? Roland Kammerer
@ 2022-11-04 13:46 ` Thomas Lamprecht
2022-11-21 8:26 ` Roland Kammerer
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2022-11-04 13:46 UTC (permalink / raw)
To: Proxmox VE development discussion, Roland Kammerer; +Cc: Ilya Krel
Hi,
Am 03/11/2022 um 11:28 schrieb Roland Kammerer:
> I'm the maintainer of the linstor-proxmox plugin and thanks to your
> storage plugin API we have a strong FLOSS and customer user base. What
> would be nice for our users is better integration in the web GUI,
> especially in "Datacenter -> Storage -> Add".
>
> I'm not a web dev at all, I just patched in a new entry into
> pvemanagerlib.js. From what I see in the Makefile that itself is just
> the concatenated version of several .js files. Would it be possible to
> have an extra "plugin.js" that then just includes all .js from some
> /i/dont/know/plugins/ directory? I also saw that there is at least one
> dict that glues things together (storageSchema in Utils.js), so there
> probably would be some need to "register" external plugins into these
> data structures. And that is where I stop showing my entire lack of web
> development knowledge :).
We won't add any-JS includes, that's just really messy in the dynamically
prototype "mess" JS is and we cannot guarantee a safe execution at all,
which for the Storage plugin backend is at least only the admin-owned
server, that the admin setups themselves anyway, not all users through
all browsers.
Iff, there needs a more schematic approach provided by the backend via an
schema-checked API call, more on that below.
>
> Could you provide some kind of API that allows external plugins to
> integrate into the GUI? Or maybe it even exists and I did not see it?
>
No, there's no functionality at the moment. We got such a request also from
the quite active BlockBridge devs, and my reply[0] contains some hints in
how one could achieve that, in short, similar to how we handle the more
popular ones from the huge amount of different acme.sh plugins, via a
schema[1][2] that gets dynamically translated to a form in the web
interface[3].
If done somewhat nicely and safely we'd accept such a thing, the plugins
would get an new method (e.g., api_schema) that returns a perl hash ref
containing the properties including type, description and flags like if the
setting is editable (after storage addition), and a new API endpoint
returning the schema's of all (external) plugins similar so that they can be
shown in the add Drop down and used for creating the basic form.
Do you want to work on something like that? We can try to help on questions,
review and with some polishing, but the major effort may need to come from
parties interested in this, but maybe the BlockBridge devs (I CCd Ilya, hope
that was OK) are still interested in that too, and can help, if only by
verifying that the solution is generic enough to be useful to more than one
specific external Plugin.
regards,
Thomas
[0]: https://bugzilla.proxmox.com/show_bug.cgi?id=3420#c1
[1]: https://git.proxmox.com/?p=proxmox-acme.git;a=blob;f=src/dns-challenge-schema.README;h=1de1cd115a765e1d1917733db84c21a6c952a441;hb=HEAD
[2]: https://git.proxmox.com/?p=proxmox-acme.git;a=blob;f=src/dns-challenge-schema.json;h=39ac2babdd5eef71d5a31216375bc970098bad76;hb=HEAD
[3]: https://git.proxmox.com/?p=pve-manager.git;a=blob;f=www/manager6/dc/ACMEPluginEdit.js;h=570b4dd20038c49ddd2b68153e672b8deae0cf4d;hb=HEAD#l19
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] pve-manager/www: API for external plugins?
2022-11-04 13:46 ` Thomas Lamprecht
@ 2022-11-21 8:26 ` Roland Kammerer
0 siblings, 0 replies; 3+ messages in thread
From: Roland Kammerer @ 2022-11-21 8:26 UTC (permalink / raw)
To: Proxmox VE development discussion; +Cc: Thomas Lamprecht, Ilya Krel
Hi Thomas,
sorry for the long delay, and thanks for the pointers. In general we
would be willing to work on that if it does not take us too much effort.
We currently try to figure that out. A colleague of mine told me that
the js part should not be the problem, what I am not sure about is this
part:
On Fri, Nov 04, 2022 at 02:46:15PM +0100, Thomas Lamprecht wrote:
> If done somewhat nicely and safely we'd accept such a thing, the plugins
> would get an new method (e.g., api_schema) that returns a perl hash ref
> containing the properties including type, description and flags like if the
> setting is editable (after storage addition),
Okay, sure the plugins have to report their schema, I'm just not sure
about the "perl hash ref". How/where would/are the web part and the
plugins communicate? Would that be a real reference somewhere or would
the plugins just output a json dict that is somewhere parsed back?
> and a new API endpoint returning the schema's of all (external)
> plugins similar so that they can be shown in the add Drop down and
> used for creating the basic form.
Also obvious in general, I have the same problem of how and where do js
and perl code talk to each other.
Any hints and pointers in the right direction are welcome.
Best, rck
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-21 8:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 10:28 [pve-devel] pve-manager/www: API for external plugins? Roland Kammerer
2022-11-04 13:46 ` Thomas Lamprecht
2022-11-21 8:26 ` Roland Kammerer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox