Add server status monitoring endpoint
- Add status.service.js with CPU, RAM, Disk, Backend stats - RAM calculation matches htop (reads /proc/meminfo) - Includes uploads folder size, DB table count - Returns both system and backend (process) uptime 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as adminService from '../services/admin.service.js';
|
||||
import * as statusService from '../services/status.service.js';
|
||||
import { logUserCreation, logRoleChange } from '../services/audit.service.js';
|
||||
|
||||
/**
|
||||
@@ -142,3 +143,20 @@ export const deleteUser = async (req, res, next) => {
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get server status (admin only)
|
||||
* GET /api/admin/server-status
|
||||
*/
|
||||
export const getServerStatus = async (req, res, next) => {
|
||||
try {
|
||||
const status = await statusService.getServerStatus();
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: status,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user