import React, { useState, useEffect } from 'react' import api from '../services/api' import toast from 'react-hot-toast' import { CogIcon, ServerIcon, CircleStackIcon, ShieldCheckIcon, ClockIcon } from '@heroicons/react/24/outline' const System = () => { const [systemInfo, setSystemInfo] = useState(null) const [loading, setLoading] = useState(true) useEffect(() => { loadSystemInfo() }, []) const loadSystemInfo = async () => { try { setLoading(true) // This would be a real API endpoint in production const response = await api.get('/system/info') setSystemInfo(response.data.data) } catch (error) { // Mock data for development setSystemInfo({ version: '1.0.0', environment: 'development', uptime: '7d 14h 32m', database: { status: 'connected', version: 'PostgreSQL 14.2', connections: 5, maxConnections: 100 }, memory: { used: '256MB', total: '1GB', percentage: 25 }, lastBackup: '2024-01-15T10:30:00Z', ssl: { status: 'valid', expiresAt: '2024-03-15T00:00:00Z' } }) } finally { setLoading(false) } } const StatusCard = ({ title, icon: Icon, children }) => (

{title}

{children}
) const StatusIndicator = ({ status }) => { const colors = { connected: 'bg-green-100 text-green-800', valid: 'bg-green-100 text-green-800', warning: 'bg-yellow-100 text-yellow-800', error: 'bg-red-100 text-red-800' } return ( {status.charAt(0).toUpperCase() + status.slice(1)} ) } if (loading) { return (
) } return (

System

Monitor system health and configuration

Version {systemInfo.version}
Environment {systemInfo.environment}
Uptime {systemInfo.uptime}
Status
Version {systemInfo.database.version}
Connections {systemInfo.database.connections}/{systemInfo.database.maxConnections}
Status
Expires {new Date(systemInfo.ssl.expiresAt).toLocaleDateString()}

Memory Usage

Used {systemInfo.memory.used}
Total {systemInfo.memory.total}
{systemInfo.memory.percentage}% used

Last Backup

{new Date(systemInfo.lastBackup).toLocaleDateString()}
{new Date(systemInfo.lastBackup).toLocaleTimeString()}
) } export default System