UI plugins: Implement plugin detail page Renders all metadata from plugin's config.js onto a detail page, on click of the plugin row under the 'Plugins' main section.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/22c351fa Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/22c351fa Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/22c351fa Branch: refs/heads/master Commit: 22c351fabc5c52ad5b55e1d67d906073d5a09716 Parents: a065aab Author: Brian Federle <[email protected]> Authored: Tue Jan 29 14:35:30 2013 -0800 Committer: Brian Federle <[email protected]> Committed: Tue Jan 29 14:35:30 2013 -0800 ---------------------------------------------------------------------- ui/scripts/ui-custom/plugins.js | 38 ++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/22c351fa/ui/scripts/ui-custom/plugins.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/plugins.js b/ui/scripts/ui-custom/plugins.js index cee2605..ba61f74 100644 --- a/ui/scripts/ui-custom/plugins.js +++ b/ui/scripts/ui-custom/plugins.js @@ -32,7 +32,37 @@ $plugin.click(function() { $browser.cloudBrowser('addPanel', { title: plugin.title, - $parent: $('.panel:first') + $parent: $('.panel:first'), + complete: function($panel) { + $panel.detailView({ + name: 'Plugin details', + tabs: { + details: { + title: 'label.plugin.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + desc: { label: 'label.description' }, + externalLink: { + isExternalLink: true, + label: 'label.external.link' + } + }, + { + authorName: { label: 'label.author.name' }, + authorEmail: { label: 'label.author.email' }, + id: { label: 'label.id' } + } + ], + dataProvider: function(args) { + args.response.success({ data: plugin }); + } + } + } + }); + } }); }); @@ -52,11 +82,7 @@ plugins: $(plugins).map(function(index, pluginID) { var plugin = cloudStack.plugins[pluginID].config; - return { - id: pluginID, - title: plugin.title, - desc: plugin.desc - }; + return $.extend(plugin, { id: pluginID }); }) }); };
