mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
The masterPlugins array should not be a global. The ejs templates already have it provided through locals.masterPlugins and plugins get it through onLoadFinish. Make masterPlugins local to master.js again and fix the ejs templates to use locals.masterPlugins.
37 lines
1.3 KiB
HTML
37 lines
1.3 KiB
HTML
<nav class="navbar nav-pills nav-fill">
|
|
<div class="nav-item col-3">
|
|
<a class="navbar-brand border-0" href="/">
|
|
<img src="/pictures/logo.png" width="50" height="50" class="d-inline-block align-middle " alt=""/>
|
|
<h3 class=" ml-3 nav-title">Clusterio</h3>
|
|
</a>
|
|
</div>
|
|
<div class="nav-item mr-1">
|
|
<a class="nav-link align-middle" href="/">Storage</a>
|
|
</div>
|
|
<div class="nav-item mr-1">
|
|
<a class="nav-link align-middle" href="/nodes">Slaves</a>
|
|
</div>
|
|
<%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %>
|
|
<%
|
|
sidebarPluginButtonsHtml = "";
|
|
for(let o in locals.masterPlugins){
|
|
let plug = locals.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;
|
|
for(let i in sidebarEntries){
|
|
let button = sidebarEntries[i];
|
|
if(button.getHtml && typeof button.getHtml == "function"){
|
|
sidebarPluginButtonsHtml += button.getHtml();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
%>
|
|
<%- sidebarPluginButtonsHtml %>
|
|
<div class="nav-item">
|
|
<a class="nav-link align-middle" href="/settings">Settings</a>
|
|
</div>
|
|
</nav> |