[SOLVED] Ho to change/extend a javascript function(default interface) in opennebula-5.6.beta1?

Up to one-5.4.13 to add additional entries/fields to the “Add Datastore Wizard” I was patching the supplied sunstone sources and rebuilding the interface.

In one-5.5.80 (one-5.6.beta1) the sunstone’s sources are stripped from the installation package in favor to the new addon interface.

I’ve spent few days trying to figure out how to use the new addon interface but couldn’t find a way to do such changes.

Any help is welcome.

Best Regards,
Anton Todorov

edit: clarified that I am adding both new fields and extending the drop-down lists.

Hello @atodorov_storpool,

I don’t understand very well what you mean. The addons process has not changed at all. The sources are still where ever. If you have your installation in ‘prod’ just compile again and run ‘sunstone-server start’, and if it’s in ‘dev’, refreshing the browser would be enough.

Hi Abel,

I mean that the sources needed to (re)build the minified main.js are not included in the opennebula-sunstone package after https://github.com/OpenNebula/packages/commit/2a1e91972b6fbf4080a064f025661d48072869e4

There is no /usr/lib/one/sunstone/app available in 5.5.80:

[root@one-560 ]# rpm -qi opennebula-sunstone
Name : opennebula-sunstone
Version : 5.5.80
Release : 1
Architecture: noarch
Install Date: Sat 09 Jun 2018 10:28:23 AM UTC
Group : System
Size : 21290543
License : Apache
Signature : RSA/SHA1, Sun 03 Jun 2018 10:52:33 PM UTC, Key ID 592f7f0585e16ebf
Source RPM : opennebula-5.5.80-1.src.rpm
Build Date : Sun 03 Jun 2018 10:52:20 PM UTC
Build Host : centos7-centos7-5.5.80-0c7a9ca7-2af402f1-1193.build
Relocations : (not relocatable)
Packager : OpenNebula Team contact@opennebula.org
URL : http://opennebula.org
Summary : Browser based UI and public cloud interfaces.
Description :
Browser based UI for administrating a OpenNebula cloud. Also includes
the public cloud interface econe-server (AWS cloud
API).

[root@one-560 ]# rpm -ql opennebula-sunstone | grep app
/usr/lib/one/ruby/cloud/econe/econe_application.rb
/usr/lib/one/sunstone/public/css/app.min.css

Without these sources it is, lets say, hard to integrate with the GUI. If there is need to remove the sources, why not providing them in a separate package then? It is not convenient to fork the code and build/carry own main.js just to add an option to a dropdown and add few variablesto the datastore wizard.

IMO in the perfect world the information for the datastore interface and wizard should be provided by the backend(oned?) depending on what is configured/enabled as datastores. So when a new driver is introduced there should be no need to alter the sunstone at all. The backend shoud supply all the information for the interface/wizard to fill the lists and variables.

BR,
Anton

You’re right, I did not consider the installation by packages.

We will take all this into account for the new version. For the moment, if you install Opennebula by source, you can modify the code as usual.

Thanks for your help.

Regards.

Hi @AbelC,

Than k you for the quick reaction.

Confirming that everything is working fine with 5.6.0-RC (5.5.90-1).

Cheers,
Anton

1 Like