From fd4f8c87e07c92e81609614b0c0b7ba8b343c790 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 26 Mar 2012 12:49:25 +0200 Subject: [PATCH] Sunstone: Fixes related to clusters Adapt dashboards for cluster none. Do not show cluster info in infraestructure dashboard for non oneadmin users. --- .../public/js/plugins/clusters-tab.js | 75 +++++++++++++++++++ src/sunstone/public/js/plugins/infra-tab.js | 11 +-- 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index 3de0de0bfe..676507df49 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -366,7 +366,82 @@ function clusterTabContent(cluster_json) { vnets_list = '
  • '+cluster.VNETS.ID+' - '+getVNetName(cluster.VNETS.ID)+'
  • '; */ + //special case for cluster none, simplified dashboard + if (cluster.ID == "-"){ + var html_code = '\ +\ +\ +\ +\ +
    \ +\ + \ + \ + \ + \ + \ + \ +
    \ +
    \ +

    ' + tr("Cluster information") + '

    \ +
    \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
    ' + tr("ID") + ''+cluster.ID+'
    ' + tr("Name") + ''+cluster.NAME+'
    \ +\ +
    \ +
    \ +
    \ +
    \ +

    ' + tr("Hosts") + '

    \ + \ +
    \ +
    \ +\ + \ + \ + \ + \ + \ + \ +
    \ +
    \ +

    ' + tr("Datastores") + '

    \ + \ +
    \ +
    \ +
    \ +

    ' + tr("Virtual Networks") + '

    \ + \ +
    \ +
    \ +
    \ +'; + return html_code; + }; + //end cluster none special html var html_code = '\ \ diff --git a/src/sunstone/public/js/plugins/infra-tab.js b/src/sunstone/public/js/plugins/infra-tab.js index 49e3782ed7..0b52418572 100644 --- a/src/sunstone/public/js/plugins/infra-tab.js +++ b/src/sunstone/public/js/plugins/infra-tab.js @@ -15,7 +15,7 @@ /* -------------------------------------------------------------------------- */ var infra_tab_content = -'
    \ +'
    \ \
    \ \ @@ -26,7 +26,7 @@ var infra_tab_content =
    \ \
    \ - \ + \ \ \ \ @@ -54,7 +54,7 @@ var infra_tab_content =

    ' + tr("Quickstart") + '

    \
    \


    \ - '+tr("Create new Cluster")+'
    \ + '+tr("Create new Cluster")+'
    \ '+tr("Create new Host")+'
    \ '+tr("Create new Datastore")+'
    \ '+tr("Create new Virtual Network")+'
    \ @@ -72,7 +72,7 @@ var infra_tab_content =

    \

    ' + tr("Infrastructure resources") + '

    \
    \ -

    '+tr("The Infrastructure menu allows management of Hosts, Datastores, Virtual Networks and the Clusters they are placed in. The Clusters node can be expanded, and resources can be managed for each cluster.")+'

    \ +

    '+tr("The Infrastructure menu allows management of Hosts, Datastores, Virtual Networks. Users in the oneadmin group can manage clusters as well.")+'

    \

    '+tr("You can find further information on the following links:")+'

    \
      \
    • Host subsystem
    • \ @@ -117,5 +117,6 @@ function updateInfraDashboard(what,json_info){ }; $(document).ready(function(){ - + if (!mustBeAdmin()) + $('table#infra_dashboard .cluster_related', main_tabs_context).hide(); }); \ No newline at end of file