Skip to content

Commit 22c351f

Browse files
committed
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.
1 parent a065aab commit 22c351f

1 file changed

Lines changed: 32 additions & 6 deletions

File tree

ui/scripts/ui-custom/plugins.js

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,37 @@
3232
$plugin.click(function() {
3333
$browser.cloudBrowser('addPanel', {
3434
title: plugin.title,
35-
$parent: $('.panel:first')
35+
$parent: $('.panel:first'),
36+
complete: function($panel) {
37+
$panel.detailView({
38+
name: 'Plugin details',
39+
tabs: {
40+
details: {
41+
title: 'label.plugin.details',
42+
fields: [
43+
{
44+
name: { label: 'label.name' }
45+
},
46+
{
47+
desc: { label: 'label.description' },
48+
externalLink: {
49+
isExternalLink: true,
50+
label: 'label.external.link'
51+
}
52+
},
53+
{
54+
authorName: { label: 'label.author.name' },
55+
authorEmail: { label: 'label.author.email' },
56+
id: { label: 'label.id' }
57+
}
58+
],
59+
dataProvider: function(args) {
60+
args.response.success({ data: plugin });
61+
}
62+
}
63+
}
64+
});
65+
}
3666
});
3767
});
3868

@@ -52,11 +82,7 @@
5282
plugins: $(plugins).map(function(index, pluginID) {
5383
var plugin = cloudStack.plugins[pluginID].config;
5484

55-
return {
56-
id: pluginID,
57-
title: plugin.title,
58-
desc: plugin.desc
59-
};
85+
return $.extend(plugin, { id: pluginID });
6086
})
6187
});
6288
};

0 commit comments

Comments
 (0)