From 6c032e15009aceda763599253bf1e7dce65bf62d Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 11 Apr 2013 18:42:45 +0200 Subject: [PATCH] feature #1820: Improve configurable views --- install.sh | 7 +- src/sunstone/etc/sunstone-views.yaml | 3 + src/sunstone/etc/sunstone-views/admin.yaml | 71 +++- src/sunstone/etc/sunstone-views/user.yaml | 376 ++++++++++++++++-- src/sunstone/public/js/opennebula.js | 25 -- src/sunstone/public/js/plugins/acls-tab.js | 4 +- .../public/js/plugins/clusters-tab.js | 4 +- src/sunstone/public/js/plugins/config-tab.js | 44 ++ .../public/js/plugins/dashboard-tab.js | 65 +-- .../public/js/plugins/datastores-tab.js | 3 +- src/sunstone/public/js/plugins/files-tab.js | 9 +- src/sunstone/public/js/plugins/groups-tab.js | 4 +- src/sunstone/public/js/plugins/hosts-tab.js | 6 +- src/sunstone/public/js/plugins/images-tab.js | 9 +- .../public/js/plugins/marketplace-tab.js | 4 +- .../public/js/plugins/templates-tab.js | 57 ++- src/sunstone/public/js/plugins/users-tab.js | 7 +- src/sunstone/public/js/plugins/vms-tab.js | 267 +++++++------ src/sunstone/public/js/plugins/vnets-tab.js | 72 ++-- src/sunstone/public/js/sunstone-util.js | 210 +++++----- src/sunstone/public/js/sunstone.js | 14 +- src/sunstone/views/index.haml | 2 +- 22 files changed, 865 insertions(+), 398 deletions(-) diff --git a/install.sh b/install.sh index 31713e58f2..13c1b7a7ab 100755 --- a/install.sh +++ b/install.sh @@ -502,7 +502,7 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_NEW_VENDOR_JDPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1 SUNSTONE_PUBLIC_NEW_VENDOR_JDPICKER_IMAGES:$SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1/images SUNSTONE_PUBLIC_NEW_VENDOR_TIMEPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/ - SUNSTONE_PUBLIC_NEW_VENDOR_DATETIMEPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/datetimepicker + SUNSTONE_PUBLIC_NEW_VENDOR_DATETIMEPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/datetimepicker SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images SUNSTONE_PUBLIC_LOCALE_CA:$SUNSTONE_LOCATION/public/locale/ca SUNSTONE_PUBLIC_LOCALE_CS_CZ:$SUNSTONE_LOCATION/public/locale/cs_CZ @@ -1365,7 +1365,8 @@ SUNSTONE_ETC_FILES="src/sunstone/etc/sunstone-server.conf \ src/sunstone/etc/sunstone-plugins.yaml\ src/sunstone/etc/sunstone-views.yaml" -SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml" +SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml \ + src/sunstone/etc/sunstone-views/user.yaml" SUNSTONE_MODELS_FILES="src/sunstone/models/OpenNebulaJSON.rb \ src/sunstone/models/SunstoneServer.rb \ @@ -1521,7 +1522,7 @@ SUNSTONE_PUBLIC_NEW_VENDOR_DATETIMEPICKER="\ src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.css \ src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.html \ src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.js \ - src/sunstone/public/vendor/4.0/datetimepicker/simple-dtpicker.jquery.json" + src/sunstone/public/vendor/4.0/datetimepicker/simple-dtpicker.jquery.json" SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/favicon.ico \ diff --git a/src/sunstone/etc/sunstone-views.yaml b/src/sunstone/etc/sunstone-views.yaml index 0be22f9d99..e3c6e97124 100644 --- a/src/sunstone/etc/sunstone-views.yaml +++ b/src/sunstone/etc/sunstone-views.yaml @@ -1,7 +1,10 @@ --- users: + pepe: + - user groups: oneadmin: - admin + - user default: - admin \ No newline at end of file diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index f20b64e71a..bb6397a384 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -1,19 +1,27 @@ tabs: dashboard-tab: enabled: true - tabs_panel: + panel_tabs: actions: + widgets_three_per_row: + - storage + - users + - network + widgets_two_per_row: + - hosts + - vms + widgets_one_per_row: dashboard-users-tab: - tabs_panel: + panel_tabs: enabled: false actions: system-tab: enabled: true - tabs_panel: + panel_tabs: actions: users-tab: enabled: true - tabs_panel: + panel_tabs: user_info_panel: true user_quotas_tab: true table_columns: @@ -36,7 +44,7 @@ tabs: User.delete: true groups-tab: enabled: true - tabs_panel: + panel_tabs: group_quotas_tab: true table_columns: - 0 # ID @@ -52,7 +60,7 @@ tabs: Group.delete: true acls-tab: enabled: true - tabs_panel: + panel_tabs: table_columns: - 0 # ID - 1 # Applies to @@ -66,11 +74,11 @@ tabs: Acl.delete: true vresources-tab: enabled: true - tabs_panel: + panel_tabs: actions: vms-tab: enabled: true - tabs_panel: + panel_tabs: vm_info_tab: true vm_capacity_tab: true vm_hotplugging_tab: true @@ -79,7 +87,7 @@ tabs: vm_placement_tab: true vm_actions_tab: true vm_template_tab: true - vm_log_tab: + vm_log_tab: true table_columns: - 0 # Checkbox - 1 # ID @@ -98,6 +106,7 @@ tabs: VM.create_dialog: true VM.chown: true VM.chgrp: true + VM.chmod: true VM.deploy: true VM.migrate: true VM.livemigrate: true @@ -117,9 +126,18 @@ tabs: VM.shutdown_hard: true VM.destroy: true VM.destroy_recreate: true + VM.resize: true + VM.attachdisk: true + VM.detachdisk: true + VM.saveas: true + VM.attachnic: true + VM.detachnic: true + VM.snapshot_create: true + VM.snapshot_revert: true + VM.snapshot_delete: true templates-tab: enabled: true - tabs_panel: + panel_tabs: template_info_tab: true template_template_tab: true table_columns: @@ -136,11 +154,20 @@ tabs: Template.instantiate_vms: true Template.chown: true Template.chgrp: true + Template.chmod: true Template.clone_dialog: true Template.delete: true + template_creation_tabs: + general: true + storage: true + network: true + os_booting: true + input_output: true + context: true + scheduling: true images-tab: enabled: true - tabs_panel: + panel_tabs: image_info_panel: true table_columns: - 0 # Checkbox @@ -161,6 +188,7 @@ tabs: Image.create_dialog: true Image.chown: true Image.chgrp: true + Image.chmod: true Image.enable: true Image.disable: true Image.persistent: true @@ -169,7 +197,7 @@ tabs: Image.delete: true files-tab: enabled: true - tabs_panel: + panel_tabs: file_info_panel: true table_columns: - 0 # Checkbox @@ -190,16 +218,17 @@ tabs: File.create_dialog: true File.chown: true File.chgrp: true + File.chmod: true File.enable: true File.disable: true File.delete: true infra-tab: enabled: true - tabs_panel: + panel_tabs: actions: clusters-tab: enabled: true - tabs_panel: + panel_tabs: cluster_info_tab: true cluster_host_tab: true cluster_vnet_tab: true @@ -218,7 +247,7 @@ tabs: Cluster.delete: true hosts-tab: enabled: true - tabs_panel: + panel_tabs: host_info_tab: true host_monitoring_tab: true table_columns: @@ -244,7 +273,7 @@ tabs: Host.delete: true datastores-tab: enabled: true - tabs_panel: + panel_tabs: datastore_info_tab: true datastore_image_tab: true table_columns: @@ -264,10 +293,11 @@ tabs: Datastore.addtocluster: true Datastore.chown: true Datastore.chgrp: true + Datastore.chmod: true Datastore.delete: true vnets-tab: enabled: true - tabs_panel: + panel_tabs: vnet_info_tab: true vnet_leases_tab: true table_columns: @@ -286,10 +316,15 @@ tabs: Network.addtocluster: true Network.chown: true Network.chgrp: true + Network.chmod: true Network.delete: true + Network.addleases: true + Network.hold_lease: true + Network.remove_lease: true + Network.release_lease: true marketplace-tab: enabled: true - tabs_panel: + panel_tabs: marketplace_info_tab: true table_columns: - 0 # Checkbox diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index 494da71747..f518119af1 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -1,35 +1,341 @@ -:tabs: - :plugins/dashboard-tab.js: - :enabled: false - :plugins/dashboard-users-tab.js: - :enabled: true - :plugins/system-tab.js: - :enabled: false - :plugins/users-tab.js: - :enabled: false - :plugins/groups-tab.js: - :enabled: false - :plugins/acls-tab.js: - :enabled: false - :plugins/vresources-tab.js: - :enabled: true - :plugins/vms-tab.js: - :enabled: true - :plugins/templates-tab.js: - :enabled: true - :plugins/images-tab.js: - :enabled: true - :plugins/files-tab.js: - :enabled: true - :plugins/infra-tab.js: - :enabled: false - :plugins/clusters-tab.js: - :enabled: false - :plugins/hosts-tab.js: - :enabled: false - :plugins/datastores-tab.js: - :enabled: false - :plugins/vnets-tab.js: - :enabled: false - :plugins/marketplace-tab.js: - :enabled: true +tabs: + dashboard-tab: + enabled: true + panel_tabs: + actions: + widgets_three_per_row: + #- users + widgets_two_per_row: + - network + - storage + #- hosts + #- vms + widgets_one_per_row: + - vms + dashboard-users-tab: + panel_tabs: + enabled: false + actions: + system-tab: + enabled: false + panel_tabs: + actions: + users-tab: + enabled: false + panel_tabs: + user_info_panel: true + user_quotas_tab: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Name + - 3 # Group + - 4 # Auth driver + - 5 # VMs + - 6 # Memory + - 7 # CPU + #- 8 # Group ID + actions: + User.refresh: true + User.create_dialog: true + User.update_password: true + User.quotas_dialog: true + User.chgrp: true + User.chauth: true + User.delete: true + groups-tab: + enabled: false + panel_tabs: + group_quotas_tab: true + table_columns: + - 0 # ID + - 1 # Name + - 2 # Users + - 3 # VMs + - 4 # Memory + - 5 # CPU + actions: + Group.refresh: true + Group.create_dialog: true + Group.quotas_dialog: true + Group.delete: true + acls-tab: + enabled: false + panel_tabs: + table_columns: + - 0 # ID + - 1 # Applies to + - 2 # Affected resources + - 3 # Resource ID / Owned by + - 4 # Allowed operations + #- 5 # ACL String + actions: + Acl.refresh: true + Acl.create_dialog: true + Acl.delete: true + vresources-tab: + enabled: true + panel_tabs: + actions: + vms-tab: + enabled: true + panel_tabs: + vm_info_tab: true + vm_capacity_tab: true + vm_hotplugging_tab: true + vm_network_tab: true + vm_snapshot_tab: true + vm_placement_tab: false + vm_actions_tab: true + vm_template_tab: false + vm_log_tab: false + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Owner + - 3 # Group + - 4 # Name + - 5 # Status + #- 6 # Used CPU + #- 7 # Used Memory + - 8 # Host + - 9 # IPs + #- 10 # Start Time + - 11 # VNC + actions: + VM.refresh: true + VM.create_dialog: true + VM.chown: false + VM.chgrp: false + VM.chmod: true + VM.deploy: false + VM.migrate: false + VM.migrate_live: false + VM.hold: true + VM.release: true + VM.suspend: true + VM.resume: true + VM.stop: true + VM.boot: true + VM.reboot: true + VM.reboot_hard: true + VM.poweroff: true + VM.poweroff_hard: true + VM.undeploy: true + VM.undeploy_hard: true + VM.shutdown: true + VM.shutdown_hard: true + VM.destroy: true + VM.destroy_recreate: true + VM.resize: true + VM.attachdisk: true + VM.detachdisk: true + VM.saveas: true + VM.attachnic: true + VM.detachnic: true + VM.snapshot_create: true + VM.snapshot_revert: true + VM.snapshot_delete: true + templates-tab: + enabled: true + panel_tabs: + template_info_tab: true + template_template_tab: true + table_columns: + - 0 # Checkbox + - 0 # ID + - 1 # Owner + - 2 # Group + - 3 # Name + - 4 # Registration time + actions: + Template.refresh: true + Template.create_dialog: true + Template.update_dialog: true + Template.instantiate_vms: true + Template.chown: false + Template.chgrp: false + Template.chmod: true + Template.clone_dialog: true + Template.delete: true + template_creation_tabs: + general: true + storage: true + network: true + os_booting: true + input_output: true + context: true + scheduling: false + images-tab: + enabled: true + panel_tabs: + image_info_panel: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Owner + - 3 # Group + - 4 # Name + - 5 # Datastore + #- 6 # Size + - 7 # Type + #- 8 # Registration time + #- 9 # Persistent + - 10 # Status + - 11 # #VMs + #- 12 # Target + actions: + Image.refresh: true + Image.create_dialog: true + Image.chown: false + Image.chgrp: false + Image.chmod: true + Image.enable: true + Image.disable: true + Image.persistent: true + Image.nonpersistent: true + Image.clone_dialog: true + Image.delete: true + files-tab: + enabled: true + panel_tabs: + file_info_panel: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Owner + - 3 # Group + - 4 # Name + - 5 # Datastore + #- 6 # Size + - 7 # Type + #- 8 # Registration time + #- 9 # Persistent + - 10 # Status + #- 11 # #VMs + #- 12 # Target + actions: + File.refresh: true + File.create_dialog: true + File.chown: false + File.chgrp: false + File.chmod: true + File.enable: true + File.disable: true + File.delete: true + infra-tab: + enabled: true + panel_tabs: + actions: + clusters-tab: + enabled: false + panel_tabs: + cluster_info_tab: true + cluster_host_tab: true + cluster_vnet_tab: true + cluster_datastore_tab: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Name + - 3 # Hosts + - 4 # VNets + - 5 # Datastores + actions: + Cluster.refresh: true + Cluster.create_dialog: true + Cluster.update_dialog: true + Cluster.delete: true + hosts-tab: + enabled: false + panel_tabs: + host_info_tab: true + host_monitoring_tab: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Name + - 3 # Cluster + - 4 # RVMs + #- 5 # Real CPU + - 6 # Allocated CPU + #- 7 # Real MEM + - 8 # Allocated MEM + - 9 # Status + #- 10 # IM MAD + #- 11 # VM MAD + #- 12 # Last monitored on + actions: + Host.refresh: true + Host.create_dialog: true + Host.addtocluster: true + Host.enable: true + Host.disable: true + Host.delete: true + datastores-tab: + enabled: true + panel_tabs: + datastore_info_tab: true + datastore_image_tab: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Owner + - 3 # Group + - 4 # Name + - 5 # Cluster + #- 6 # Basepath + #- 7 # TM + #- 8 # DS + #- 9 # System + actions: + Datastore.refresh: true + Datastore.create_dialog: false + Datastore.addtocluster: false + Datastore.chown: false + Datastore.chgrp: false + Datastore.chmod: true + Datastore.delete: false + vnets-tab: + enabled: true + panel_tabs: + vnet_info_tab: true + vnet_leases_tab: true + table_columns: + - 0 # Checkbox + - 1 # ID + - 2 # Owner + - 3 # Group + - 4 # Name + - 5 # Cluster + - 6 # Type + #- 7 # Bridge + - 8 # Leases + actions: + Network.refresh: true + Network.create_dialog: false + Network.addtocluster: false + Network.chown: false + Network.chgrp: false + Network.chmod: true + Network.delete: false + Network.addleases: false + Network.hold_lease: false + Network.remove_lease: false + Network.release_lease: false + marketplace-tab: + enabled: true + panel_tabs: + marketplace_info_tab: true + table_columns: + - 0 # Checkbox + #- 1 # ID + - 2 # Name + - 3 # Publisher + - 4 # Hypervisor + - 5 # Arch + - 6 # Format + #- 7 # Tags + actions: + Marketplace.refresh: true + Marketplace.import: true diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 9a6da37b2f..99410a0a57 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -489,31 +489,6 @@ var OpenNebula = { } }, - "Config": { - "resource": "CONFIG", - - "list": function(params) - { - var callback = params.success; - var callback_error = params.error; - - var resource = OpenNebula.Config.resource; - var request = OpenNebula.Helper.request(resource,"list"); - - $.ajax({ - url: "config", - type: "GET", - dataType: "json", - success: function(response){ - return callback ? callback(request, response) : null; - }, - error: function(response){ - return callback_error ? - callback_error(request, OpenNebula.Error(response)) : null; - } - }); - } - }, "Host": { "resource": "HOST", diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index f4548d50c3..eb314f7ead 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -611,12 +611,14 @@ 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"] }, { "sWidth": "35px", "aTargets": [0,1] }, - { "bVisible": true, "aTargets": config['view']['tabs']['acls-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index e2e6f8960e..5d565fec7e 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -1807,14 +1807,14 @@ function clusters_sel() { //Here we can basicly init the host datatable, preload it //and add specific listeners $(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,1] }, - { "bVisible": true, "aTargets": config['view']['tabs']['clusters-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 220da3f372..c9b13bef4d 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -14,6 +14,50 @@ /* limitations under the License. */ /* -------------------------------------------------------------------------- */ + +Config = { + "isTabEnabled": function(tab_name){ + var enabled = config['view']['tabs'][tab_name]['enabled']; + return enabled; + }, + "isTabActionEnabled": function(tab_name, action_name){ + var enabled = config['view']['tabs'][tab_name]['actions'][action_name]; + return enabled; + }, + + "isTabPanelEnabled": function(tab_name, panel_tab_name){ + var enabled = config['view']['tabs'][tab_name]['panel_tabs'][panel_tab_name]; + return enabled; + }, + + "tabTableColumns": function(tab_name){ + var columns = config['view']['tabs'][tab_name]['table_columns']; + + if (columns) { + return columns; + } + else { + return []; + } + }, + + "isTemplateCreationTabEnabled": function(template_tab_name){ + var enabled = config['view']['tabs']['templates-tab']['template_creation_tabs'][template_tab_name]; + return enabled; + }, + + "dashboardWidgets": function(per_row){ + var widgets = config['view']['tabs']['dashboard-tab'][per_row]; + + if (widgets) { + return widgets; + } + else { + return []; + } + } +} + var config_response = {}; var config_tab_content = '
\ diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 20f108a608..5ee76d19a7 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -33,9 +33,17 @@ var dashboard_tab_content = '\
\ \
\ -
\ -
\ -
\ +
\ +
\ +
\ +
\ +
\ +
\ +
\ +'; + +var widgets = { + "storage" : '
\
\
'+tr("Storage")+'
\
\ @@ -49,10 +57,8 @@ var dashboard_tab_content = '\ \
\
\ -
\ - \ -
\ -
\ +
', + "users" : '
\
\
'+tr("Users")+'
\
\ @@ -66,10 +72,8 @@ var dashboard_tab_content = '\ \
\
\ - \ - \ -
\ -
\ +
', + "network" : '
\
\
'+tr("Network")+'
\
\ @@ -83,13 +87,8 @@ var dashboard_tab_content = '\ \
\
\ - \ - \ - \ -
\ -
\ -
\ -
\ +
', + "hosts" : '
\
\
'+tr("Hosts")+'
\
\ @@ -126,10 +125,8 @@ var dashboard_tab_content = '\ '+tr("Real")+' \ '+tr("Total")+'\
\ -
\ -
\ -
\ -
\ +
', + "vms" : '
\
\
'+tr("Virtual Machines")+'
\
\ @@ -165,11 +162,8 @@ var dashboard_tab_content = '\
\
\
\ -
\ - \ - \ -\ -'; + ' +} var dashboard_tab = { title: ''+tr("Dashboard"), @@ -186,5 +180,20 @@ var $dashboard; function dashboardQuotasHTML(){} $(document).ready(function(){ - $dashboard = $('#dashboard-tab', main_tabs_context); + $dashboard = $('#dashboard-tab', main_tabs_context); + + $.each(Config.dashboardWidgets('widgets_three_per_row'), function(id, widget){ + var html = '
'+widgets[widget]+'
'; + $('#three_per_row', $dashboard).append(html); + }) + + $.each(Config.dashboardWidgets('widgets_two_per_row'), function(id, widget){ + var html = '
'+widgets[widget]+'
'; + $('#two_per_row', $dashboard).append(html); + }) + + $.each(Config.dashboardWidgets('widgets_one_per_row'), function(id, widget){ + var html = '
'+widgets[widget]+'
'; + $('#one_per_row', $dashboard).append(html); + }) }); diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 4c34c8c858..556eb3e33b 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -682,7 +682,8 @@ function updateDatastoreInfo(request,ds){ "Configuration Attributes") + '\
' - + insert_permissions_table("Datastore", + + insert_permissions_table('datastores-tab', + "Datastore", info.ID, info.UNAME, info.GNAME, diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 6552528ce3..baf5bba488 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -554,7 +554,8 @@ function updateFileInfo(request,img){ \
\
' - + insert_permissions_table("File", + + insert_permissions_table('files-tab', + "File", img_info.ID, img_info.UNAME, img_info.GNAME, @@ -905,18 +906,16 @@ function is_persistent_file(id){ //The DOM is ready at this point $(document).ready(function(){ + var tab_name = 'files-tab'; dataTable_files = $("#datatable_files",main_tabs_context).dataTable({ - "oColVis": { - "aiExclude": [ 0 ] - }, "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0,2,3,9,10] }, { "sWidth": "35px", "aTargets": [1,6,11,12] }, { "sWidth": "100px", "aTargets": [5,7] }, { "sWidth": "150px", "aTargets": [8] }, - { "bVisible": true, "aTargets": config['view']['tabs']['files-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index d62aba7b43..3c056a99e7 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -794,11 +794,13 @@ function setGroupAutorefresh(){ } $(document).ready(function(){ + var tab_name = 'groups-tab'; + dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "35px", "aTargets": [0,1] }, - { "bVisible": true, "aTargets": config['view']['tabs']['groups-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index d50a903f0b..9bd65d75cd 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -1034,16 +1034,14 @@ function hostMonitorError(req,error_json){ //Here we can basicly init the host datatable, preload it //and add specific listeners $(document).ready(function(){ + var tab_name = 'hosts-tab'; //prepare host datatable dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({ - "oColVis": { //exclude checkbox column - "aiExclude": [ 0 ] - }, "aoColumnDefs": [ //{ "bSortable": false, "aTargets": ["check"] }, { "sWidth": "35px", "aTargets": [0,1,4,9] }, //check, ID, RVMS, Status, - { "bVisible": true, "aTargets": config['view']['tabs']['hosts-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index e1eb57ac32..d113839198 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -716,7 +716,8 @@ function updateImageInfo(request,img){ \
\
' - + insert_permissions_table("Image", + + insert_permissions_table('images-tab', + "Image", img_info.ID, img_info.UNAME, img_info.GNAME, @@ -1251,18 +1252,16 @@ function popUpImageCloneDialog(){ //The DOM is ready at this point $(document).ready(function(){ + var tab_name = 'images-tab'; dataTable_images = $("#datatable_images",main_tabs_context).dataTable({ - "oColVis": { - "aiExclude": [ 0 ] - }, "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0,2,3,9,10] }, { "sWidth": "35px", "aTargets": [1,6,11,12] }, { "sWidth": "100px", "aTargets": [5,7] }, { "sWidth": "150px", "aTargets": [8] }, - { "bVisible": true, "aTargets": config['view']['tabs']['images-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index 5d81f6d205..76f8ef2ae7 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -283,6 +283,8 @@ function onlyOneCheckboxListener(dataTable) { */ $(document).ready(function(){ + var tab_name = 'marketplace-tab'; + dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({ "bSortClasses": true, "aoColumns": [ @@ -305,7 +307,7 @@ $(document).ready(function(){ { "mDataProp": "tags"} ], "aoColumnDefs": [ - { "bVisible": true, "aTargets": config['view']['tabs']['marketplace-tab']['table_columns']}, + { "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)}, { "bVisible": false, "aTargets": ['_all']} ] }); diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 5bf135417f..677e3c5f62 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -1370,7 +1370,8 @@ function updateTemplateInfo(request,template){ \ \
\ -
' + insert_permissions_table("Template", +
' + insert_permissions_table('templates-tab', + "Template", template_info.ID, template_info.UNAME, template_info.GNAME, @@ -2250,7 +2251,7 @@ function setupCreateTemplateDialog(){ '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ ''+ ''+ @@ -2332,7 +2333,7 @@ function setupCreateTemplateDialog(){ '
'+ '
'+ ''+tr("SSH")+''+ - '
'+ + '
'+ '
'+ ''+ '
'+ @@ -2343,20 +2344,22 @@ function setupCreateTemplateDialog(){ '
'+tr("Add an ssh public key to the context. If the Public Key textarea is empty then the user variable SSH_PUBLIC_KEY will be used.")+'
'+ '
'+ '
'+ - '
'+ - '
'+ + '
'+ + '
'+ ''+ '
'+ '
'+ - '
'+ + '
'+ + '
'+ '