mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Conditionally load plugin section
If no UI plugins are loaded via plugins.js, then hide 'plugins' section, to avoid confusion due to a blank plugin page.
This commit is contained in:
parent
4a96a200b1
commit
b67e49d8ce
@ -19,18 +19,26 @@
|
||||
home: 'dashboard',
|
||||
|
||||
sectionPreFilter: function(args) {
|
||||
var sections = [];
|
||||
|
||||
if(isAdmin()) {
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "plugins"];
|
||||
sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects"];
|
||||
}
|
||||
else if(isDomainAdmin()) {
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"];
|
||||
sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"];
|
||||
}
|
||||
else if (g_userProjectsEnabled) {
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"];
|
||||
sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"];
|
||||
}
|
||||
else { //normal user
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"];
|
||||
sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"];
|
||||
}
|
||||
|
||||
if (cloudStack.plugins.length) {
|
||||
sections.push('plugins');
|
||||
}
|
||||
|
||||
return sections;
|
||||
},
|
||||
sections: {
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user