diff --git a/install.sh b/install.sh index 3b44c1cf32..0c12de176e 100755 --- a/install.sh +++ b/install.sh @@ -1476,7 +1476,8 @@ SUNSTONE_ETC_FILES="src/sunstone/etc/sunstone-server.conf \ src/sunstone/etc/sunstone-oneflow.conf" SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml \ - src/sunstone/etc/sunstone-views/user.yaml" + src/sunstone/etc/sunstone-views/user.yaml \ + src/sunstone/etc/sunstone-views/cloud.yaml" SUNSTONE_MODELS_FILES="src/sunstone/models/OpenNebulaJSON.rb \ src/sunstone/models/SunstoneServer.rb \ diff --git a/share/man/SConstruct b/share/man/SConstruct index 4ac2b5d27b..639bea0e2f 100644 --- a/share/man/SConstruct +++ b/share/man/SConstruct @@ -66,3 +66,6 @@ env.Man('onegroup') env.Man('onezone') env.Man('onevdc') +env.Man('oneflow') +env.Man('oneflow-template') + diff --git a/share/man/oneflow-template.1 b/share/man/oneflow-template.1 new file mode 100644 index 0000000000..ab60bd3546 --- /dev/null +++ b/share/man/oneflow-template.1 @@ -0,0 +1,90 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "ONEFLOW\-TEMPLATE" "1" "July 2013" "" "oneflow-template(1) -- Manage oneFlow Templates" +. +.SH "NAME" +\fBoneflow\-template\fR +. +.SH "SYNOPSIS" +\fBoneflow\-template\fR \fIcommand\fR [\fIargs\fR] [\fIoptions\fR] +. +.SH "OPTIONS" +. +.nf + + \-j, \-\-json Print the resource in JSON + \-t, \-\-top Top for the command + \-d, \-\-delay x Sets the delay in seconds for top command + \-s, \-\-server url Service endpoint + \-u, \-\-username name User name + \-p, \-\-password pass User password + \-V, \-\-version Show version and copyright information + \-h, \-\-help Show this message +. +.fi +. +.SH "COMMANDS" +. +.IP "\(bu" 4 +list List the available Service Templates valid options: json +. +.IP "\(bu" 4 +top List the available Service Templates continuously valid options: json, top, delay +. +.IP "\(bu" 4 +create \fIfile\fR Create a new Service Template valid options: json +. +.IP "\(bu" 4 +show \fItemplate_id\fR Show detailed information of a given Service Template valid options: json +. +.IP "\(bu" 4 +delete \fIrange|templateid_list\fR Delete a given Service Template +. +.IP "\(bu" 4 +instantiate \fItemplate_id\fR Instantiate a Service Template valid options: json, top +. +.IP "\(bu" 4 +chgrp \fIrange|templateid_list\fR \fIgroupid\fR Changes the service template group +. +.IP "\(bu" 4 +chown \fIrange|templateid_list\fR \fIuserid\fR [\fIgroupid\fR] Changes the service template owner and group +. +.IP "\(bu" 4 +chmod \fIrange|templateid_list\fR \fIoctet\fR Changes the service template permissions +. +.IP "\(bu" 4 +update \fItemplateid\fR [\fIfile\fR] Update the template contents\. If a path is not provided the editor will be launched to modify the current content\. +. +.IP "" 0 +. +.SH "ARGUMENT FORMATS" +. +.IP "\(bu" 4 +file Path to a file +. +.IP "\(bu" 4 +range List of id\'s in the form 1,8\.\.15 +. +.IP "\(bu" 4 +text String +. +.IP "\(bu" 4 +groupid OpenNebula GROUP name or id +. +.IP "\(bu" 4 +userid OpenNebula USER name or id +. +.IP "\(bu" 4 +template_id OpenNebula SERVICE TEMPLATE name or id +. +.IP "\(bu" 4 +templateid_list Comma\-separated list of OpenNebula SERVICE TEMPLATE names or ids +. +.IP "" 0 +. +.SH "LICENSE" +OpenNebula 4\.1\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +. +.P +Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneflow.1 b/share/man/oneflow.1 new file mode 100644 index 0000000000..6152bba01d --- /dev/null +++ b/share/man/oneflow.1 @@ -0,0 +1,100 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "ONEFLOW" "1" "July 2013" "" "oneflow(1) -- Manage oneFlow Services" +. +.SH "NAME" +\fBoneflow\fR +. +.SH "SYNOPSIS" +\fBoneflow\fR \fIcommand\fR [\fIargs\fR] [\fIoptions\fR] +. +.SH "OPTIONS" +. +.nf + + \-j, \-\-json Print the resource in JSON + \-t, \-\-top Top for the command + \-d, \-\-delay x Sets the delay in seconds for top command + \-f, \-\-force Force the new cardinality even if it is outside + the limits + \-p, \-\-period x Seconds between each group of actions + \-n, \-\-number x Number of VMs to apply the action to each period + \-s, \-\-server url Service endpoint + \-u, \-\-username name User name + \-p, \-\-password pass User password + \-V, \-\-version Show version and copyright information + \-h, \-\-help Show this message +. +.fi +. +.SH "COMMANDS" +. +.IP "\(bu" 4 +list List the available services valid options: json +. +.IP "\(bu" 4 +show \fIservice_id\fR Show detailed information of a given service valid options: json +. +.IP "\(bu" 4 +top [\fIservice_id\fR] Top the services or the extended information of the target service if a id is specified valid options: json, top, delay +. +.IP "\(bu" 4 +delete \fIrange|service_id_list\fR Delete a given service +. +.IP "\(bu" 4 +shutdown \fIrange|service_id_list\fR Shutdown a service\. From RUNNING or WARNING shuts down the Service +. +.IP "\(bu" 4 +recover \fIrange|service_id_list\fR Recover a failed service, cleaning the failed VMs\. From FAILED_DEPLOYING continues deploying the Service From FAILED_SCALING continues scaling the Service From FAILED_UNDEPLOYING continues shutting down the Service From COOLDOWN the Service is set to running ignoring the cooldown duration From WARNING failed VMs are deleted, and new VMs are instantiated +. +.IP "\(bu" 4 +scale \fIservice_id\fR \fIrole_name\fR \fIcardinality\fR Scale a role to the given cardinality valid options: force +. +.IP "\(bu" 4 +chgrp \fIrange|service_id_list\fR \fIgroupid\fR Changes the service group +. +.IP "\(bu" 4 +chown \fIrange|service_id_list\fR \fIuserid\fR [\fIgroupid\fR] Changes the service owner and group +. +.IP "\(bu" 4 +chmod \fIrange|service_id_list\fR \fIoctet\fR Changes the service permissions +. +.IP "\(bu" 4 +action \fIservice_id\fR \fIrole_name\fR \fIvm_action\fR Perform an action on all the Virtual Machines of a given role\. Actions supported: shutdown,shutdown\-hard,undeploy,undeploy\-hard,hold,release,stop,suspend,resume,boot,delete,delete\-recreate,reboot,reboot\-hard,poweroff,poweroff\-hard,snapshot\-create valid options: period, number +. +.IP "" 0 +. +.SH "ARGUMENT FORMATS" +. +.IP "\(bu" 4 +file Path to a file +. +.IP "\(bu" 4 +range List of id\'s in the form 1,8\.\.15 +. +.IP "\(bu" 4 +text String +. +.IP "\(bu" 4 +groupid OpenNebula GROUP name or id +. +.IP "\(bu" 4 +userid OpenNebula USER name or id +. +.IP "\(bu" 4 +service_id OpenNebula SERVICE name or id +. +.IP "\(bu" 4 +service_id_list Comma\-separated list of OpenNebula SERVICE names or ids +. +.IP "\(bu" 4 +vm_action Actions supported: shutdown, shutdown\-hard, undeploy, undeploy\-hard, hold, release, stop, suspend, resume, boot, delete, delete\-recreate, reboot, reboot\-hard, poweroff, poweroff\-hard, snapshot\-create +. +.IP "" 0 +. +.SH "LICENSE" +OpenNebula 4\.1\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +. +.P +Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/scripts/context-packages/base/etc/init.d/vmcontext b/share/scripts/context-packages/base/etc/init.d/vmcontext index f4e836368a..641620edf3 100755 --- a/share/scripts/context-packages/base/etc/init.d/vmcontext +++ b/share/scripts/context-packages/base/etc/init.d/vmcontext @@ -1,6 +1,6 @@ #!/bin/bash # -# chkconfig: 2345 9 90 +# chkconfig: 2345 9 99 # description: network reconfigure # # -------------------------------------------------------------------------- # @@ -21,12 +21,12 @@ ### BEGIN INIT INFO # Provides: vmcontext -# Required-Start: +# Required-Start: $all # Required-Stop: # Should-Start: networking # Should-Stop: networking -# Default-Start: -# Default-Stop: 0 6 +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 # Short-Description: OpenNebula contextualization script ### END INIT INFO @@ -50,10 +50,8 @@ function execute_scripts { done } -CDROM_DEVICE=$(ls /dev/cdrom* /dev/scd* /dev/sr* | sort | head -n 1) - -if [ -e "$CDROM_DEVICE" ]; then - mount -t iso9660 $CDROM_DEVICE /mnt +if [ -e "/dev/disk/by-label/CONTEXT" ]; then + mount -t iso9660 -L CONTEXT -o ro /mnt if [ -f /mnt/context.sh ]; then export_rc_vars /mnt/context.sh fi diff --git a/share/scripts/context-packages/postinstall b/share/scripts/context-packages/postinstall index 0a277b1293..11d0e38192 100755 --- a/share/scripts/context-packages/postinstall +++ b/share/scripts/context-packages/postinstall @@ -19,19 +19,13 @@ rm -f /etc/udev/rules.d/70-persistent-cd.rules rm -f /etc/udev/rules.d/70-persistent-net.rules -RUNLEVEL=$(runlevel | cut -d' ' -f2) - -( - -cd /etc/rc${RUNLEVEL}.d -ln -sf ../init.d/vmcontext S99vmcontext - -) - # Debian based distros if [ -d /etc/network ]; then - cp /etc/network/interfaces /etc/network/interfaces.$(date "+%s") + # Register Service + update-rc.d vmcontext defaults 9 99 + # Prepare network files + cp /etc/network/interfaces /etc/network/interfaces.$(date "+%s") cat > /etc/network/interfaces < h4 > small { color: #6f6f6f !important; } -/* line 849, ../sass/app.scss */ +/* line 850, ../sass/app.scss */ .label.allocated { background-color: #2ba6cb; } -/* line 852, ../sass/app.scss */ +/* line 853, ../sass/app.scss */ .label.real { background-color: #707d85; } -/* line 855, ../sass/app.scss */ +/* line 856, ../sass/app.scss */ .label.total { background-color: #ac5a62; } -/* line 859, ../sass/app.scss */ +/* line 860, ../sass/app.scss */ .tabs dd a, .tabs li a { padding: 0px 13px; } -/* line 863, ../sass/app.scss */ +/* line 864, ../sass/app.scss */ .ui-layout-resizer-west { background: none; } -/* line 868, ../sass/app.scss */ +/* line 869, ../sass/app.scss */ .ui-layout-resizer-west:hover { background: none; width: 30px !important; } -/* line 874, ../sass/app.scss */ +/* line 875, ../sass/app.scss */ .ui-layout-toggler-west:hover { width: 30px !important; background: #2ba6cb !important; } -/* line 879, ../sass/app.scss */ +/* line 880, ../sass/app.scss */ .ui-layout-resizer-south:hover { height: 25px !important; } -/* line 883, ../sass/app.scss */ +/* line 884, ../sass/app.scss */ .ui-layout-resizer-south:hover .ui-layout-toggler-south { height: 25px !important; } -/* line 889, ../sass/app.scss */ +/* line 890, ../sass/app.scss */ .ui-layout-toggler-south:hover { height: 25px !important; background: #2ba6cb !important; } -/* line 900, ../sass/app.scss */ +/* line 901, ../sass/app.scss */ div.dataTables_wrapper { margin-bottom: 1.25em; } -/* line 906, ../sass/app.scss */ +/* line 907, ../sass/app.scss */ div.dataTables_length label, div.dataTables_filter label, div.dataTables_info { @@ -6999,46 +7000,46 @@ div.dataTables_info { font-weight: normal; } -/* line 911, ../sass/app.scss */ +/* line 912, ../sass/app.scss */ div.dataTables_length { padding-top: 0px; } -/* line 914, ../sass/app.scss */ +/* line 915, ../sass/app.scss */ div.dataTables_length label { float: left; text-align: left; } -/* line 919, ../sass/app.scss */ +/* line 920, ../sass/app.scss */ div.dataTables_length select { width: 75px; } -/* line 923, ../sass/app.scss */ +/* line 924, ../sass/app.scss */ div.dataTables_filter label { float: right; } -/* line 926, ../sass/app.scss */ +/* line 927, ../sass/app.scss */ div.dataTables_filter input { display: inline-block !important; width: auto !important; } -/* line 931, ../sass/app.scss */ +/* line 932, ../sass/app.scss */ div.dataTables_info { padding-top: 1px; } -/* line 935, ../sass/app.scss */ +/* line 936, ../sass/app.scss */ div.dataTables_paginate { float: right; margin: 0; padding-top: 2px; } -/* line 941, ../sass/app.scss */ +/* line 942, ../sass/app.scss */ table.dataTable { clear: both; margin-bottom: 0.5em !important; @@ -7046,7 +7047,7 @@ table.dataTable { width: 100%; } -/* line 952, ../sass/app.scss */ +/* line 953, ../sass/app.scss */ table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc, @@ -7056,50 +7057,50 @@ table.dataTable thead .sorting_desc_disabled { *cursor: hand; } -/* line 957, ../sass/app.scss */ +/* line 958, ../sass/app.scss */ table.dataTable thead .sorting_asc { background: url("../images/sort_asc_disabled.png") no-repeat center right; } -/* line 958, ../sass/app.scss */ +/* line 959, ../sass/app.scss */ table.dataTable thead .sorting_desc { background: url("../images/sort_desc_disabled.png") no-repeat center right; } -/* line 960, ../sass/app.scss */ +/* line 961, ../sass/app.scss */ table.dataTable thead .sorting_asc_disabled { background: url("../images/sort_asc_disabled.png") no-repeat center right; } -/* line 961, ../sass/app.scss */ +/* line 962, ../sass/app.scss */ table.dataTable thead .sorting_desc_disabled { background: url("../images/sort_desc_disabled.png") no-repeat center right; } -/* line 963, ../sass/app.scss */ +/* line 964, ../sass/app.scss */ table.dataTable th:active { outline: none; } /* Scrolling */ -/* line 968, ../sass/app.scss */ +/* line 969, ../sass/app.scss */ div.dataTables_scrollHead table { margin-bottom: 0 !important; } -/* line 972, ../sass/app.scss */ +/* line 973, ../sass/app.scss */ div.dataTables_scrollBody table { border-top: none; margin-bottom: 0 !important; } -/* line 978, ../sass/app.scss */ +/* line 979, ../sass/app.scss */ div.dataTables_scrollBody tbody tr:first-child th, div.dataTables_scrollBody tbody tr:first-child td { border-top: none; } -/* line 982, ../sass/app.scss */ +/* line 983, ../sass/app.scss */ div.dataTables_scrollFoot table { border-top: none; } @@ -7107,42 +7108,42 @@ div.dataTables_scrollFoot table { /* * TableTools styles */ -/* line 993, ../sass/app.scss */ +/* line 994, ../sass/app.scss */ .table tbody tr.active td, .table tbody tr.active th { background-color: #08C; color: white; } -/* line 999, ../sass/app.scss */ +/* line 1000, ../sass/app.scss */ .table tbody tr.active:hover td, .table tbody tr.active:hover th { background-color: #0075b0 !important; } -/* line 1004, ../sass/app.scss */ +/* line 1005, ../sass/app.scss */ .table-striped tbody tr.active:nth-child(odd) td, .table-striped tbody tr.active:nth-child(odd) th { background-color: #017ebc; } -/* line 1011, ../sass/app.scss */ +/* line 1012, ../sass/app.scss */ table.policies_table th, table.policies_table td { font-size: 13px; } -/* line 1014, ../sass/app.scss */ +/* line 1015, ../sass/app.scss */ table.policies_table input { margin: 0px !important; height: 23px !important; font-size: 13px; } -/* line 1021, ../sass/app.scss */ +/* line 1022, ../sass/app.scss */ .key_td { font-weight: bold; } -/* line 1025, ../sass/app.scss */ +/* line 1026, ../sass/app.scss */ .detach-vnc-icon { top: 11px; right: 40px; @@ -7150,7 +7151,7 @@ table.policies_table input { color: #aaa; } -/* line 1032, ../sass/app.scss */ +/* line 1033, ../sass/app.scss */ .detach-vnc-icon:hover { color: #222; } diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 1c71cc5301..fcf9378390 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -1066,8 +1066,7 @@ var OpenNebula = { OpenNebula.Action.simple_action(params,OpenNebula.Template.resource,"unpublish"); }, "instantiate" : function(params) { - var vm_name = params.data.extra_param ? params.data.extra_param : ""; - var action_obj = { "vm_name" : vm_name }; + var action_obj = params.data.extra_param ? params.data.extra_param : {}; OpenNebula.Action.simple_action(params,OpenNebula.Template.resource, "instantiate",action_obj); }, diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 689a9622d9..eb485a439f 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -599,35 +599,37 @@ function setAclAutorefresh(){ $(document).ready(function(){ var tab_name = 'acls-tab'; - //if we are not oneadmin, our tab will not even be in the DOM. - dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check",2,3,4,5,6] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + //if we are not oneadmin, our tab will not even be in the DOM. + dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",2,3,4,5,6] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#acl_search').keyup(function(){ - dataTable_acls.fnFilter( $(this).val() ); - }) + $('#acl_search').keyup(function(){ + dataTable_acls.fnFilter( $(this).val() ); + }) - dataTable_acls.on('draw', function(){ - recountCheckboxes(dataTable_acls); - }) + dataTable_acls.on('draw', function(){ + recountCheckboxes(dataTable_acls); + }) - Sunstone.runAction("Acl.list"); + Sunstone.runAction("Acl.list"); - setupCreateAclDialog(); - setAclAutorefresh(); + setupCreateAclDialog(); + setAclAutorefresh(); - initCheckAllBoxes(dataTable_acls); - tableCheckboxesListener(dataTable_acls); - //shortenedInfoFields('#datatable_acls'); + initCheckAllBoxes(dataTable_acls); + tableCheckboxesListener(dataTable_acls); + //shortenedInfoFields('#datatable_acls'); - infoListener(dataTable_acls); + infoListener(dataTable_acls); - $('div#acls_tab div.legend_div').hide(); + $('div#acls_tab div.legend_div').hide(); + } }) diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index 6fbeb8f26c..0aff397a78 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -1407,32 +1407,34 @@ function clusters_sel() { $(document).ready(function(){ var tab_name = "clusters-tab" - //prepare host datatable - dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + //prepare host datatabl + dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#cluster_search').keyup(function(){ - dataTable_clusters.fnFilter( $(this).val() ); - }) + $('#cluster_search').keyup(function(){ + dataTable_clusters.fnFilter( $(this).val() ); + }) - dataTable_clusters.on('draw', function(){ - recountCheckboxes(dataTable_clusters); - }) + dataTable_clusters.on('draw', function(){ + recountCheckboxes(dataTable_clusters); + }) - Sunstone.runAction("Cluster.list"); + Sunstone.runAction("Cluster.list"); - dialogs_context.append('
'); + dialogs_context.append('
'); - setClusterAutorefresh(); - clusterResourceViewListeners(); + setClusterAutorefresh(); + clusterResourceViewListeners(); - initCheckAllBoxes(dataTable_clusters); - tableCheckboxesListener(dataTable_clusters); - infoListener(dataTable_clusters, "Cluster.showinfo"); + initCheckAllBoxes(dataTable_clusters); + tableCheckboxesListener(dataTable_clusters); + infoListener(dataTable_clusters, "Cluster.showinfo"); + } }); diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index e3cd2bbe41..585244c2fb 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -34,7 +34,7 @@ setInterval(function(){ Config = { "isTabEnabled": function(tab_name){ - var enabled = config['view']['tabs'][tab_name]['enabled']; + var enabled = config['view']['enabled_tabs'][tab_name]; return enabled; }, "isTabActionEnabled": function(tab_name, action_name, panel_name){ diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 87a319fbc4..e0133a613c 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -1116,39 +1116,42 @@ function setDatastoreAutorefresh(){ } $(document).ready(function(){ + var tab_name = 'datastores-tab'; - dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "sWidth": "200px", "aTargets": [5] }, - { "bVisible": true, "aTargets": config['view']['tabs']['datastores-tab']['table_columns']}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "sWidth": "200px", "aTargets": [5] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#datastore_search').keyup(function(){ - dataTable_datastores.fnFilter( $(this).val() ); - }) + $('#datastore_search').keyup(function(){ + dataTable_datastores.fnFilter( $(this).val() ); + }) - dataTable_datastores.on('draw', function(){ - recountCheckboxes(dataTable_datastores); - }) + dataTable_datastores.on('draw', function(){ + recountCheckboxes(dataTable_datastores); + }) - Sunstone.runAction("Datastore.list"); + Sunstone.runAction("Datastore.list"); - setupCreateDatastoreDialog(); - setDatastoreAutorefresh(); + setupCreateDatastoreDialog(); + setDatastoreAutorefresh(); - initCheckAllBoxes(dataTable_datastores); - tableCheckboxesListener(dataTable_datastores); - infoListener(dataTable_datastores,'Datastore.showinfo'); + initCheckAllBoxes(dataTable_datastores); + tableCheckboxesListener(dataTable_datastores); + infoListener(dataTable_datastores,'Datastore.showinfo'); - // Reset filter in case the view was filtered because it was accessed - // from a single cluster. - $('div#menu li#li_datastores_tab').live('click',function(){ - dataTable_datastores.fnFilter('',5); - }); + // Reset filter in case the view was filtered because it was accessed + // from a single cluster. + $('div#menu li#li_datastores_tab').live('click',function(){ + dataTable_datastores.fnFilter('',5); + }); - $('div#datastores_tab div.legend_div').hide(); + $('div#datastores_tab div.legend_div').hide(); + } }) diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 6737248253..4c3ef7bff5 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -969,32 +969,34 @@ function is_persistent_file(id){ $(document).ready(function(){ var tab_name = 'files-tab'; - dataTable_files = $("#datatable_files",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_files = $("#datatable_files",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#file_search').keyup(function(){ - dataTable_files.fnFilter( $(this).val() ); - }) + $('#file_search').keyup(function(){ + dataTable_files.fnFilter( $(this).val() ); + }) - dataTable_files.on('draw', function(){ - recountCheckboxes(dataTable_files); - }) + dataTable_files.on('draw', function(){ + recountCheckboxes(dataTable_files); + }) - Sunstone.runAction("File.list"); + Sunstone.runAction("File.list"); - setupCreateFileDialog(); - setupTips($create_file_dialog); - setFileAutorefresh(); + setupCreateFileDialog(); + setupTips($create_file_dialog); + setFileAutorefresh(); - initCheckAllBoxes(dataTable_files); - tableCheckboxesListener(dataTable_files); - infoListener(dataTable_files,'File.showinfo'); + initCheckAllBoxes(dataTable_files); + tableCheckboxesListener(dataTable_files); + infoListener(dataTable_files,'File.showinfo'); - $('div#files_tab div.legend_div').hide(); + $('div#files_tab div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 4ab6400285..8a96583f97 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -609,32 +609,34 @@ function setGroupAutorefresh(){ $(document).ready(function(){ var tab_name = 'groups-tab'; - dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check",4,5,6] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",4,5,6] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#group_search').keyup(function(){ - dataTable_groups.fnFilter( $(this).val() ); - }) + $('#group_search').keyup(function(){ + dataTable_groups.fnFilter( $(this).val() ); + }) - dataTable_groups.on('draw', function(){ - recountCheckboxes(dataTable_groups); - }) + dataTable_groups.on('draw', function(){ + recountCheckboxes(dataTable_groups); + }) - Sunstone.runAction("Group.list"); - setupCreateGroupDialog(); - setupGroupQuotasDialog(); - setGroupAutorefresh(); + Sunstone.runAction("Group.list"); + setupCreateGroupDialog(); + setupGroupQuotasDialog(); + setGroupAutorefresh(); - initCheckAllBoxes(dataTable_groups); - tableCheckboxesListener(dataTable_groups); - infoListener(dataTable_groups, 'Group.showinfo'); + initCheckAllBoxes(dataTable_groups); + tableCheckboxesListener(dataTable_groups); + infoListener(dataTable_groups, 'Group.showinfo'); - $('div#groups_tab div.legend_div').hide(); - $('div#groups_tab_non_admin div.legend_div').hide(); + $('div#groups_tab div.legend_div').hide(); + $('div#groups_tab_non_admin div.legend_div').hide(); + } }) diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 638ba81011..2ef52deb31 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -968,42 +968,44 @@ function hostMonitorError(req,error_json){ $(document).ready(function(){ var tab_name = 'hosts-tab'; - //prepare host datatable - dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check",5,6,7,8] }, - { "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + //prepare host datatable + dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",5,6,7,8] }, + { "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#hosts_search').keyup(function(){ - dataTable_hosts.fnFilter( $(this).val() ); - }) + $('#hosts_search').keyup(function(){ + dataTable_hosts.fnFilter( $(this).val() ); + }) - dataTable_hosts.on('draw', function(){ - recountCheckboxes(dataTable_hosts); - }) + dataTable_hosts.on('draw', function(){ + recountCheckboxes(dataTable_hosts); + }) - Sunstone.runAction("Host.list"); + Sunstone.runAction("Host.list"); - setupCreateHostDialog(); + setupCreateHostDialog(); - setHostAutorefresh(); + setHostAutorefresh(); - initCheckAllBoxes(dataTable_hosts); - tableCheckboxesListener(dataTable_hosts); - infoListener(dataTable_hosts, "Host.showinfo"); + initCheckAllBoxes(dataTable_hosts); + tableCheckboxesListener(dataTable_hosts); + infoListener(dataTable_hosts, "Host.showinfo"); - // This listener removes any filter on hosts table when its menu item is - // selected. The cluster plugins will filter hosts when the hosts - // in a cluster are shown. So we have to make sure no filter has been - // left in place when we want to see all hosts. - $('div#menu li#li_hosts_tab').live('click',function(){ - dataTable_hosts.fnFilter('',3); - }); + // This listener removes any filter on hosts table when its menu item is + // selected. The cluster plugins will filter hosts when the hosts + // in a cluster are shown. So we have to make sure no filter has been + // left in place when we want to see all hosts. + $('div#menu li#li_hosts_tab').live('click',function(){ + dataTable_hosts.fnFilter('',3); + }); - // Hide help - $('div#hosts_tab div.legend_div',main_tabs_context).hide(); + // Hide help + $('div#hosts_tab div.legend_div',main_tabs_context).hide(); + } }); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index fd4dd22d5a..8ae95e92cd 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -16,6 +16,8 @@ /*Images tab plugin*/ +size_images = 0; + var images_tab_content = '\
\
\ @@ -1349,32 +1351,34 @@ function popUpImageCloneDialog(){ $(document).ready(function(){ var tab_name = 'images-tab'; - dataTable_images = $("#datatable_images",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_images = $("#datatable_images",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#image_search').keyup(function(){ - dataTable_images.fnFilter( $(this).val() ); - }) + $('#image_search').keyup(function(){ + dataTable_images.fnFilter( $(this).val() ); + }) - dataTable_images.on('draw', function(){ - recountCheckboxes(dataTable_images); - }) + dataTable_images.on('draw', function(){ + recountCheckboxes(dataTable_images); + }) - Sunstone.runAction("Image.list"); + Sunstone.runAction("Image.list"); - setupCreateImageDialog(); - setupImageCloneDialog(); - setImageAutorefresh(); + setupCreateImageDialog(); + setupImageCloneDialog(); + setImageAutorefresh(); - initCheckAllBoxes(dataTable_images); - tableCheckboxesListener(dataTable_images); - infoListener(dataTable_images,'Image.showinfo'); + initCheckAllBoxes(dataTable_images); + tableCheckboxesListener(dataTable_images); + infoListener(dataTable_images,'Image.showinfo'); - $('div#images_tab div.legend_div').hide(); + $('div#images_tab div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index 6ead38aff1..8b511dfc46 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -292,46 +292,48 @@ function onlyOneCheckboxListener(dataTable) { $(document).ready(function(){ var tab_name = 'marketplace-tab'; - dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({ - "bSortClasses": true, - "aoColumns": [ - { "bSortable": false, - "mData": function ( o, val, data ) { - //we render 1st column as a checkbox directly - return '' + if (Config.isTabEnabled(tab_name)) { + dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({ + "bSortClasses": true, + "aoColumns": [ + { "bSortable": false, + "mData": function ( o, val, data ) { + //we render 1st column as a checkbox directly + return '' + }, + "sWidth" : "60px" }, - "sWidth" : "60px" - }, - { "mDataProp": "_id.$oid", "sWidth" : "200px" }, - { "mDataProp": "name" }, - { "mDataProp": "publisher" }, - { "mDataProp": "files.0.hypervisor", "sWidth" : "100px"}, - { "mDataProp": "files.0.os-arch", "sWidth" : "100px"}, - { "mDataProp": "files.0.format", "sWidth" : "100px"}, - { "mDataProp": "tags"} - ], - "aoColumnDefs": [ - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + { "mDataProp": "_id.$oid", "sWidth" : "200px" }, + { "mDataProp": "name" }, + { "mDataProp": "publisher" }, + { "mDataProp": "files.0.hypervisor", "sWidth" : "100px"}, + { "mDataProp": "files.0.os-arch", "sWidth" : "100px"}, + { "mDataProp": "files.0.format", "sWidth" : "100px"}, + { "mDataProp": "tags"} + ], + "aoColumnDefs": [ + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#marketplace_search').keyup(function(){ - dataTable_marketplace.fnFilter( $(this).val() ); - }) + $('#marketplace_search').keyup(function(){ + dataTable_marketplace.fnFilter( $(this).val() ); + }) - dataTable_marketplace.on('draw', function(){ - recountCheckboxes(dataTable_marketplace); - }) + dataTable_marketplace.on('draw', function(){ + recountCheckboxes(dataTable_marketplace); + }) - tableCheckboxesListener(dataTable_marketplace); - onlyOneCheckboxListener(dataTable_marketplace); + tableCheckboxesListener(dataTable_marketplace); + onlyOneCheckboxListener(dataTable_marketplace); - infoListenerMarket(dataTable_marketplace); + infoListenerMarket(dataTable_marketplace); - Sunstone.runAction('Marketplace.list'); + Sunstone.runAction('Marketplace.list'); + } }); diff --git a/src/sunstone/public/js/plugins/oneflow-services.js b/src/sunstone/public/js/plugins/oneflow-services.js index 9e6570dbc8..faeaa330f8 100644 --- a/src/sunstone/public/js/plugins/oneflow-services.js +++ b/src/sunstone/public/js/plugins/oneflow-services.js @@ -1806,28 +1806,30 @@ function setServiceAutorefresh() { $(document).ready(function(){ var tab_name = "oneflow-services"; - dataTable_services = $("#datatable_services",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_services = $("#datatable_services",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#services_search').keyup(function(){ - dataTable_services.fnFilter( $(this).val() ); - }) + $('#services_search').keyup(function(){ + dataTable_services.fnFilter( $(this).val() ); + }) - dataTable_services.on('draw', function(){ - recountCheckboxes(dataTable_services); - }) + dataTable_services.on('draw', function(){ + recountCheckboxes(dataTable_services); + }) - Sunstone.runAction("Service.list"); + Sunstone.runAction("Service.list"); - setServiceAutorefresh(); + setServiceAutorefresh(); - initCheckAllBoxes(dataTable_services); - tableCheckboxesListener(dataTable_services); - infoListener(dataTable_services,'Service.showinfo'); + initCheckAllBoxes(dataTable_services); + tableCheckboxesListener(dataTable_services); + infoListener(dataTable_services,'Service.showinfo'); + } }); diff --git a/src/sunstone/public/js/plugins/oneflow-templates.js b/src/sunstone/public/js/plugins/oneflow-templates.js index 3c3ea7d6cc..58ab8ac86d 100644 --- a/src/sunstone/public/js/plugins/oneflow-templates.js +++ b/src/sunstone/public/js/plugins/oneflow-templates.js @@ -1445,30 +1445,32 @@ function setServiceTemplateAutorefresh() { $(document).ready(function(){ var tab_name = "oneflow-templates"; - dataTable_service_templates = $("#datatable_service_templates",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_service_templates = $("#datatable_service_templates",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#service_templates_search').keyup(function(){ - dataTable_service_templates.fnFilter( $(this).val() ); - }) + $('#service_templates_search').keyup(function(){ + dataTable_service_templates.fnFilter( $(this).val() ); + }) - dataTable_service_templates.on('draw', function(){ - recountCheckboxes(dataTable_service_templates); - }) + dataTable_service_templates.on('draw', function(){ + recountCheckboxes(dataTable_service_templates); + }) - Sunstone.runAction("ServiceTemplate.list"); + Sunstone.runAction("ServiceTemplate.list"); - setServiceTemplateAutorefresh(); + setServiceTemplateAutorefresh(); - initCheckAllBoxes(dataTable_service_templates); - tableCheckboxesListener(dataTable_service_templates); - infoListener(dataTable_service_templates,'ServiceTemplate.showinfo'); + initCheckAllBoxes(dataTable_service_templates); + tableCheckboxesListener(dataTable_service_templates); + infoListener(dataTable_service_templates,'ServiceTemplate.showinfo'); - $('div#service_templates_tab div.legend_div').hide(); + $('div#service_templates_tab div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index da069139c3..37dfdc66cd 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -15,144 +15,295 @@ /* -------------------------------------------------------------------------- */ /*Templates tab plugin*/ - var templates_tab_content = '\ \ -
\ -
\ -
\ -

\ - \ - '+tr("Templates")+'\ - \ - \ -  \ - \ - \ -

\ -
\ -
\ -
\ -
\ -
\ +
\ +
\ +
\ +

\ + \ + '+tr("Templates")+'\ + \ + \ +  \ + \ + \ +

\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + \ +
\ +
\ +
\
\
\ -
\ - \ -
\ -
\ -
\ -
\ -
\
\
\ -\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+'
\ -
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+'
\ +
\
\ '; -var create_template_tmpl = '
'+ - '

'+tr("Create VM Template")+'

'+ - '
'+ - '
'+ - '
' + - '
'+tr("Wizard")+'
' + - '
'+tr("Advanced mode")+'
' + - '
' + - '
    ' + - '
  • ' + - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
      '+ - '
    '+ - '
    '+ +var create_template_tmpl = '\ +
    '+ + '

    '+tr("Create VM Template")+'

    '+ +'
    '+ +'
    '+ + '
    ' + + '
    '+tr("Wizard")+'
    ' + + '
    '+tr("Advanced mode")+'
    ' + + '
    ' + + '
      ' + + '
    • ' + + ''+ + '
      '+ + '
      '+ + '
      '+ + '
      '+ '
      '+ - '
    • ' + - '
    • ' + - '
      ' + - '

      '+tr("Write the Virtual Machine template here")+'

      ' + - '' + - ''+ + ''+ + '
      '+ + '
    • ' + + '
    • ' + + '
      ' + + '

      '+tr("Write the Virtual Machine template here")+'

      ' + + '' + + '
    • ' + - '
    ' + - '
    '+ - '×'; + '
    ' + + '' + + '
  • ' + + '
' + +'
'+ +'×'; var instantiate_vm_template_tmpl ='\ -
\ -

\ - '+tr("Instantiate VM Template")+'\ -

\ -
\ -
\ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
'+tr("Defaults to template name when emtpy")+'.
\ -
\ -
\ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
'+tr("You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ -
\ -
\ -
\ -
\ - \ - \ -
\ -×\ +
\ +

\ + '+tr("Instantiate VM Template")+'\ +

\ +
\ +\ +
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
'+tr("Defaults to template name when emtpy. You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ +
\ +
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
'+tr("Number of Virtual Machines that will be created using this template")+'.
\ +
\ +
\ +
\ +
\ +
\ + \ + \ +
\ + ×\
'; +var easy_provision_vm_template_tmpl ='\ +
\ +

\ + '+tr("Instantiate VM Template")+'\ +

\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 1: Specify a name and the number of instances")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
'+tr("Defaults to template name when emtpy. You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ +
\ +
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
'+tr("Number of Virtual Machines that will be created using this template")+'.
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 3: Select an instance type")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+'
\ + \ +
\ +
\ + '+tr("Please select a template from the list")+'\ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 3: Select an operating system")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Datastore")+''+tr("Size")+''+tr("Type")+''+tr("Registration time")+''+tr("Persistent")+''+tr("Status")+''+tr("#VMS")+''+tr("Target")+'
\ + \ +
\ +
\ + '+tr("Please select an image from the list")+'\ + \ + \ +
\ +
\ +
\ + \ + ×\ + \ +
'; + var dataTable_templates; var $create_template_dialog; @@ -171,6 +322,13 @@ var template_actions = { call: popUpCreateTemplateDialog }, + "Template.easy_provision" : { + type: "custom", + call: function() { + popUpInstantiateVMTemplateDialog(true); + } + }, + "Template.list" : { type: "list", call: OpenNebula.Template.list, @@ -289,13 +447,29 @@ var template_actions = { nodes = getSelectedNodes(dataTable_templates); if (nodes.length == 1) { - popUpInstantiateVMTemplateDialog(); + popUpInstantiateVMTemplateDialog(false); } else { Sunstone.runAction("Template.instantiate", nodes); } + Sunstone.runAction("VM.refresh"); + } + }, + "Template.instantiate_and_merge" : { + type: "custom", + call: function(){ + nodes = getSelectedNodes(dataTable_templates); + if (nodes.length == 1) + { + popUpMergeVMTemplateDialog(); + } + else + { + notifyError(tr("Please select only one template in the table")) + } + Sunstone.runAction("VM.refresh"); } }, @@ -350,6 +524,11 @@ var template_buttons = { type: "create_dialog", layout: "create" }, + "Template.easy_provision" : { + type: "create_dialog", + text: "Launch", + layout: "create" + }, "Template.update_dialog" : { type: "action", layout: "more_select", @@ -1151,9 +1330,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ '
'; $("#refresh_template_images_table_button_class"+str_disk_tab_id).die(); - $("#refresh_template_images_table_button_class"+str_disk_tab_id).live('click', function(){ - // Retrieve the images to fill the datatable update_datatable_template_images($('table[id='+str_datatable_id+']').dataTable()); }); @@ -1223,6 +1400,27 @@ function update_datatable_template_images(datatable, fnDrawCallback) { }); } +function update_datatable_template_templates(datatable, fnDrawCallback) { + if (fnDrawCallback) { + datatable.on('draw', fnDrawCallback); + } + + OpenNebula.Template.list({ + timeout: true, + success: function (request, templates_list){ + var template_list_array = []; + + $.each(templates_list,function(){ + var template_element_array = templateElementArray(this); + if (template_element_array) + template_list_array.push(template_element_array); + }); + + updateView(template_list_array, datatable); + } + }); +} + function update_datatable_template_files(datatable, fnDrawCallback) { if (fnDrawCallback) { datatable.on('draw', fnDrawCallback); @@ -4496,15 +4694,120 @@ function setTemplateAutorefresh() { // Instantiate dialog // Sets up the instiantiate template dialog and all the processing associated to it -function setupInstantiateTemplateDialog(){ +function setupInstantiateTemplateDialog(easy_provision){ dialogs_context.append('
'); //Insert HTML in place $instantiate_vm_template_dialog = $('#instantiate_vm_template_dialog') var dialog = $instantiate_vm_template_dialog; - dialog.html(instantiate_vm_template_tmpl); - dialog.addClass("reveal-modal"); + if (easy_provision) { + dialog.html(easy_provision_vm_template_tmpl); + dialog.addClass("reveal-modal large max-height"); + + var dataTable_template_images = $('#template_images_table', dialog).dataTable({ + "iDisplayLength": 4, + "bAutoWidth":false, + "sDom" : '<"H">t<"F"p>', + "aoColumnDefs": [ + { "sWidth": "35px", "aTargets": [0,1] }, + { "bVisible": false, "aTargets": [2,3,7,8,5,9,12]} + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#IMAGE_ID', dialog).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } + }); + + // Retrieve the images to fill the datatable + update_datatable_template_images(dataTable_template_images); + + $('#template_images_table_search', dialog).keyup(function(){ + dataTable_template_images.fnFilter( $(this).val() ); + }) + + $('#template_images_table tbody', dialog).delegate("tr", "click", function(e){ + var aData = dataTable_template_images.fnGetData(this); + + $("td.markrow", dataTable_template_images).removeClass('markrow'); + $('tbody input.check_item', dataTable_template_images).removeAttr('checked'); + + $('#image_selected', dialog).show(); + $('#select_image', dialog).hide(); + $('.alert-box', dialog).hide(); + + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + + $('#IMAGE_NAME', dialog).text(aData[4]); + $('#IMAGE_ID', dialog).val(aData[1]); + return true; + }); + + $("#refresh_template_images_table_button_class").die(); + $("#refresh_template_images_table_button_class").live('click', function(){ + update_datatable_template_images($('#template_images_table').dataTable()); + }); + + var dataTable_template_templates = $('#template_templates_table', dialog).dataTable({ + "iDisplayLength": 4, + "bAutoWidth":false, + "sDom" : '<"H">t<"F"p>', + "aoColumnDefs": [ + { "sWidth": "35px", "aTargets": [0,1] }, + { "bVisible": false, "aTargets": [1,2,3,5]} + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#TEMPLATE_ID', dialog).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } + }); + + // Retrieve the images to fill the datatable + update_datatable_template_templates(dataTable_template_templates); + + $('#template_templates_table_search', dialog).keyup(function(){ + dataTable_template_templates.fnFilter( $(this).val() ); + }) + + $('#template_templates_table tbody', dialog).delegate("tr", "click", function(e){ + var aData = dataTable_template_templates.fnGetData(this); + + $("td.markrow", dataTable_template_templates).removeClass('markrow'); + $('tbody input.check_item', dataTable_template_templates).removeAttr('checked'); + + $('#template_selected', dialog).show(); + $('#select_template', dialog).hide(); + $('.alert-box', dialog).hide(); + + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + + $('#TEMPLATE_NAME', dialog).text(aData[4]); + $('#TEMPLATE_ID', dialog).val(aData[1]); + return true; + }); + + $("#refresh_template_templates_table_button_class").die(); + $("#refresh_template_templates_table_button_class").live('click', function(){ + update_datatable_template_templates($('#template_templates_table').dataTable()); + }); + } else { + dialog.html(instantiate_vm_template_tmpl); + dialog.addClass("reveal-modal large"); + dialog.removeClass("max-height") + } + setupTips(dialog); @@ -4513,36 +4816,53 @@ function setupInstantiateTemplateDialog(){ var n_times = $('#vm_n_times',this).val(); var n_times_int=1; - var selected_nodes = getSelectedNodes(dataTable_templates); - var template_id = ""+selected_nodes[0]; + var template_id + if ($("#TEMPLATE_ID", this).val()) { + template_id = $("#TEMPLATE_ID", this).val(); + } else { + var selected_nodes = getSelectedNodes(dataTable_templates); + template_id = ""+selected_nodes[0]; + } + if (n_times.length){ n_times_int=parseInt(n_times,10); }; - var extra_info = ""; + var extra_msg = ""; if (n_times_int > 1) { - extra_info = n_times_int+" times"; + extra_msg = n_times_int+" times"; } - notifySubmit("Template.instantiate",template_id, extra_info); + notifySubmit("Template.instantiate",template_id, extra_msg); + + var extra_info = {}; + if ($("#IMAGE_ID", this).val()) { + image_id = $("#IMAGE_ID", this).val(); + extra_info['template'] = { + 'disk': { + 'image_id': image_id + } + } + } if (!vm_name.length){ //empty name use OpenNebula core default for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate_quiet", template_id, ""); + extra_info['vm_name'] = ""; + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; } else { if (vm_name.indexOf("%i") == -1){//no wildcard, all with the same name for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate_quiet", template_id, vm_name); + extra_info['vm_name'] = vm_name; + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; } else { //wildcard present: replace wildcard - var name = ""; for (var i=0; i< n_times_int; i++){ - name = vm_name.replace(/%i/gi,i); - Sunstone.runAction("Template.instantiate_quiet", template_id, name); + extra_info['vm_name'] = vm_name.replace(/%i/gi,i); + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; }; } @@ -4553,7 +4873,8 @@ function setupInstantiateTemplateDialog(){ } // Open creation dialog -function popUpInstantiateVMTemplateDialog(){ +function popUpInstantiateVMTemplateDialog(easy_provision){ + setupInstantiateTemplateDialog(easy_provision); $instantiate_vm_template_dialog.reveal(); } @@ -4561,34 +4882,34 @@ function popUpInstantiateVMTemplateDialog(){ $(document).ready(function(){ var tab_name = 'templates-tab'; - dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#template_search').keyup(function(){ - dataTable_templates.fnFilter( $(this).val() ); - }) + $('#template_search').keyup(function(){ + dataTable_templates.fnFilter( $(this).val() ); + }) - dataTable_templates.on('draw', function(){ - recountCheckboxes(dataTable_templates); - }) + dataTable_templates.on('draw', function(){ + recountCheckboxes(dataTable_templates); + }) - Sunstone.runAction("Template.list"); - setupInstantiateTemplateDialog(); - setupCreateTemplateDialog(); - setupTemplateCloneDialog(); - setTemplateAutorefresh(); + Sunstone.runAction("Template.list"); + setupCreateTemplateDialog(); + setupTemplateCloneDialog(); + setTemplateAutorefresh(); - initCheckAllBoxes(dataTable_templates); - tableCheckboxesListener(dataTable_templates); - infoListener(dataTable_templates,'Template.showinfo'); - - $('div#templates_tab div.legend_div').hide(); + initCheckAllBoxes(dataTable_templates); + tableCheckboxesListener(dataTable_templates); + infoListener(dataTable_templates,'Template.showinfo'); + $('div#templates_tab div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 6b0b9f90cf..cac9a55453 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -913,40 +913,42 @@ function setUserAutorefresh(){ $(document).ready(function(){ var tab_name = 'users-tab'; - //if we are not oneadmin, our tab will not even be in the DOM. - dataTable_users = $("#datatable_users",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check",5,6,7] }, - { "sWidth": "35px", "aTargets": [0] }, - { "sWidth": "150px", "aTargets": [5,6,7] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + //if we are not oneadmin, our tab will not even be in the DOM. + dataTable_users = $("#datatable_users",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",5,6,7] }, + { "sWidth": "35px", "aTargets": [0] }, + { "sWidth": "150px", "aTargets": [5,6,7] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#user_search').keyup(function(){ - dataTable_users.fnFilter( $(this).val() ); - }) + $('#user_search').keyup(function(){ + dataTable_users.fnFilter( $(this).val() ); + }) - dataTable_users.on('draw', function(){ - recountCheckboxes(dataTable_users); - }) + dataTable_users.on('draw', function(){ + recountCheckboxes(dataTable_users); + }) - Sunstone.runAction("User.list"); + Sunstone.runAction("User.list"); - setupCreateUserDialog(); - setupUpdatePasswordDialog(); - setupChangeAuthenticationDialog(); - setupUserQuotasDialog(); - setUserAutorefresh(); - //Setup quota icons - //Also for group tab - setupQuotaIcons(); + setupCreateUserDialog(); + setupUpdatePasswordDialog(); + setupChangeAuthenticationDialog(); + setupUserQuotasDialog(); + setUserAutorefresh(); + //Setup quota icons + //Also for group tab + setupQuotaIcons(); - initCheckAllBoxes(dataTable_users); - tableCheckboxesListener(dataTable_users); - infoListener(dataTable_users,'User.showinfo'); + initCheckAllBoxes(dataTable_users); + tableCheckboxesListener(dataTable_users); + infoListener(dataTable_users,'User.showinfo'); - $('div#users_tab div.legend_div').hide(); - $('div#users_tab_non_admin div.legend_div').hide(); + $('div#users_tab div.legend_div').hide(); + $('div#users_tab_non_admin div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 8d6bd32afc..110004ffea 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -89,54 +89,203 @@ var vms_tab_content = '\ \ '; +//var create_vm_tmpl ='\ +//
\ +//

\ +// '+tr("Create Virtual Machine")+'\ +//

\ +//
\ +//
\ +//
\ +//
\ +// \ +//
\ +//
\ +// \ +//
\ +//
\ +//
'+tr("Defaults to template name when emtpy")+'.
\ +//
\ +//
\ +//
\ +//
\ +// \ +//
\ +//
\ +// \ +//
\ +//
\ +//
\ +//
\ +//
\ +//
\ +//
\ +// \ +//
\ +//
\ +// \ +//
\ +//
\ +//
'+tr("You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ +//
\ +//
\ +//
\ +//
\ +// \ +// \ +//
\ +//×\ +//
'; + var create_vm_tmpl ='\ -
\ -

\ - '+tr("Create Virtual Machine")+'\ -

\ +
\ +

\ + '+tr("Create Virtual Machine")+'\ +

\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 1: Specify a name and the number of instances")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
'+tr("Defaults to template name when emtpy. You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ +
\
\ - \ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
'+tr("Defaults to template name when emtpy")+'.
\ -
\ +
\ +
\ + \
\ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
\ -
\ +
\ + \
\ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
'+tr("You can use the wildcard %i. When creating several VMs, %i will be replaced with a different number starting from 0 in each of them")+'.
\ -
\ +
\ +
'+tr("Number of Virtual Machines that will be created using this template")+'.
\
\ -
\ -
\ - \ - \
\ -×\ -'; +
\ +
\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 2: Select an instance type")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+'
\ + \ +
\ +
\ + '+tr("Please select a template from the list")+'\ + \ + \ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ + '+tr("Step 3: Select an operating system")+'\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Datastore")+''+tr("Size")+''+tr("Type")+''+tr("Registration time")+''+tr("Persistent")+''+tr("Status")+''+tr("#VMS")+''+tr("Target")+'
\ + \ +
\ +
\ + '+tr("Please select an image from the list")+'\ + \ + \ +
\ +
\ +
\ + \ + ×\ + \ +
'; var vmachine_list_json = {}; var dataTable_vMachines; @@ -157,7 +306,16 @@ var vm_actions = { "VM.create_dialog" : { type: "custom", - call: popUpCreateVMDialog + call: function(){ + popUpCreateVMDialog(false); + } + }, + + "VM.easy_provision" : { + type: "custom", + call: function(){ + popUpCreateVMDialog(true); + } }, "VM.list" : { @@ -692,6 +850,12 @@ var vm_buttons = { layout: "create", alwaysActive: true }, + "VM.easy_provision" : { + type: "action", + layout: "create", + text: tr("Launch"), + alwaysActive: true + }, "VM.chown" : { type: "confirm_with_select", text: tr("Change owner"), @@ -2732,28 +2896,123 @@ function setup_vm_snapshot_tab(){ // Sets up the create-template dialog and all the processing associated to it, // which is a lot. -function setupCreateVMDialog(){ +function setupCreateVMDialog(include_select_image){ dialogs_context.append('
'); //Insert HTML in place $create_vm_dialog = $('#create_vm_dialog') var dialog = $create_vm_dialog; dialog.html(create_vm_tmpl); + dialog.addClass("reveal-modal large max-height"); - //Prepare jquery dialog - //dialog.dialog({ - // autoOpen: false, - // modal: true, - // width: 400 - //}); - dialog.addClass("reveal-modal"); + var dataTable_template_templates = $('#template_templates_table', dialog).dataTable({ + "iDisplayLength": 4, + "bAutoWidth":false, + "sDom" : '<"H">t<"F"p>', + "aoColumnDefs": [ + { "sWidth": "35px", "aTargets": [0,1] }, + { "bVisible": false, "aTargets": [1,2,3,5]} + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#TEMPLATE_ID', dialog).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } + }); + + // Retrieve the images to fill the datatable + update_datatable_template_templates(dataTable_template_templates); + + $('#template_templates_table_search', dialog).keyup(function(){ + dataTable_template_templates.fnFilter( $(this).val() ); + }) + + $('#template_templates_table tbody', dialog).delegate("tr", "click", function(e){ + var aData = dataTable_template_templates.fnGetData(this); + + $("td.markrow", dataTable_template_templates).removeClass('markrow'); + $('tbody input.check_item', dataTable_template_templates).removeAttr('checked'); + + $('#template_selected', dialog).show(); + $('#select_template', dialog).hide(); + $('.alert-box', dialog).hide(); + + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + + $('#TEMPLATE_NAME', dialog).text(aData[4]); + $('#TEMPLATE_ID', dialog).val(aData[1]); + return true; + }); + + $("#refresh_template_templates_table_button_class").die(); + $("#refresh_template_templates_table_button_class").live('click', function(){ + update_datatable_template_templates($('#template_templates_table').dataTable()); + }); + + if (include_select_image) { + $("#select_image_step", dialog).show(); + var dataTable_template_images = $('#template_images_table', dialog).dataTable({ + "iDisplayLength": 4, + "bAutoWidth":false, + "sDom" : '<"H">t<"F"p>', + "aoColumnDefs": [ + { "sWidth": "35px", "aTargets": [0,1] }, + { "bVisible": false, "aTargets": [2,3,7,8,5,9,12]} + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#IMAGE_ID', dialog).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } + }); + + // Retrieve the images to fill the datatable + update_datatable_template_images(dataTable_template_images); + + $('#template_images_table_search', dialog).keyup(function(){ + dataTable_template_images.fnFilter( $(this).val() ); + }) + + $('#template_images_table tbody', dialog).delegate("tr", "click", function(e){ + var aData = dataTable_template_images.fnGetData(this); + + $("td.markrow", dataTable_template_images).removeClass('markrow'); + $('tbody input.check_item', dataTable_template_images).removeAttr('checked'); + + $('#image_selected', dialog).show(); + $('#select_image', dialog).hide(); + $('.alert-box', dialog).hide(); + + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + + $('#IMAGE_NAME', dialog).text(aData[4]); + $('#IMAGE_ID', dialog).val(aData[1]); + return true; + }); + + $("#refresh_template_images_table_button_class").die(); + $("#refresh_template_images_table_button_class").live('click', function(){ + update_datatable_template_images($('#template_images_table').dataTable()); + }); + } else { + $("#select_image_step", dialog).hide(); + } - //$('button',dialog).button(); setupTips(dialog); $('#create_vm_form',dialog).submit(function(){ var vm_name = $('#vm_name',this).val(); - var template_id = $('#template_id',this).val(); + var template_id = $('#TEMPLATE_ID',this).val(); var n_times = $('#vm_n_times',this).val(); var n_times_int=1; @@ -2766,29 +3025,40 @@ function setupCreateVMDialog(){ n_times_int=parseInt(n_times,10); }; - var extra_info = ""; + var extra_msg = ""; if (n_times_int > 1) { - extra_info = n_times_int+" times"; + extra_msg = n_times_int+" times"; } - notifySubmit("Template.instantiate",template_id, extra_info); + notifySubmit("Template.instantiate",template_id, extra_msg); + + var extra_info = {}; + if ($("#IMAGE_ID", this).val()) { + image_id = $("#IMAGE_ID", this).val(); + extra_info['template'] = { + 'disk': { + 'image_id': image_id + } + } + } if (!vm_name.length){ //empty name use OpenNebula core default for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate_quiet", template_id, ""); + extra_info['vm_name'] = ""; + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; } else { - if (vm_name.indexOf("%i") == -1){ //no wildcard + if (vm_name.indexOf("%i") == -1){//no wildcard, all with the same name for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate_quiet", template_id, vm_name); + extra_info['vm_name'] = vm_name; + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; } else { //wildcard present: replace wildcard - var name = ""; for (var i=0; i< n_times_int; i++){ - name = vm_name.replace(/%i/gi,i); - Sunstone.runAction("Template.instantiate_quiet", template_id, name); + extra_info['vm_name'] = vm_name.replace(/%i/gi,i); + Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info); }; }; } @@ -2802,7 +3072,8 @@ function setupCreateVMDialog(){ } // Open creation dialog -function popUpCreateVMDialog(){ +function popUpCreateVMDialog(include_select_image){ + setupCreateVMDialog(include_select_image); $create_vm_dialog.reveal(); } @@ -2970,41 +3241,43 @@ function vmMonitorError(req,error_json){ $(document).ready(function(){ var tab_name = 'vms-tab'; - dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check",6,7,9,11] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",6,7,9,11] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#vms_search').keyup(function(){ - dataTable_vMachines.fnFilter( $(this).val() ); - }) + $('#vms_search').keyup(function(){ + dataTable_vMachines.fnFilter( $(this).val() ); + }) - dataTable_vMachines.on('draw', function(){ - recountCheckboxes(dataTable_vMachines); - }) + dataTable_vMachines.on('draw', function(){ + recountCheckboxes(dataTable_vMachines); + }) - //addElement([ - // spinner, - // '','','','','','','','','','',''],dataTable_vMachines); - Sunstone.runAction("VM.list"); + //addElement([ + // spinner, + // '','','','','','','','','','',''],dataTable_vMachines); + Sunstone.runAction("VM.list"); - setupCreateVMDialog(); - setVMAutorefresh(); - setupVNC(); - hotpluggingOps(); - setup_vm_network_tab(); - setup_vm_capacity_tab(); - setup_vm_snapshot_tab(); + //setupCreateVMDialog(); + setVMAutorefresh(); + setupVNC(); + hotpluggingOps(); + setup_vm_network_tab(); + setup_vm_capacity_tab(); + setup_vm_snapshot_tab(); - initCheckAllBoxes(dataTable_vMachines); - tableCheckboxesListener(dataTable_vMachines); - infoListener(dataTable_vMachines,'VM.showinfo'); + initCheckAllBoxes(dataTable_vMachines); + tableCheckboxesListener(dataTable_vMachines); + infoListener(dataTable_vMachines,'VM.showinfo'); - $('div#vms_tab div.legend_div').hide(); + $('div#vms_tab div.legend_div').hide(); + } }) diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index e33a8a29f0..2c673bdbfd 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -1563,38 +1563,40 @@ function setVNetAutorefresh() { $(document).ready(function(){ var tab_name = 'vnets-tab'; - dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({ - "aoColumnDefs": [ - { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "35px", "aTargets": [0] }, - { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, - { "bVisible": false, "aTargets": ['_all']} - ] - }); + if (Config.isTabEnabled(tab_name)) { + dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, + { "bVisible": false, "aTargets": ['_all']} + ] + }); - $('#vnet_search').keyup(function(){ - dataTable_vNetworks.fnFilter( $(this).val() ); - }) + $('#vnet_search').keyup(function(){ + dataTable_vNetworks.fnFilter( $(this).val() ); + }) - dataTable_vNetworks.on('draw', function(){ - recountCheckboxes(dataTable_vNetworks); - }) + dataTable_vNetworks.on('draw', function(){ + recountCheckboxes(dataTable_vNetworks); + }) - Sunstone.runAction("Network.list"); + Sunstone.runAction("Network.list"); - setupCreateVNetDialog(); - setupLeasesOps(); - setVNetAutorefresh(); + setupCreateVNetDialog(); + setupLeasesOps(); + setVNetAutorefresh(); - initCheckAllBoxes(dataTable_vNetworks); - tableCheckboxesListener(dataTable_vNetworks); - infoListener(dataTable_vNetworks,'Network.showinfo'); + initCheckAllBoxes(dataTable_vNetworks); + tableCheckboxesListener(dataTable_vNetworks); + infoListener(dataTable_vNetworks,'Network.showinfo'); - // Reset list filter in case it was set because we were lookin - // at a single cluster view - $('div#menu li#li_vnets_tab').live('click',function(){ - dataTable_vNetworks.fnFilter('',5); - }); + // Reset list filter in case it was set because we were lookin + // at a single cluster view + $('div#menu li#li_vnets_tab').live('click',function(){ + dataTable_vNetworks.fnFilter('',5); + }); - $('div#vnets_tab div.legend_div').hide(); + $('div#vnets_tab div.legend_div').hide(); + } }); diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 127c7ae4ab..b2513403ea 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -64,10 +64,12 @@ var Sunstone = { //Adds a new main tab. Refreshes the dom if wanted. "addMainTab" : function(tab_id,tab_obj,refresh) { - SunstoneCfg["tabs"][tab_id] = tab_obj; - if (refresh){ - insertTab(tab_id); - //$(document).foundationCustomForms(); + if (Config.isTabEnabled(tab_id)) { + SunstoneCfg["tabs"][tab_id] = tab_obj; + if (refresh){ + insertTab(tab_id); + //$(document).foundationCustomForms(); + } } }, @@ -548,21 +550,16 @@ function insertTab(tab_name){ var li_item = '
  • '+tab_info.title+'
  • '; + $('div#menu ul#navigation').append(li_item); + //if this is a submenu... if (parent.length) { - var children = $('div#menu ul#navigation li.'+parent); + var children = $('div#menu ul#navigation #li_'+parent); //if there are other submenus, insert after last of them - if (children.length) - $(children[children.length-1]).after(li_item); - else //instert after parent menu - $('div#menu ul#navigation li#li_'+parent).after(li_item); - } else { //not a submenu, instert in the end - $('div#menu ul#navigation').append(li_item); - }; - - if (parent){ //this is a subtab - $('div#menu li#li_'+tab_name).hide();//hide by default - $('div#menu li#li_'+parent+' span').css("display","inline-block"); + if (children.length) { + $('div#menu li#li_'+tab_name).hide();//hide by default + $('div#menu li#li_'+parent+' span').css("display","inline-block"); + } }; if (showOnTop){ diff --git a/src/sunstone/public/sass/app.scss b/src/sunstone/public/sass/app.scss index 0cbf858bf0..dfcd5860e3 100644 --- a/src/sunstone/public/sass/app.scss +++ b/src/sunstone/public/sass/app.scss @@ -610,6 +610,7 @@ ul.button-group { .value_td { text-overflow:ellipsis; + word-break: break-all; } small { diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 8609adb2f3..7c04d305ee 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -64,7 +64,7 @@ - <%- view['enabled_tabs'].each do |tab_name| -%> + <%- $views_config.available_tabs.each do |tab_name| -%> <%- end -%> diff --git a/src/tm_mad/common/context b/src/tm_mad/common/context index ea82c9def7..b553aa7f10 100755 --- a/src/tm_mad/common/context +++ b/src/tm_mad/common/context @@ -93,7 +93,7 @@ for f in "${SRC[@]}"; do [ -n "$ERROR" ] && exit_error done -exec_and_set_error "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" \ +exec_and_set_error "$MKISOFS -o $ISO_FILE -V CONTEXT -J -R $ISO_DIR" \ "Error creating iso fs" [ -n "$ERROR" ] && exit_error