mirror of
https://github.com/myronblair/novacpx
synced 2026-07-28 05:03:14 -05:00
feat: server monitoring charts, package limits, WHMCS bridge, server options (#19-22)
#19 Server monitoring charts: - server_stats table (migration 007) + collect-stats.php cron script - serverStatus() page rebuilt with Chart.js line charts (CPU/RAM/disk) - Chart.js lazy-loaded from CDN; history shown for last 24h #20 Cron job manager: already complete in prior session #21 Package limits enforcement: - email.php: checks max_email before creating email account - databases.php: checks max_databases before creating database - ftp.php: checks max_ftp before creating FTP account - stats.php: fixed column names (max_email/max_ftp/max_databases vs old aliases) #22b WHMCS billing bridge: - whmcs.php endpoint: create/suspend/unsuspend/terminate/changepackage/info - Auth via X-WHMCS-Key header; enabled/key stored in settings table #22a/c/d/e Server options admin page: - Web/mail/FTP/DNS server selection with settings persistence - Server switch triggers /opt/novacpx/bin/switch-*.sh scripts (if present) - NS health checker: live dig lookup of all zones vs configured NS1/NS2 - system.php: server-options + save-option actions - dns.php: ns-health action Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,17 +76,17 @@ match ($action) {
|
||||
$pkg = $db->fetchOne("SELECT * FROM packages WHERE id = ?", [$acct['package_id'] ?? 0]);
|
||||
|
||||
Response::success([
|
||||
'disk_mb' => $diskMB,
|
||||
'disk_limit' => $pkg['disk_mb'] ?? 0,
|
||||
'inodes' => $inodes,
|
||||
'databases' => $dbCount,
|
||||
'db_limit' => $pkg['databases'] ?? 0,
|
||||
'emails' => $emailCount,
|
||||
'email_limit' => $pkg['email_accounts'] ?? 0,
|
||||
'ftp' => $ftpCount,
|
||||
'ftp_limit' => $pkg['ftp_accounts'] ?? 0,
|
||||
'domains' => $domCount,
|
||||
'subdomain_limit' => $pkg['subdomains'] ?? 0,
|
||||
'disk_mb' => $diskMB,
|
||||
'disk_limit' => $pkg['disk_mb'] ?? 0,
|
||||
'inodes' => $inodes,
|
||||
'databases' => $dbCount,
|
||||
'db_limit' => $pkg['max_databases'] ?? 0,
|
||||
'emails' => $emailCount,
|
||||
'email_limit' => $pkg['max_email'] ?? 0,
|
||||
'ftp' => $ftpCount,
|
||||
'ftp_limit' => $pkg['max_ftp'] ?? 0,
|
||||
'domains' => $domCount,
|
||||
'subdomain_limit' => $pkg['max_subdomains'] ?? 0,
|
||||
]);
|
||||
})(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user