diff --git a/config/base_db.php b/config/base_db.php new file mode 100644 index 0000000..7d7fd8e --- /dev/null +++ b/config/base_db.php @@ -0,0 +1,30 @@ + 'public', - 'user' => 'admin', - 'password' => 'Hc7LAjDBZbXQBoSzDkaV', + 'user' => 'nexusBasisLive', + 'password' => 'JNr4REumUDPDjr4S9Lfq', 'options' => [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, diff --git a/config/prod/settings.php b/config/prod/settings.php index 2902945..df1ad79 100755 --- a/config/prod/settings.php +++ b/config/prod/settings.php @@ -5,4 +5,7 @@ define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY); define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY); define('APP_DB_ENABLED', false); // set true to enable DB connection - + define('APP_DB_DEBUG', false); + define('APP_DB_AUTO_INIT', true); + define('APP_KEA_DB_VERSION', '2.6.3'); + define('APP_BASE_DB_ENABLED', true); diff --git a/config/staging/db.php b/config/staging/db_settings_basic.php similarity index 98% rename from config/staging/db.php rename to config/staging/db_settings_basic.php index 8aa8116..9005128 100755 --- a/config/staging/db.php +++ b/config/staging/db_settings_basic.php @@ -30,7 +30,7 @@ $pgsql = [ // optional: schema/search_path (commonly "public") 'schema' => 'public', - 'user' => 'admin', + 'user' => 'nexusBasisStg', 'password' => '8HHtFt9ON6RkmwIS0c7U', 'options' => [ diff --git a/config/staging/settings.php b/config/staging/settings.php index cb78543..3b025c3 100755 --- a/config/staging/settings.php +++ b/config/staging/settings.php @@ -4,5 +4,8 @@ define('APP_DOMAIN_PRIMARY', APP_DOMAIN_NAME); define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY); define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY); - define('APP_DB_ENABLED', true); // set true to enable DB connection + define('APP_DB_ENABLED', false); // legacy default DB disabled (modules handle their own DB) define('APP_DB_DEBUG', true); + define('APP_DB_AUTO_INIT', true); + define('APP_KEA_DB_VERSION', '2.6.3'); + define('APP_BASE_DB_ENABLED', true); diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/modules/kea/module.json b/modules/kea/module.json new file mode 100644 index 0000000..01e0fa2 --- /dev/null +++ b/modules/kea/module.json @@ -0,0 +1,26 @@ +{ + "title": "KEA DHCP", + "version": "1.0.0", + "description": "Verwaltung von KEA DHCP Hosts und Reservierungen.", + "setup": { + "fields": [ + { "name": "db.host", "label": "DB Host", "type": "text", "required": true }, + { "name": "db.port", "label": "DB Port", "type": "number", "required": true }, + { "name": "db.dbname", "label": "DB Name", "type": "text", "required": true }, + { "name": "db.schema", "label": "DB Schema", "type": "text", "required": false }, + { "name": "db.user", "label": "DB User", "type": "text", "required": true }, + { "name": "db.password", "label": "DB Passwort", "type": "password", "required": true }, + { "name": "kea_db_version", "label": "KEA DB Version", "type": "text", "required": false }, + { "name": "kea_auto_init", "label": "KEA Auto-Init", "type": "checkbox", "required": false } + ] + }, + "db_defaults": { + "driver": "pgsql", + "host": "localhost", + "port": 5432, + "dbname": "", + "schema": "public", + "user": "", + "password": "" + } +} diff --git a/modules/kea/pages/index.php b/modules/kea/pages/index.php new file mode 100644 index 0000000..8169e73 --- /dev/null +++ b/modules/kea/pages/index.php @@ -0,0 +1,22 @@ +get('kea'); +$fallback = $module['db_defaults'] ?? []; + +$pdo = modules()->modulePdo('kea', $fallback); +$hosts = []; +$error = null; + +if ($pdo) { + try { + $repo = new KeaHostRepository($pdo); + $hosts = $repo->findAll(50); + } catch (\Exception $e) { + $error = "Datenbankfehler: " . $e->getMessage(); + } +} else { + $error = "Modul nicht konfiguriert. Bitte Setup ausführen."; +} + +module_tpl('kea', 'dashboard', compact('hosts', 'error')); diff --git a/partials/landing/kea_dashboard.php b/modules/kea/partials/dashboard.php similarity index 100% rename from partials/landing/kea_dashboard.php rename to modules/kea/partials/dashboard.php diff --git a/partials/structure/layout_start.php b/partials/structure/layout_start.php index b3ec263..63ad363 100755 --- a/partials/structure/layout_start.php +++ b/partials/structure/layout_start.php @@ -27,8 +27,8 @@ $app->assets()->addScript('/assets/js/app.js', 'footer', true);
Aktive Module verwalten und neue Module initialisieren.
-global $appConfig; +Trage die benötigten Informationen für das Modul ein.
+ + +