From 1c482b5c3bc85e549b457070e5cd901bb181c3f9 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 23 Apr 2013 14:40:33 -0700 Subject: [PATCH] Infrastructure UI plugin API: Add 'resource' method Add new method 'infrastructure.resource' for retrieving resource objects from the infrastructure section. Specify the type as a string (i.e, 'pod' 'cluster' or 'host') and the entire resource object will be returned, including listView, actions, createForm, etc. Updating the data in this resource will automatically update the UI. --- ui/modules/infrastructure/infrastructure.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/modules/infrastructure/infrastructure.js b/ui/modules/infrastructure/infrastructure.js index 8292896f052..ad43108259b 100644 --- a/ui/modules/infrastructure/infrastructure.js +++ b/ui/modules/infrastructure/infrastructure.js @@ -40,7 +40,17 @@ state: state }); }); + }, + + resource: function(args) { + var type = args.type; + + if (type) { + return cloudStack.sections.system.subsections[type]; + } else { + return false; + } } }); }; -}(jQuery, cloudStack)); \ No newline at end of file +}(jQuery, cloudStack));