From 67a862499e35e45a2af7d1104a72b6826fea5376 Mon Sep 17 00:00:00 2001 From: Shirona1337 Date: Sat, 23 May 2026 05:06:44 +0800 Subject: [PATCH] refactor(webui): inline port literal and ship deobfuscated index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the runtime Port / Open Browser settings — the original Zen WebUI hard-codes :8089, and the in-game settings round-trip added no value. Replace the placeholder panel with the deobfuscated Tailwind-based Web Click GUI shipped by Zen. --- .../shit/zen/modules/impl/world/WebUI.java | 23 +- src/main/resources/webui/index.html | 898 +++++++++++++++++- 2 files changed, 906 insertions(+), 15 deletions(-) diff --git a/src/main/java/shit/zen/modules/impl/world/WebUI.java b/src/main/java/shit/zen/modules/impl/world/WebUI.java index c3ebcca..590e69e 100644 --- a/src/main/java/shit/zen/modules/impl/world/WebUI.java +++ b/src/main/java/shit/zen/modules/impl/world/WebUI.java @@ -19,30 +19,25 @@ import shit.zen.settings.impl.NumberSetting; import shit.zen.utils.misc.ChatUtil; public class WebUI extends Module { - private final NumberSetting port = new NumberSetting("Port", 8089, 1024, 65535, 1); - private final BooleanSetting openBrowser = new BooleanSetting("Open Browser", true); - private HttpServer httpServer; public WebUI() { super("WebUI", Category.WORLD); + setEnabled(false); } @Override public void onEnable() { try { this.httpServer = this.createHttpServer(); - ChatUtil.print("WebUI started at http://127.0.0.1:" + this.port.getValue().intValue()); - if (this.openBrowser.getValue() && mc.player != null) { - try { - System.setProperty("java.awt.headless", "false"); - if (Desktop.isDesktopSupported() - && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { - Desktop.getDesktop().browse(new URI("http://127.0.0.1:" + this.port.getValue().intValue())); - } - } catch (URISyntaxException | IOException ex) { - ChatUtil.print("Failed to open browser: " + ex.getMessage()); + ChatUtil.print("WebUI started at http://127.0.0.1:8089"); + try { + System.setProperty("java.awt.headless", "false"); + if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { + Desktop.getDesktop().browse(new URI("http://127.0.0.1:8089")); } + } catch (URISyntaxException | IOException ex) { + ChatUtil.print("Failed to open browser: " + ex.getMessage()); } } catch (IOException ioException) { ChatUtil.print("Failed to start http server because " + ioException.getMessage()); @@ -61,7 +56,7 @@ public class WebUI extends Module { } private HttpServer createHttpServer() throws IOException { - HttpServer server = HttpServer.create(new InetSocketAddress(this.port.getValue().intValue()), 0); + HttpServer server = HttpServer.create(new InetSocketAddress(8089), 0); server.createContext("/api/modulesList", new ModulesHandler()); server.createContext("/api/categoriesList", new CategoriesHandler()); server.createContext("/api/setStatus", new ToggleModuleHandler()); diff --git a/src/main/resources/webui/index.html b/src/main/resources/webui/index.html index 762f02a..2b6642d 100644 --- a/src/main/resources/webui/index.html +++ b/src/main/resources/webui/index.html @@ -1 +1,897 @@ -Zen WebPanel
Z
Zen
WEBPANEL
connecting

\ No newline at end of file + + + + + + + Zen WebPanel + + + + + + + + +
+
+
Z
+
+
Zen
+
WEBPANEL
+
+
+
+
+
connecting +
+
+ + +
+
+
+

+
+
+
+ +
+ + + +