[one-users] sunstone 4.0 customization

Rolandas Naujikas rolandas.naujikas at mif.vu.lt
Thu May 23 11:02:47 PDT 2013


Finally I got sunstone 4.0 to look almost like 3.2.

For each tab (vms, templates, images, files, datastores, vnets) I 
created a copy like vms2-tab.js, templates2-tab.js, ...
Changes are like:
--- vms-tab.js  2013-05-17 18:34:45.000000000 +0300
+++ vms2-tab.js 2013-05-23 20:40:34.000000000 +0300
@@ -867,11 +867,11 @@ var vm_info_panel = {
  };

  var vms_tab = {
-    title: tr("Virtual Machines"),
+    title: '<i class="icon-cloud"></i>'+tr("Virtual Machines"),
      content: vms_tab_content,
      buttons: vm_buttons,
-    tabClass: 'subTab',
-    parentTab: 'vresources-tab'
+    //tabClass: 'subTab',
+    //parentTab: 'vresources-tab'
  };

  Sunstone.addActions(vm_actions);

sunstone-views/mini.yaml is a copy of user.yaml with heading like:
small_logo: images/opennebula-sunstone-v4.0-small.png
enabled_tabs:
     - dashboard-tab
     - vms2-tab
     - templates2-tab
     - images2-tab
     - files2-tab
     - datastores2-tab
     - vnets2-tab
     - marketplace-tab
tabs:
...

Regards, Rolandas

P.S. We cannot remove vnets-tab.js from list, because some functions are 
used inside others tabs (templates-tab.js). If we want hide it we can 
leave vnets-tab.js inside *.yaml, but remove parent infra-tab.js.

On 2013-05-23 13:05, Daniel Molina wrote:
> On 23 May 2013 11:39, Rolandas Naujikas <rolandas.naujikas at mif.vu.lt> wrote:
>
>> On 2013-05-23 12:25, Daniel Molina wrote:
>>
>>> On 23 May 2013 10:42, Rolandas Naujikas <rolandas.naujikas at mif.vu.lt>
>>> wrote:
>>>
>>>   I'm trying to customize sunstone 4.0. I created mini.yaml with copy of a
>>>> user.yaml. I want to put some tabs (like vms, templates, images, files)
>>>> on
>>>> top level and I don't find easy way to do that. My attempt to copy
>>>> vms-tab.js to vms2-tab.js (templates-tab -> templates2-tab, images-tab ->
>>>> images2-tab also) and comment parentTab and tabClass properties works
>>>> partially (sunstone starts to misbehavior - most buttons don't click
>>>> anymore).
>>>>
>>>>
>>> Note that if you change the file name you will have to change the
>>> following
>>> lines in the code
>>>
>>> ----8<---------------
>>>     Sunstone.addMainTab('**templates-tab',templates_tab);
>>>     <div class="six columns">' + insert_permissions_table('**
>>> templates-tab',
>>>     Sunstone.popUpInfoPanel("**template_info_panel", "templates-tab");
>>>     var tab_name = 'templates-tab';
>>> ---->8---------------
>>>
>>
>> I did sed 's/templates-tab/templates2-**tab/g' templates2-tab.js already
>> after copying templates-tab.js to templates2-tab.js.
>>
>
> Please check if there is any error in the browser console. I have just
> tested it and it works for me, but you have to also change this line in
> config-tab.js
>
> config-tab.js:      var enabled =
> config['view']['tabs']['templates-tab']['template_creation_tabs'][template_tab_name];
>
> Changing file names of existing tabs is not recommended, unless you want to
> go all over the code changing the references to these files.
>
> Hope hits helps
>
>
>> Regards, Rolandas
>>
>>
>>   Regards, Rolandas
>>>>
>>>> P.S. In mean time I found a mistake in default admin.yaml -
>>>> "VM.livemigrate" should be "VM.migrate_live".
>>>>
>>>>
>>> Thank you, http://dev.opennebula.org/**issues/2079<http://dev.opennebula.org/issues/2079>
>>>
>>> Cheers
>>>
>>>
>>
>
>




More information about the Users mailing list