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:
Hornwitser committed 2019-08-21 12:43:09 +02:00
1 parent 3f2bd2653e
commit 442472e412
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -1012,7 +1012,7 @@ async function getPlugins(){
}
masterPlugins = await getPlugins();
var masterPlugins = await getPlugins();
io.attach(server);
+2 -2
View File
@@ -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
View File
@@ -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"