From 5996b813fe0bc1aefe0dc6d93f1dbdc78f38109e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 13 Mar 2014 18:11:43 +0100 Subject: [PATCH] Feature #2746: Add message to empty sched action table --- src/sunstone/public/js/plugins/vms-tab.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 544b1e82a9..610829067a 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -1853,7 +1853,15 @@ function printActionsTable(vm_info) // Returns an HTML string with the json keys and values function fromJSONtoActionsTable(actions_array){ var str = "" - if (!actions_array){ return "";} + var empty = '\ + \ + ' + tr("No actions to show") + '\ + '; + + if (!actions_array){ + return empty; + } + if (!$.isArray(actions_array)) { var tmp_array = new Array(); @@ -1861,6 +1869,10 @@ function fromJSONtoActionsTable(actions_array){ actions_array = tmp_array; } + if (!actions_array.length){ + return empty; + } + $.each(actions_array, function(index, scheduling_action){ str += fromJSONtoActionRow(scheduling_action); });