mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8621: Allow UI plugins to be shown on navigation bar
Introduces a boolean option in UI plugins setting it to 'true' would display
the UI plugin on the left navigation bar.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This closes #563
(cherry picked from commit 7c206c30a5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
7eac6310bc
commit
4de4a0f3dd
|
|
@ -19,6 +19,7 @@
|
|||
plugin.ui.addSection({
|
||||
id: 'testPlugin',
|
||||
title: 'TestPlugin',
|
||||
showOnNavigation: true,
|
||||
preFilter: function(args) {
|
||||
return isAdmin();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -31,9 +31,12 @@
|
|||
sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "regions", "affinityGroups"];
|
||||
}
|
||||
|
||||
if (cloudStack.plugins.length) {
|
||||
sections.push('plugins');
|
||||
}
|
||||
$.each(cloudStack.plugins, function(idx, plugin) {
|
||||
if (cloudStack.sections.hasOwnProperty(plugin) && !cloudStack.sections[plugin].showOnNavigation) {
|
||||
sections.push('plugins');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return sections;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
if (args.isPlugin) {
|
||||
if (args.isPlugin && !args.showOnNavigation) {
|
||||
$li.hide();
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
return $(this).hasClass(sectionID);
|
||||
});
|
||||
var data = args.sections[sectionID];
|
||||
var isPlugin = data.isPlugin;
|
||||
var isPlugin = data.isPlugin && !data.showOnNavigation;
|
||||
|
||||
data.$browser = $browser;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue