From 29a7205888f317fab0fd243bd94922e9d0d027ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 20 Dec 2013 17:32:05 +0100 Subject: [PATCH] Feature #2565, #2570: Resource provider 10 is shown as ALL in CLI and Sunstone --- src/cli/one_helper/onegroup_helper.rb | 2 +- src/sunstone/public/js/plugins/groups-tab.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cli/one_helper/onegroup_helper.rb b/src/cli/one_helper/onegroup_helper.rb index 6d5fa07275..523c395401 100644 --- a/src/cli/one_helper/onegroup_helper.rb +++ b/src/cli/one_helper/onegroup_helper.rb @@ -217,7 +217,7 @@ class OneGroupHelper < OpenNebulaHelper::OneHelper end column :"CLUSTER", "", :right, :size=>7 do |d| - d['CLUSTER_ID'] + d['CLUSTER_ID'] == '10' ? 'ALL' : d['CLUSTER_ID'] end end.show([providers].flatten, {}) end diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index ad338c8279..a84b771dce 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -677,10 +677,11 @@ function fromJSONtoProvidersTable(providers_array){ } $.each(providers_array, function(index, provider){ + var cluster_id = (provider.CLUSTER_ID == "10") ? tr("All") : provider.CLUSTER_ID; str += '\ ' + provider.ZONE_ID + '\ - ' + provider.CLUSTER_ID + '\ + ' + cluster_id + '\ '; }); @@ -1073,7 +1074,11 @@ function setupCreateGroupDialog(){ var resource_selection = $("input[name='"+str_zone_tab_id+"']:checked").val(); switch (resource_selection){ case "all": - // TODO + // 10 is the special ID for ALL, see ClusterPool.h + group_json['group']['resource_providers'].push( + {"zone_id" : zone_id, "cluster_id" : 10} + ); + break; case "cluster": $.each(selected_group_clusters[zone_id], function(key, value) { @@ -1084,7 +1089,7 @@ function setupCreateGroupDialog(){ break; default: // "none" - // TODO + } });