### Initialize OPanel Core Plugin in Java Source: https://context7.com/opanel-mc/opanel/llms.txt Initializes the OPanel core plugin within a platform-specific plugin (e.g., Bukkit/Spigot). It creates and sets up the ConfigManager, Logger, OPanelServer, and LogListenerManager implementations. The web server is then started, and any exceptions during startup are caught and logged. ```java ``` -------------------------------- ### Implement Platform Server Interface in Java Source: https://context7.com/opanel-mc/opanel/llms.txt Implements the OPanelServer interface for a specific platform (e.g., Spigot). It provides platform-specific implementations for retrieving server MOTD, setting server MOTD, getting lists of players, sending server commands, and getting gamerules. Depends on the OPanelServer interface and platform-specific APIs (e.g., Spigot API). ```java // Implement OPanelServer interface for your platform import net.opanel.common.OPanelServer; import net.opanel.ServerType; public class SpigotServerImpl implements OPanelServer { private final JavaPlugin plugin; private final Server mcServer; public SpigotServerImpl(JavaPlugin plugin) { this.plugin = plugin; this.mcServer = plugin.getServer(); } @Override public ServerType getServerType() { return ServerType.BUKKIT; } @Override public String getMotd() { return mcServer.getMotd(); } @Override public void setMotd(String motd) throws IOException { // Read server.properties String content = OPanelServer.getPropertiesContent(); // Replace motd line content = content.replaceAll("motd=.*", "motd=" + motd); // Write back OPanelServer.writePropertiesContent(content); } @Override public List getPlayers() { List players = new ArrayList<>(); // Add online players for (Player p : mcServer.getOnlinePlayers()) { players.add(new SpigotPlayer(p)); } // Add offline players for (OfflinePlayer op : mcServer.getOfflinePlayers()) { if (!op.isOnline()) { players.add(new SpigotOfflinePlayer(op, mcServer)); } } return players; } @Override public void sendServerCommand(String command) { mcServer.dispatchCommand(mcServer.getConsoleSender(), command); } @Override public HashMap getGamerules() { HashMap rules = new HashMap<>(); World world = mcServer.getWorlds().get(0); for (GameRule rule : GameRule.values()) { rules.put(rule.getName(), world.getGameRuleValue(rule)); } return rules; } } ``` -------------------------------- ### Monitor System Resources with Opanel API Source: https://context7.com/opanel-mc/opanel/llms.txt Endpoints for retrieving real-time system monitoring data such as CPU usage, memory consumption, and server TPS. Requires a JWT token for authentication. Includes an example for continuous monitoring using a bash loop and `jq`. ```bash # Get system monitoring data curl -X GET http://localhost:8080/api/monitor \ -H "X-Credential-Token: " # Monitor continuously with polling while true; do curl -s -X GET http://localhost:8080/api/monitor \ -H "X-Credential-Token: " | jq '.' sleep 5 done ``` -------------------------------- ### Next.js Page Rendering Setup Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/login/index.html This snippet seems to be a part of Next.js's internal rendering mechanism. It defines the structure and components used to render a page, including layout components, metadata, and styling. It uses internal Next.js modules and data structures. It's highly dependent on the Next.js framework and its internal APIs. ```javascript (self.__next_f=self.__next_f||[]).push([0])self.__next_f.push([1,"1:\"$Sreact.fragment\\"\n2:I[99304,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\\"],\"ThemeProvider\\"]\n3:I[15851,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\\"],\"Toaster\\"]\n4:I[87555,[],\"\\"]\n5:I[31295,[],\"\\"]\n6:I[90894,[],\"ClientPageRoot\\"]\n7:I[78007,[\"8511\",\"static/chunks/8511-d676122a8278dae5.js\",\"5702\",\"static/chunks/5702-832d191575f82391.js\",\"5452\",\"static/chunks/5452-f0332fb38cc50f6e.js\",\"9641\",\"static/chunks/9641-55796bcb730cb70a.js\",\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"3464\",\"static/chunks/3464-75e09c1af1fe4e18.js\",\"371\",\"static/chunks/371-09937566f36e8069.js\",\"6874\",\"static/chunks/6874-414075bb21e16c80.js\",\"790\",\"static/chunks/790-56740160f8591258.js\",\"3723\",\"static/chunks/3723-0effe4ffa33ea01f.js\",\"4520\",\"static/chunks/app/login/page-7259e1b7bc0709c2.js\\"],\"default\\"]\na:I[59665,[],\"OutletBoundary\\"]\nc:I[74911,[],\"AsyncMetadataOutlet\\"]\ne:I[59665,[],\"ViewportBoundary\\"]\n10:I[59665,[],\"MetadataBoundary\\"]\n11:\"$Sreact.suspense\\"\n13:I[28393,[],\"\\"]\n:HL[\"/_next/static/css/1d4f4ee9de467097.css\",\"style\\"]\n:HL[\"/_next/static/css/a1a630053fbadb94.css\",\"style\\"]\n:HL[\"/_next/static/css/41b25e3cec3514f2.css\",\"style\\"]\n"]) ``` ```javascript self.__next_f.push([1,"0:{\"P\":null,\"b\":\"sb2dTljg3MewNOeHRiF_J\",\"p\":\"\",\"c\":[\"\",\"login\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1d4f4ee9de467097.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a1a630053fbadb94.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/41b25e3cec3514f2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],[[\"$\",\"html\",null,{\"lang\":\"zh-cn\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"__className_d4cf3b antialiased\",\"children\":[\"$\",\"$L2\",null,{\"attribute\":\"class\",\"defaultTheme\":\"system\",\"enableSystem\":true,\"disableTransitionOnChange\":true,\"children\":[[\"$\",\"$L3\",null,{\"position\":\"bottom-right\",\"expand\":true,\"richColors\":true}],[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}\}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"f"]) ``` -------------------------------- ### Opanel-MC Root HTML Structure Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/panel/players/index.html This snippet defines the basic HTML structure for the Opanel-MC application, including meta tags for character set and viewport configuration. It's a foundational part of the application's frontend setup. ```HTML
``` -------------------------------- ### Get Server Information Source: https://context7.com/opanel-mc/opanel/llms.txt Retrieves comprehensive server status, including MOTD, version, player count, uptime, TPS, and ingame time. Requires a JWT token for authentication. The MOTD is returned in a Base64 encoded format. ```bash # Get server information curl -X GET http://localhost:8080/api/info/ \ -H "X-Credential-Token: " # Response structure # { # "favicon": "/api/icon", # "motd": "QSBNaW5lY3JhZnQgU2VydmVy", # Base64 encoded # "version": "1.21", # "port": 25565, # "maxPlayerCount": 20, # "whitelist": false, # "uptime": 3600000, # "ingameTime": { # "current": 6000, # "doDaylightCycle": true, # "paused": false, # "mspt": 45.2 # }, # "onlinePlayers": [ # { # "name": "Player1", # "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5", # "gamemode": "survival", # "ping": 23 # } # ] # } ``` -------------------------------- ### Authenticate and Get JWT Token Source: https://context7.com/opanel-mc/opanel/llms.txt This API endpoint handles user authentication using MD5-hashed access keys. It returns a JWT token upon successful authentication, which is then used for authorizing subsequent API requests. ```bash # Authenticate with access key (MD5 hashed once on client) curl -X POST http://localhost:8080/api/auth \ -H "Content-Type: application/json" \ -d '{"accessKey": "5d41402abc4b2a76b9719d911017c592"}' # Response with JWT token # { # "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # } ``` -------------------------------- ### Manage Minecraft World Saves with API Source: https://context7.com/opanel-mc/opanel/llms.txt Endpoints for listing, downloading, uploading, editing properties, and deleting world saves. Utilizes HTTP methods GET, POST, and DELETE, requiring a JWT token and specific world names for operations. Uploads expect a ZIP file. ```bash # List all world saves curl -X GET http://localhost:8080/api/saves/ \ -H "X-Credential-Token: " # Download world save as ZIP curl -X GET http://localhost:8080/api/saves/world \ -H "X-Credential-Token: " \ --output world.zip # Upload new world save (ZIP file) curl -X POST http://localhost:8080/api/saves/ \ -H "X-Credential-Token: " \ -F "file=@newworld.zip" # Edit world save properties curl -X POST http://localhost:8080/api/saves/world \ -H "X-Credential-Token: " \ -H "Content-Type: application/json" \ -d '{ "displayName": "TXkgQXdlc29tZSBXb3JsZA==", "defaultGameMode": "creative" }' # Delete world save curl -X DELETE http://localhost:8080/api/saves/oldworld \ -H "X-Credential-Token: " ``` -------------------------------- ### Untitled No description -------------------------------- ### Get Player List Source: https://context7.com/opanel-mc/opanel/llms.txt Retrieves a list of all players on the server, including their status, gamemode, and ban information. Requires a JWT token for authentication. The response includes whitelist status and max player count. ```bash # Get all players with detailed information curl -X GET http://localhost:8080/api/players/ \ -H "X-Credential-Token: " # Response # { # "maxPlayerCount": 20, # "whitelist": true, # "players": [ # { # "name": "Steve", # "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5", # "isOnline": true, # "isOp": false, # "isBanned": false, # "gamemode": "survival", # "banReason": null, # "isWhitelisted": true # } # ] # } ``` -------------------------------- ### Opanel-MC Metadata Configuration Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/panel/players/index.html This snippet shows the metadata configuration for the Opanel-MC application, including description, author, and icon links. This is crucial for SEO and application identity. ```HTML ``` -------------------------------- ### Untitled No description -------------------------------- ### Next.js Client-Side Routing and Component Initialization Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/panel/terminal/index.html This snippet represents Next.js's internal handling of client-side routing and component loading. It defines dependencies and structure for various application components, including layout, pages, and UI elements like ThemeProvider and Toaster. This is part of the Next.js App Router's hydration and rendering process. ```javascript self.__next_f=self.__next_f||[];self.__next_f.push([0])self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[99304,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\"],\"ThemeProvider\"]\n3:I[15851,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\"],\"Toaster\"]\n4:I[87555,[],\"\"]\n5:I[31295,[],\"\"]\n6:I[94970,[],\"ClientSegmentRoot\"]\n7:I[19538,[\"8511\",\"static/chunks/8511-d676122a8278dae5.js\",\"5702\",\"static/chunks/5702-832d191575f82391.js\",\"5452\",\"static/chunks/5452-f0332fb38cc50f6e.js\",\"3207\",\"static/chunks/3207-16c76f5e3dd1df18.js\",\"6874\",\"static/chunks/6874-414075bb21e16c80.js\",\"790\",\"static/chunks/790-56740160f8591258.js\",\"193\",\"static/chunks/193-67b2101e7453b1fd.js\",\"5060\",\"static/chunks/app/panel/layout-cd977d54eaa36ab5.js\"],\"default\"]\n9:I[90894,[],\"ClientPageRoot\"]\na:I[15424,[\"8511\",\"static/chunks/8511-d676122a8278dae5.js\",\"5702\",\"static/chunks/5702-832d191575f82391.js\",\"5452\",\"static/chunks/5452-f0332fb38cc50f6e.js\",\"9641\",\"static/chunks/9641-55796bcb730cb70a.js\",\"3207\",\"static/chunks/3207-16c76f5e3dd1df18.js\",\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"3464\",\"static/chunks/3464-75e09c1af1fe4e18.js\",\"5299\",\"static/chunks/5299-6f98b6c41b1f92be.js\",\"6438\",\"static/chunks/6438-8255a537d15d0020.js\",\"193\",\"static/chunks/193-67b2101e7453b1fd.js\",\"2908\",\"static/chunks/app/panel/terminal/page-70bdf4b81e6322f5.js\"],\"default\"]\nd:I[59665,[],\"OutletBoundary\"]\nf:I[74911,[],\"AsyncMetadataOutlet\"]\n11:I[59665,[],\"ViewportBoundary\"]\n13:I[59665,[],\"MetadataBoundary\"]\n14:\"$Sreact.suspense\"\n16:I[28393,[],\"\"]\n:HL[\"/_next/static/css/1d4f4ee9de467097.css\",\"style\"]\n:HL[\"/_next/static/css/a1a630053fbadb94.css\",\"style\"]\n:HL[\"/_next/static/css/41b25e3cec3514f2.css\",\"style\"]\n ``` ```javascript self.__next_f.push([1,"0:{\"P\":null,\"b\":\"sb2dTljg3MewNOeHRiF_J\",\"p\":\"\",\"c\":[\"\",\"panel\",\"terminal\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"panel\",{\"children\":[\"terminal\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1d4f4ee9de467097.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a1a630053fbadb94.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/41b25e3cec3514f2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],[\"$\",\"html\",null,{\"lang\":\"zh-cn\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"__className_d4cf3b antialiased\",\"children\":[\"$\",\"$L2\",null,{\"attribute\":\"class\",\"defaultTheme\":\"system\",\"enableSystem\":true,\"disableTransitionOnChange\":true,\"children\":[[[\"$\",\"$L3\",null,{\"position\":\"bottom-right\",\"expand\":true,\"richColors\":true}],[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[[\"$\",\"$L5\",null,{}],\"$undefined\",\"$undefined\"],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\ ``` -------------------------------- ### Next.js App Initialization Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/panel/plugins/index.html This snippet appears to be part of the Next.js framework, specifically related to application initialization and page rendering. It seems to define components and their dependencies for a specific route or page, setting up the UI elements and structure. ```javascript (self.__next_f=self.__next_f||[]).push([0])self.__next_f.push([1,"1:\"$Sreact.fragment\\"\n2:I[99304,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\"],\"ThemeProvider\"]\n3:I[15851,[\"6671\",\"static/chunks/6671-d2f1904d7063f4e4.js\",\"7177\",\"static/chunks/app/layout-41f51c2331716b22.js\"],\"Toaster\"]\n4:I[87555,[],\"\"]\n5:I[31295,[],\"\"]\n6:I[94970,[],\"ClientSegmentRoot\"]\n7:I[19538,[\"8511\",\"static/chunks/8511-d676122a8278dae5.js\",\"5702\",\"static/chunks/5702-832d191575f82391.js\",\"5452\",\"static/chunks/5452-f0332fb38cc50f6e.js\",\"3207\",\"static/chunks/3207-16c76f5e3dd1df18.js\",\"6874\",\"static/chunks/6874-414075bb21e16c80.js\",\"790\",\"static/chunks/790-56740160f8591258.js\",\"193\",\"static/chunks/193-67b2101e7453b1fd.js\",\"5060\",\"static/chunks/app/panel/layout-cd977d54eaa36ab5.js\"],\"default\"]\n9:I[24232,[\"8511\",\"static/chunks/8511-d676122a8278dae5.js\",\"5452\",\"static/chunks/5452-f0332fb38cc50f6e.js\",\"3207\",\"static/chunks/3207-16c76f5e3dd1df18.js\",\"193\",\"static/chunks/193-67b2101e7453b1fd.js\",\"1356\",\"static/chunks/app/panel/plugins/page-d81845874af9c30b.js\"],\"SubPage\"]\na:I[59665,[],\"OutletBoundary\"]\nc:I[74911,[],\"AsyncMetadataOutlet\"]\ne:I[59665,[],\"ViewportBoundary\"]\n10:I[59665,[],\"MetadataBoundary\"]\n11:\"$Sreact.suspense\\"\n13:I[28393,[],\"\"]\n:HL[\"/\_next/static/css/1d4f4ee9de467097.css\",\"style\"]\n:HL[\"/\_next/static/css/a1a630053fbadb94.css\",\"style\"]\n:HL[\"/\_next/static/css/41b25e3cec3514f2.css\",\"style\"]\n"])self.__next_f.push([1,"0:{\"P\":null,\"b\":\"sb2dTljg3MewNOeHRiF_J\",\"p\":\"\",\"c\":[\"\",\"panel\",\"plugins\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"panel\",{\"children\":[\"plugins\",{\"children\":[\"\_PAGE\_\",{}]}]}]},\"$undefined\",\"$undefined\",true],[[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/\_next/static/css/1d4f4ee9de467097.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/\_next/static/css/a1a630053fbadb94.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/\_next/static/css/41b25e3cec3514f2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],[[\"$\",\"html\",null,{\"lang\":\"zh-cn\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"\_className_d4cf3b antialiased\",\"children\":[\"$\",\"$L2\",null,{\"attribute\":\"class\",\"defaultTheme\":\"system\",\"enableSystem\":true,\"disableTransitionOnChange\":true,\"children\":[[\"$\",\"$L3\",null,{\"position\":\"bottom-right\",\"expand\":true,\"richColors\":true}],[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\\",\\\\"Segoe UI Emoji\\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"\_html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}\}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display ``` -------------------------------- ### Opanel-MC Routing Structure Source: https://github.com/opanel-mc/opanel/blob/main/core/src/main/resources/web/panel/players/index.html This snippet outlines the routing configuration for the Opanel-MC application, showing how different sections like 'panel' and 'players' are structured and how their children components are managed. It also includes placeholders for error handling and dynamic content loading. ```JavaScript [[\"$\",\"panel\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"Component\":\"$7\", \"slots\":{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}, \"params\":{}, \"promise\":\"$@8\"}] ]}],\n[\"$\",\"players\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}, \"params\":{}, \"promise\":\"$@8\"}] ],\n[\"$\",\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L9\",null,{\"Component\":\"$a\", \"searchParams\":{}, \"params\":\"$0:f:0:1:2:children:1:props:children:1:props:params\", \"promises\":[\"$@b\",\"$@c\"] }],null,[\"$\",\"$Ld\",null,{\"children\":[\"$Le\",[\"$\",\"$Lf\",null,{\"promise\":\"$@10\"}]]}]] }]] ``` -------------------------------- ### Untitled No description -------------------------------- ### System Monitor API Source: https://context7.com/opanel-mc/opanel/llms.txt Provides real-time system resource monitoring including CPU usage, memory consumption, and server TPS. ```APIDOC ## GET /api/monitor ### Description Retrieves current system monitoring data for the server. ### Method GET ### Endpoint `/api/monitor` ### Response #### Success Response (200) - **cpu** (number) - Current CPU usage percentage. - **mem** (number) - Current memory usage percentage. - **tps** (number) - Recent ticks per second. #### Response Example ```json { "cpu": 45.0, "mem": 68.0, "tps": 19.85 } ``` ### Continuous Monitoring Example ```json { "script": "while true; do\n curl -s -X GET http://localhost:8080/api/monitor \n -H \"X-Credential-Token: \" | jq '.'\n sleep 5\ndone" } ``` ``` -------------------------------- ### Authentication API Source: https://context7.com/opanel-mc/opanel/llms.txt Handles user authentication using MD5-hashed access keys and JWT token generation for secure session management. ```APIDOC ## POST /api/auth ### Description Authenticates with an access key to receive a JWT token. ### Method POST ### Endpoint `/api/auth` ### Parameters #### Request Body - **accessKey** (string) - Required - The MD5-hashed access key. ### Request Example ```json { "accessKey": "5d41402abc4b2a76b9719d911017c592" } ``` ### Response #### Success Response (200) - **token** (string) - The generated JWT token. #### Response Example ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` ``` -------------------------------- ### Whitelist Management API Source: https://context7.com/opanel-mc/opanel/llms.txt Controls server whitelist status and manages whitelisted players with full entry manipulation. ```APIDOC ## GET /api/whitelist/ ### Description Retrieves the current whitelist entries. ### Method GET ### Endpoint `/api/whitelist/` ### Parameters #### Headers - **X-Credential-Token** (string) - Required - The JWT token for authentication. ### Response #### Success Response (200) - **whitelist** (array) - List of whitelisted players. - **name** (string) - Player's name. - **uuid** (string) - Player's UUID. #### Response Example ```json { "whitelist": [ { "name": "Steve", "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5" } ] } ``` ``` ```APIDOC ## POST /api/whitelist/enable ### Description Enables the server whitelist. ### Method POST ### Endpoint `/api/whitelist/enable` ### Parameters #### Headers - **X-Credential-Token** (string) - Required - The JWT token for authentication. ### Response #### Success Response (200) - (empty) #### Response Example (empty) ``` ```APIDOC ## POST /api/whitelist/disable ### Description Disables the server whitelist. ### Method POST ### Endpoint `/api/whitelist/disable` ### Parameters #### Headers - **X-Credential-Token** (string) - Required - The JWT token for authentication. ### Response #### Success Response (200) - (empty) #### Response Example (empty) ``` ```APIDOC ## POST /api/whitelist/add ### Description Adds a player to the server whitelist. ### Method POST ### Endpoint `/api/whitelist/add` ### Parameters #### Query Parameters - **name** (string) - Required - The name of the player to add. - **uuid** (string) - Required - The UUID of the player to add. #### Headers - **X-Credential-Token** (string) - Required - The JWT token for authentication. ### Response #### Success Response (200) - (empty) #### Response Example (empty) ``` -------------------------------- ### Game Rules API Source: https://context7.com/opanel-mc/opanel/llms.txt Provides read and write access to all Minecraft game rules for dynamic server configuration. ```APIDOC ## GET /api/gamerules ### Description Retrieves all current game rules configured for the server. ### Method GET ### Endpoint `/api/gamerules` ### Response #### Success Response (200) - **gamerules** (object) - An object containing all game rules and their current values. #### Response Example ```json { "gamerules": { "doFireTick": true, "mobGriefing": true, "keepInventory": false, "doMobSpawning": true, "doDaylightCycle": true, "maxEntityCramming": 24, "randomTickSpeed": 3 } } ``` ## POST /api/gamerules ### Description Updates one or more game rules for the server. ### Method POST ### Endpoint `/api/gamerules` ### Parameters #### Request Body - **gamerules** (object) - Required - An object containing the game rules to update and their new values. ### Request Example ```json { "request": "curl -X POST http://localhost:8080/api/gamerules \ -H \"X-Credential-Token: \" \ -H \"Content-Type: application/json\" \ -d '{ \n \"gamerules\": { \n \"keepInventory\": true, \n \"doFireTick\": false, \n \"randomTickSpeed\": 10 \n } \n }'" } ``` ``` -------------------------------- ### Whitelist Management API Source: https://context7.com/opanel-mc/opanel/llms.txt Manages the server's whitelist, allowing additions, removals, and complete replacements of whitelist entries. ```APIDOC ## POST /api/whitelist/remove ### Description Removes a player from the server whitelist. ### Method POST ### Endpoint `/api/whitelist/remove` ### Parameters #### Query Parameters - **name** (string) - Required - The name of the player to remove. - **uuid** (string) - Required - The UUID of the player to remove. ### Request Example ```json { "request": "curl -X POST \"http://localhost:8080/api/whitelist/remove?name=Alex&uuid=8667ba71-b85a-4004-af54-457a9734eed7\" \ -H \"X-Credential-Token: \"" } ``` ## POST /api/whitelist/write ### Description Replaces the entire server whitelist with the provided list of players. ### Method POST ### Endpoint `/api/whitelist/write` ### Parameters #### Request Body - **(array of objects)** - Required - An array of player objects, each containing 'name' and 'uuid'. ### Request Example ```json { "request": "curl -X POST http://localhost:8080/api/whitelist/write \ -H \"X-Credential-Token: \" \ -H \"Content-Type: application/json\" \ -d '[\n {\"name\": \"Steve\", \"uuid\": \"069a79f4-44e9-4726-a5be-fca90e38aaf5\"},\n {\"name\": \"Alex\", \"uuid\": \"8667ba71-b85a-4004-af54-457a9734eed7\"}\n ]'" } ``` ``` -------------------------------- ### Connect to WebSocket Terminal API in JavaScript Source: https://context7.com/opanel-mc/opanel/llms.txt Establishes a WebSocket connection to a terminal server for real-time bidirectional communication. It handles authentication, incoming messages (logs, autocomplete suggestions, errors), command execution, and autocomplete requests. Requires a WebSocket server running at ws://localhost:8080/terminal. ```javascript // Connect to WebSocket terminal const ws = new WebSocket('ws://localhost:8080/terminal'); // Authenticate connection ws.onopen = () => { ws.send(JSON.stringify({ type: 'auth', data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' // JWT token })); }; // Handle incoming messages ws.onmessage = (event) => { const packet = JSON.parse(event.data); switch(packet.type) { case 'init': // Receive recent log history console.log('Recent logs:', packet.data); break; case 'log': // Real-time log entry console.log(packet.data.timestamp, packet.data.level, packet.data.message); break; case 'autocomplete': // Command suggestions console.log('Suggestions:', packet.data); break; case 'error': console.error('Error:', packet.data); break; } }; // Execute server command function executeCommand(cmd) { ws.send(JSON.stringify({ type: 'command', data: cmd })); } // Request autocomplete suggestions function requestAutocomplete(argPosition) { ws.send(JSON.stringify({ type: 'autocomplete', data: argPosition // 1 for first argument, 2 for second, etc. })); } // Example usage executeCommand('say Hello from WebSocket!'); executeCommand('gamemode creative Steve'); requestAutocomplete(1); // Get list of available commands requestAutocomplete(2); // Get list of online players ```