# Addon related variables to (next) sunstone

**URL:** <https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986>\
**Category:** Integration Support\
**Created:** [July 10, 2015, 11:33am UTC](https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986 "2015-07-10T11:33:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [July 10, 2015, 11:33am UTC](https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986/1 "2015-07-10T11:33:01Z")

</div>

Hello Developers,

I am preparing our [addon](https://github.com/OpenNebula/addon-storpool) for the upcoming OpenNebula release 4.14 and have problems with the integration to the web gui (sunstone). For the current relase (4.12) the integration was just to add some lines to datastores-tab.js by applying a generated patch file.

In the master git branch I found that there are a lot of changes. The datastores-tab.js is split on two files:

> src/sunstone/public/app/tabs/datastores-tab/form-panels/create.js  
> src/sunstone/public/app/tabs/datastores-tab/form-panels/create/wizard.hbs

Just for test I patched both files and rebuild the project to find that the changes are not applied.

I found that there is javascript file that is same as the one in the sources:

> one/src/sunstone/public/dist/main.js

It looks like it is somehow compiled.

So I have some questions:

1. How the main.js (and the corresponding main.js.map) is compiled/updated in the source?
2. As our addon is external to the core project the only way to integrate is with a patch that should be placed on customer’s site. What is the proper way to add code/variables/whatever to the sunstone module in this case?

Without sunstone integration the only option for configuration is via command line programs(oneds) that is not so convenient for the customers.

Kind Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [July 13, 2015, 9:09am UTC](https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986/2 "2015-07-13T09:09:44Z")

</div>

Hi Anton,

For testing/developing you can enable de dev environment for sunstone:

- Set :env to ‘dev’ in sunstone-server.conf
- Link the sunstone public folder inside src to /usr/lib/one/sunstone/public

This way, you don’t have to compile de js files.

We are going to update the way js files are built for the final release and there will be an option in the scons script.

> <https://github.com/OpenNebula/one/blob/master/src/sunstone/etc/sunstone-server.conf#L47>

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [July 13, 2015, 9:31am UTC](https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986/3 "2015-07-13T09:31:58Z")

</div>

Hi Daniel,

Thank you for the reply.

> [@dmolina](#):
>
> For testing/developing you can enable de dev environment for sunstone:
> 
> Set :env to ‘dev’ in sunstone-server.conf  
> Link the sunstone public folder inside src to /usr/lib/one/sunstone/public
> 
> This way, you don’t have to compile de js files.

I will check things with the dev environment enabled and prepare patches for them.

> [@dmolina](#):
>
> We are going to update the way js files are built for the final release and there will be an option in the scons script.

I’ll wait for the changes to appear in the master branch and will test again.

Can I assume that in the final release there will be a way to rebuild the js files at the customer site? Something like the source files packaged somewhere(like /usr/share/one…) so the integrations can patch them and rebuild the production js files.

Kind Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [July 29, 2015, 8:52am UTC](https://forum.opennebula.io/t/addon-related-variables-to-next-sunstone/986/4 "2015-07-29T08:52:37Z")

</div>

> [@atodorov\_storpool](#):
>
> Can I assume that in the final release there will be a way to rebuild the js files at the customer site? Something like the source files packaged somewhere(like /usr/share/one…) so the integrations can patch them and rebuild the production js files.

Yes, the release tarball will include the non-minified files and you will be able to rebuild them
