diff --git a/ui/plugins/testPlugin/testPlugin.js b/ui/plugins/testPlugin/testPlugin.js
index 453992442c2..abb4813b092 100644
--- a/ui/plugins/testPlugin/testPlugin.js
+++ b/ui/plugins/testPlugin/testPlugin.js
@@ -1,7 +1,14 @@
(function (cloudStack) {
cloudStack.plugins.testPlugin = function(plugin) {
- //
- // Plugin code goes here
- //
+ plugin.ui.addSection({
+ id: 'testPlugin',
+ title: 'TestPlugin',
+ preFilter: function(args) {
+ return isAdmin();
+ },
+ show: function() {
+ return $('
').html('Test plugin section');
+ }
+ });
};
}(cloudStack));
\ No newline at end of file
diff --git a/ui/scripts/plugins.js b/ui/scripts/plugins.js
index 250d507d9e1..5cc3185db07 100644
--- a/ui/scripts/plugins.js
+++ b/ui/scripts/plugins.js
@@ -1,4 +1,13 @@
(function($, cloudStack, require) {
+ var pluginAPI = {
+ addSection: function(section) {
+ cloudStack.sections[section.id] = section;
+ },
+ extend: function(obj) {
+ $.extend(true, cloudStack, obj);
+ }
+ };
+
cloudStack.sections.plugins = {
title: 'Plugins',
show: cloudStack.uiCustom.plugins
@@ -15,11 +24,7 @@
// Execute plugin
cloudStack.plugins[pluginID]({
- ui: {
- extend: function(obj) {
- $.extend(true, cloudStack, obj);
- }
- }
+ ui: pluginAPI
});
});
});