From 54d53f45b1bdbfefbba7cea77a1204ac08f89482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 16 Jan 2014 17:15:39 +0100 Subject: [PATCH] Feature #2632: Fix quotas in sunstone --- src/sunstone/public/js/opennebula.js | 57 ++++++++++++++++++-- src/sunstone/public/js/plugins/groups-tab.js | 7 ++- src/sunstone/public/js/plugins/users-tab.js | 8 ++- 3 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index c557f7084b..4f894f4ec3 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -227,7 +227,9 @@ var OpenNebula = { if (response[pool_name]) { pool = response[pool_name][type]; - } else { pull = null }; + } else { + pool = null; + } if (pool == null) { @@ -246,6 +248,49 @@ var OpenNebula = { { p_pool[0] = {}; p_pool[0][type] = pool; + return(p_pool); + } + }, + + "pool_hash_processing": function(pool_name, resource_name, response) + { + var pool; + + if (typeof(pool_name) == "undefined") + { + return Error('Incorrect Pool'); + } + + var p_pool = {}; + + if (response[pool_name]) { + pool = response[pool_name][resource_name]; + } else { + pool = null; + } + + if (pool == null) + { + return p_pool; + } + else if (pool.length) + { + for (i=0;i