From 4ce5d91d1c770862d1878bbe4ebc9b2118935308 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 13 May 2011 13:46:38 +0200 Subject: [PATCH] Feature #641: Add instantiate button to templates tab --- .../public/js/plugins/templates-tab.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 94ecbf3926..7f97573447 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -677,6 +677,21 @@ var template_actions = { elements: function() { return getSelectedNodes(dataTable_templates); }, error: onError, notify: true + }, + + "Template.instantiate" : { + type: "custom", + call: function(){ + nodes = getSelectedNodes(dataTable_templates); + $.each(nodes,function(){ + Sunstone.runAction("VM.create", + {vm : { + template_id: this + } + }); + }); + }, + notify: false } } @@ -693,6 +708,11 @@ var template_buttons = { text: "+ New", condition: True }, + "Template.instantiate" : { + type: "action", + text: "Instantiate", + condition: True + }, "Template.addattr_dialog" : { type: "action", text: "Add attribute",