diff --git a/src/common/db/Database.py b/src/common/db/Database.py index 8bf817983..6d8718595 100644 --- a/src/common/db/Database.py +++ b/src/common/db/Database.py @@ -258,11 +258,12 @@ class Database: if "id" not in plugin: settings = plugin plugin = { - "id": "default", + "id": "general", "order": 999, - "name": "Default", - "description": "Default settings", + "name": "General", + "description": "The general settings for the server", "version": "0.1", + "external": False, } else: settings = plugin.pop("settings", {}) diff --git a/src/ui/src/Config.py b/src/ui/src/Config.py index 50abcb3cd..67703de02 100644 --- a/src/ui/src/Config.py +++ b/src/ui/src/Config.py @@ -139,6 +139,15 @@ class Config: if not exists("/usr/sbin/nginx"): plugins = self.__db.get_plugins() plugins.sort(key=lambda x: x["name"]) + + general_plugin = None + for x, plugin in enumerate(plugins): + if plugin["name"] == "General": + general_plugin = plugin + del plugins[x] + break + plugins.insert(0, general_plugin) + return plugins plugins = [] @@ -167,6 +176,22 @@ class Config: plugins.append(plugin) plugins.sort(key=lambda x: x["name"]) + + with open("/usr/share/bunkerweb/settings.json", "r") as f: + plugins.insert( + 0, + { + "id": "general", + "order": 999, + "name": "General", + "description": "The general settings for the server", + "version": "0.1", + "external": False, + "page": False, + "settings": json_load(f), + }, + ) + return plugins def get_settings(self) -> dict: diff --git a/src/ui/templates/global_config.html b/src/ui/templates/global_config.html index b73f2e9f4..fa0981a0d 100644 --- a/src/ui/templates/global_config.html +++ b/src/ui/templates/global_config.html @@ -35,10 +35,6 @@ config["CONFIG"].get_config() %} > - - {% include "settings_general.html" %} - - {% include "settings_plugins.html" %} diff --git a/src/ui/templates/settings_general.html b/src/ui/templates/settings_general.html deleted file mode 100644 index 5d3cccefc..000000000 --- a/src/ui/templates/settings_general.html +++ /dev/null @@ -1,194 +0,0 @@ -{% set current_endpoint = url_for(request.endpoint)[1:].split("/")[-1].strip().replace('_', '-') -%} - -{% set plugins = config["CONFIG"].get_plugins() %} -{% set global_config = config["CONFIG"].get_config() %} - -
{{value['help']}} -
-