1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #1692: Enable the option to add addons dynamically to Sunstone (#1693)

This commit is contained in:
Abel Coronado 2018-01-29 16:44:39 +01:00 committed by Tino Vázquez
parent d9ca11088f
commit 9c1cde002c
7 changed files with 33 additions and 2 deletions

View File

@ -72,6 +72,7 @@ module.exports = function(grunt) {
modules: [
{
name: 'main',
excludeShallow: ['addons'],
include: ['almond']
},
{

View File

@ -0,0 +1,3 @@
This directory emulates "app" to maintain consistency with Sunstone.
In the process of minimizing, this directory is not compiled to add addons dynamically to production environments.

View File

@ -0,0 +1,3 @@
This dir emulates 'app/opennebula'.
From here the ajax requests will be made to the OpenNebula driver.

View File

@ -0,0 +1,3 @@
This dir emulates 'app/tabs'.
The whole hierarchy is the same as in the Sunstone tabs.

View File

@ -0,0 +1,13 @@
siteMap = {
addons: [
]
};
var path = "../addons/tabs/";
var deps = [];
siteMap.addons.forEach(function (addon) {
deps.push(path + addon);
});
require(deps, function (e){});

View File

@ -19,6 +19,9 @@ require.config({
/* Almond */
'almond': '../bower_components/almond/almond',
/* Addons */
'addons': './addons',
/* jQuery */
'jquery': '../bower_components/jquery/dist/jquery',
'jquery-ui': '../bower_components/jquery-ui/jquery-ui',
@ -357,7 +360,9 @@ require.config({
deps: [
'spice-spiceconn'
]
}
},
'addons': {}
}
});

View File

@ -106,7 +106,10 @@
<% if $conf[:env] == 'dev' %>
<script src="bower_components/requirejs/require.js" data-main="app/main"></script>
<% else %>
<script src="dist/main.js?v=<%= OpenNebula::VERSION %>"></script>
<script src="bower_components/requirejs/require.js"></script>
<script>
require(["dist/main", "app/addons"]);
</script>
<% end %>
</body>
</html>