Fixed resource paths, still not working

This commit is contained in:
Ziver Koc 2020-11-10 22:02:11 +01:00
parent ded778fd11
commit b405f0b191
155 changed files with 18 additions and 49905 deletions

View file

@ -18,6 +18,7 @@ import zutil.net.http.page.HttpRedirectPage;
import zutil.plugin.PluginData;
import zutil.plugin.PluginManager;
import java.io.File;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.Executors;
@ -50,6 +51,8 @@ public class HalServer {
HalContext.initialize();
DBConnection db = HalContext.getDB();
logger.info("Working directory: " + FileUtil.find(".").getAbsolutePath());
// ------------------------------------
// Init Plugins
// ------------------------------------
@ -118,8 +121,12 @@ public class HalServer {
HalWebPage.getRootNav().createSubNav("Events").setWeight(100);
HalWebPage.getRootNav().createSubNav("Settings").setWeight(200);
File webResourceRoot = FileUtil.find("hal-core/resource/resource/web/");
if (webResourceRoot == null)
webResourceRoot = FileUtil.find("resource/web/");
http = new HttpServer(HalContext.getIntegerProperty(HalContext.PROPERTY_HTTP_PORT));
http.setDefaultPage(new HttpFilePage(FileUtil.find("resource/web/")));
http.setDefaultPage(new HttpFilePage(webResourceRoot));
http.setPage("/", new HttpRedirectPage("/map"));
http.setPage(HalAlertManager.getInstance().getUrl(), HalAlertManager.getInstance());
for (Iterator<HalWebPage> it = pluginManager.getSingletonIterator(HalJsonPage.class); it.hasNext(); )