Serverside rendering of /slaves for more plugin functionality

This commit is contained in:
Daniel Vestøl committed 2018-08-10 15:51:41 +02:00
1 parent 8518cd54c6
commit da268d57e7
2 files changed
+50 -6

No files matched your search

+6 -4
View File
@@ -15,19 +15,21 @@
<%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %>
<%
sidebarPluginButtonsHtml = "";
masterPlugins.forEach(plug => {
for(let o in masterPlugins){
let plug = masterPlugins[o];
if(plug.main
&& plug.main.ui
&& typeof plug.main.ui.sidebar == "object"
&& Array.isArray(plug.main.ui.sidebar)){
let sidebarEntries = plug.main.ui.sidebar;
sidebarEntries.forEach(button => {
for(let i in sidebarEntries){
let button = sidebarEntries[i];
if(button.getHtml && typeof button.getHtml == "function"){
sidebarPluginButtonsHtml += button.getHtml();
}
});
}
}
});
}
%>
<%- sidebarPluginButtonsHtml %>
<a href="/settings"><div id="settings-menu" class="button-black menuItem">