mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Actually fix masterPlugins visibility
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.
This commit is contained in:
1 parent
3f2bd2653e
commit
442472e412
3 files changed
+5
-5
No files matched your search
@@ -1012,7 +1012,7 @@ async function getPlugins(){
|
||||
}
|
||||
|
||||
|
||||
masterPlugins = await getPlugins();
|
||||
var masterPlugins = await getPlugins();
|
||||
|
||||
|
||||
io.attach(server);
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
<%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %>
|
||||
<%
|
||||
sidebarPluginButtonsHtml = "";
|
||||
for(let o in masterPlugins){
|
||||
let plug = masterPlugins[o];
|
||||
for(let o in locals.masterPlugins){
|
||||
let plug = locals.masterPlugins[o];
|
||||
if(plug.main
|
||||
&& plug.main.ui
|
||||
&& typeof plug.main.ui.sidebar == "object"
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@
|
||||
</ul>
|
||||
${findInArray("modName", "remoteMap", slave.mods).length ? "<a href='/remoteMap?instanceID="+id+"'>Remote map</a>" : ""}
|
||||
`
|
||||
for(let o in masterPlugins){
|
||||
let plug = masterPlugins[o];
|
||||
for(let o in locals.masterPlugins){
|
||||
let plug = locals.masterPlugins[o];
|
||||
if(plug.main
|
||||
&& plug.main.ui
|
||||
&& typeof plug.main.ui.slaveListing == "object"
|
||||
|
||||
Reference in new issue
Block a user