From 568e0a0891252533070dcc83563e8a1660c19eb6 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 22 Jun 2026 21:29:12 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20#41=20#43=20=E2=80=94=20phpMyAdmin=20+?= =?UTF-8?q?=20Adminer=20+=20PostgreSQL=20in=20DB=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adminer installed at /adminer.php (MySQL + PostgreSQL) - db-tools API now detects adminer.php file and returns its URL - Tool cards: phpMyAdmin, Adminer (MySQL/PG), pgAdmin4 - Open buttons use API-provided URL (adminer.php for Adminer) - Separate MySQL and PostgreSQL database sections in DB Manager - PostgreSQL section has direct link to Adminer PG mode - #42 Docker: already complete (full docker page with all tabs) --- panel/api/endpoints/system.php | 5 ++++- panel/public/assets/js/admin.js | 27 +++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/panel/api/endpoints/system.php b/panel/api/endpoints/system.php index 1d1b1a2..566628b 100644 --- a/panel/api/endpoints/system.php +++ b/panel/api/endpoints/system.php @@ -924,6 +924,8 @@ BASH; || is_dir('/usr/share/phpmyadmin'); $pgaInstalled = (int)trim(shell_exec("dpkg -l pgadmin4 2>/dev/null | grep -c '^ii'") ?: '0') > 0 || is_file('/usr/pgadmin4/bin/pgadmin4') || is_dir('/usr/pgadmin4'); + $adminerInstalled = is_file(NOVACPX_ROOT . '/adminer.php'); + $adminerVer = $adminerInstalled ? 'bundled' : ''; $pmaVer = $pmaInstalled ? trim(shell_exec("dpkg -l phpmyadmin 2>/dev/null | awk '/^ii/{print $3}' | head -1") ?: '') : ''; @@ -931,8 +933,9 @@ BASH; ? trim(shell_exec("pgadmin4 --version 2>/dev/null | grep -oP '[0-9]+\\.[0-9]+' | head -1") ?: '') : ''; Response::success([ - 'phpmyadmin' => ['installed' => $pmaInstalled, 'version' => $pmaVer], + 'phpmyadmin' => ['installed' => $pmaInstalled, 'version' => $pmaVer, 'url' => '/phpmyadmin'], 'pgadmin' => ['installed' => $pgaInstalled, 'version' => $pgaVer], + 'adminer' => ['installed' => $adminerInstalled, 'version' => $adminerVer, 'url' => '/adminer.php'], ]); })(), diff --git a/panel/public/assets/js/admin.js b/panel/public/assets/js/admin.js index 5c2bc5b..e7761b6 100644 --- a/panel/public/assets/js/admin.js +++ b/panel/public/assets/js/admin.js @@ -2384,6 +2384,8 @@ ${ips.length ? ` const actE = engRes?.data?.active_engine || 'mysql'; const dbs = dbRes?.data || []; const tools = toolsRes?.data || {}; + const pgDbs = (dbs||[]).filter(d => d.db_type === 'pgsql' || d.db_type === 'postgresql'); + const myDbs = (dbs||[]).filter(d => !d.db_type || d.db_type === 'mysql' || d.db_type === 'mariadb'); const engineCard = (id, label, icon) => { const e = eng[id] || {}; @@ -2415,6 +2417,7 @@ ${ips.length ? ` const t = tools[id] || {}; const statusColor = t.installed ? 'green' : 'default'; const statusText = t.installed ? 'Installed' : 'Not Installed'; + const openUrl = t.url || url; return `
@@ -2429,7 +2432,7 @@ ${ips.length ? ` : ` - Open ↗` + Open ↗` }
@@ -2478,16 +2481,28 @@ ${dbs.map(d=>`
Database Admin Tools
- ${toolCard('phpmyadmin', 'phpMyAdmin', '🛢', `http://${location.hostname}/phpmyadmin`)} - ${toolCard('pgadmin', 'pgAdmin 4', '🐘', `http://${location.hostname}/pgadmin4`)} - ${toolCard('adminer', 'Adminer', '🗄️', `http://${location.hostname}/adminer.php`)} + ${toolCard('phpmyadmin', 'phpMyAdmin', '🐬', `http://${location.hostname}/phpmyadmin`)} + ${toolCard('adminer', 'Adminer (MySQL/PG)', '🗄️', `http://${location.hostname}/adminer.php`)} + ${toolCard('pgadmin', 'pgAdmin 4', '🐘', `http://${location.hostname}/pgadmin4`)}
-
-
All Databases${dbs.length} total
+
+
+ MySQL / MariaDB Databases + ${myDbs.length} databases +
${dbTable} +
+ +
+
+ 🐘 PostgreSQL Databases + ${pgDbs.length} databases + Open in Adminer ↗ +
+
No PostgreSQL databases in NovaCPX yet. Use Adminer to manage PostgreSQL directly.
`; }