| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| class HolographicSecurityCommand { |
| constructor() { |
| this.isInitialized = false; |
| this.currentMode = 'dashboard'; |
| this.threats = new Map(); |
| this.networkNodes = new Map(); |
| this.gestureController = null; |
| this.vrController = null; |
| this.arController = null; |
| this.hologramRenderer = null; |
| this.voiceController = null; |
| this.aiAnalyzer = null; |
| |
| |
| this.config = { |
| |
| performance: { |
| enableWASM: true, |
| enableWorkers: true, |
| enableGPU: true, |
| maxThreats: 1000, |
| maxNodes: 500 |
| }, |
| |
| |
| security: { |
| realTimeMonitoring: true, |
| threatDetection: true, |
| anomalyDetection: true, |
| behavioralAnalysis: true |
| }, |
| |
| |
| interface: { |
| language: 'ar', |
| direction: 'rtl', |
| theme: 'dark', |
| animations: true, |
| haptic: true |
| }, |
| |
| |
| vr: { |
| enabled: true, |
| handTracking: true, |
| eyeTracking: false, |
| controllerType: 'hands' |
| }, |
| |
| |
| ar: { |
| enabled: true, |
| markerBased: false, |
| markerless: true, |
| planeDetection: true |
| } |
| }; |
| |
| |
| this.threatSimulation = { |
| types: ['XSS', 'SQL Injection', 'Malware', 'DDoS', 'Phishing', 'Ransomware', 'Zero-Day', 'Advanced Persistent Threat'], |
| severities: ['منخفض', 'متوسط', 'عالي', 'حرج'], |
| sources: ['داخلي', 'خارجي', 'غير معروف', 'متقدم'], |
| statuses: ['نشط', 'محايد', 'محلولة', 'قيد المعالجة'] |
| }; |
| |
| |
| this.networkTopology = { |
| zones: ['DMZ', 'Internal', 'Database', 'Web Server', 'Mail Server', 'File Server', 'Backup'], |
| protocols: ['HTTPS', 'SSH', 'FTP', 'SMTP', 'RDP', 'Database'], |
| security: ['Encrypted', 'Authenticated', 'Filtered', 'Monitored'] |
| }; |
| |
| console.log('🚀 تم تهيئة مركز القيادة السيبراني الغامر'); |
| this.init(); |
| } |
| |
| |
| |
| |
| async init() { |
| try { |
| console.log('🔧 بدء تهيئة المكونات الأساسية...'); |
| |
| |
| await this.initializeUI(); |
| |
| |
| await this.initialize3DEngine(); |
| |
| |
| await this.initializeGestureControl(); |
| |
| |
| if (this.config.vr.enabled) { |
| await this.initializeVR(); |
| } |
| |
| |
| if (this.config.ar.enabled) { |
| await this.initializeAR(); |
| } |
| |
| |
| await this.initializeVoiceControl(); |
| |
| |
| await this.initializeAIAnalyzer(); |
| |
| |
| await this.startThreatSimulation(); |
| await this.startNetworkSimulation(); |
| |
| |
| this.bindEvents(); |
| |
| this.isInitialized = true; |
| console.log('✅ تم تهيئة النظام بنجاح'); |
| |
| |
| this.showNotification('تم تفعيل مركز القيادة الغامر بنجاح', 'success'); |
| |
| } catch (error) { |
| console.error('❌ خطأ في تهيئة النظام:', error); |
| this.showNotification('خطأ في تهيئة النظام', 'error'); |
| } |
| } |
| |
| |
| |
| |
| async initializeUI() { |
| console.log('🎨 تهيئة واجهة المستخدم...'); |
| |
| |
| const container = document.createElement('div'); |
| container.id = 'holographic-command-center'; |
| container.className = 'holographic-container rtl-enabled'; |
| |
| |
| const header = this.createHeaderBar(); |
| |
| |
| const mainArea = this.createMainDisplay(); |
| |
| |
| const controlPanel = this.createControlPanel(); |
| |
| |
| const footer = this.createFooterBar(); |
| |
| |
| container.appendChild(header); |
| container.appendChild(mainArea); |
| container.appendChild(controlPanel); |
| container.appendChild(footer); |
| |
| document.body.appendChild(container); |
| |
| |
| this.applyStyles(); |
| |
| console.log('✅ تم تهيئة واجهة المستخدم'); |
| } |
| |
| |
| |
| |
| createHeaderBar() { |
| const header = document.createElement('header'); |
| header.className = 'holographic-header glass-panel'; |
| header.innerHTML = ` |
| <div class="header-content"> |
| <div class="logo-section"> |
| <div class="logo-icon"> |
| <div class="hologram-orb"></div> |
| <div class="hologram-rings"> |
| <div class="ring ring-1"></div> |
| <div class="ring ring-2"></div> |
| <div class="ring ring-3"></div> |
| </div> |
| </div> |
| <h1 class="logo-text">مركز القيادة السيبراني الغامر</h1> |
| </div> |
| |
| <div class="status-section"> |
| <div class="status-indicator system-status"> |
| <span class="status-dot active"></span> |
| <span class="status-text">نظام نشط</span> |
| </div> |
| <div class="status-indicator threat-level"> |
| <span class="status-dot warning"></span> |
| <span class="status-text">تهديدات: 23</span> |
| </div> |
| <div class="status-indicator network-status"> |
| <span class="status-dot active"></span> |
| <span class="status-text">الشبكة: آمنة</span> |
| </div> |
| </div> |
| |
| <div class="control-section"> |
| <button class="control-btn voice-btn" id="voice-toggle"> |
| <svg class="icon"><path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/></svg> |
| <span>تحكم صوتي</span> |
| </button> |
| <button class="control-btn vr-btn" id="vr-mode-toggle"> |
| <svg class="icon"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg> |
| <span>واقع افتراضي</span> |
| </button> |
| <button class="control-btn settings-btn" id="settings-toggle"> |
| <svg class="icon"><path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/></svg> |
| <span>الإعدادات</span> |
| </button> |
| </div> |
| </div> |
| `; |
| |
| return header; |
| } |
| |
| |
| |
| |
| createMainDisplay() { |
| const mainArea = document.createElement('main'); |
| mainArea.className = 'holographic-main-display'; |
| mainArea.innerHTML = ` |
| <div class="display-canvas-container"> |
| <canvas id="holographic-canvas" class="holographic-canvas"></canvas> |
| <div class="canvas-overlay"> |
| <div class="threat-counter"> |
| <span class="counter-number" id="threat-count">23</span> |
| <span class="counter-label">تهديد نشط</span> |
| </div> |
| <div class="network-health"> |
| <span class="health-indicator"> |
| <div class="health-bar"> |
| <div class="health-fill" style="width: 87%"></div> |
| </div> |
| <span class="health-text">صحة الشبكة: 87%</span> |
| </span> |
| </div> |
| </div> |
| </div> |
| |
| <div class="holographic-layers"> |
| <div class="layer layer-background" id="bg-layer"> |
| <div class="network-grid"></div> |
| </div> |
| |
| <div class="layer layer-threats" id="threat-layer"> |
| <!-- سيتم ملؤها بالتهديدات المجسمة --> |
| </div> |
| |
| <div class="layer layer-controls" id="control-layer"> |
| <!-- عناصر التحكم التفاعلية --> |
| </div> |
| </div> |
| |
| <div class="floating-panels"> |
| <div class="floating-panel threat-panel" id="threat-panel"> |
| <div class="panel-header"> |
| <h3>التهديدات النشطة</h3> |
| <button class="panel-toggle">−</button> |
| </div> |
| <div class="panel-content"> |
| <div class="threat-list" id="active-threats-list"> |
| <!-- سيتم ملؤها بالقائمة --> |
| </div> |
| </div> |
| </div> |
| |
| <div class="floating-panel network-panel" id="network-panel"> |
| <div class="panel-header"> |
| <h3>خرائط الشبكة</h3> |
| <button class="panel-toggle">−</button> |
| </div> |
| <div class="panel-content"> |
| <div class="network-map" id="network-topology"> |
| <!-- خريطة الشبكة ثلاثية الأبعاد --> |
| </div> |
| </div> |
| </div> |
| </div> |
| `; |
| |
| return mainArea; |
| } |
| |
| |
| |
| |
| createControlPanel() { |
| const controlPanel = document.createElement('aside'); |
| controlPanel.className = 'holographic-control-panel glass-panel'; |
| controlPanel.innerHTML = ` |
| <div class="panel-tabs"> |
| <button class="tab-btn active" data-tab="monitoring">المراقبة</button> |
| <button class="tab-btn" data-tab="analysis">التحليل</button> |
| <button class="tab-btn" data-tab="response">الاستجابة</button> |
| <button class="tab-btn" data-tab="training">التدريب</button> |
| </div> |
| |
| <div class="panel-content"> |
| <div class="tab-content active" id="monitoring-tab"> |
| <div class="control-group"> |
| <h4>المراقبة الفورية</h4> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox" checked> مراقبة التهديدات |
| </label> |
| </div> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox" checked> تحليل السلوك |
| </label> |
| </div> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox" checked> كشف الشذوذ |
| </label> |
| </div> |
| </div> |
| |
| <div class="control-group"> |
| <h4>مستوى التنبيه</h4> |
| <div class="alert-level"> |
| <input type="range" min="1" max="10" value="7" class="alert-slider" id="alert-level"> |
| <span class="alert-value" id="alert-value">7</span> |
| </div> |
| </div> |
| </div> |
| |
| <div class="tab-content" id="analysis-tab"> |
| <div class="control-group"> |
| <h4>تحليل متقدم</h4> |
| <button class="action-btn primary" id="run-analysis">تشغيل التحليل</button> |
| <button class="action-btn secondary" id="export-report">تصدير التقرير</button> |
| </div> |
| |
| <div class="control-group"> |
| <h4>أنواع التحليل</h4> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox" checked> تحليل الثغرات |
| </label> |
| </div> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox" checked> تحليل الشبكة |
| </label> |
| </div> |
| <div class="control-item"> |
| <label class="control-label"> |
| <input type="checkbox"> تحليل الذكاء الاصطناعي |
| </label> |
| </div> |
| </div> |
| </div> |
| |
| <div class="tab-content" id="response-tab"> |
| <div class="control-group"> |
| <h4>الاستجابة التلقائية</h4> |
| <button class="action-btn primary" id="auto-respond">تفعيل الاستجابة</button> |
| <button class="action-btn danger" id="emergency-stop">إيقاف طوارئ</button> |
| </div> |
| |
| <div class="control-group"> |
| <h4>إجراءات الاستجابة</h4> |
| <div class="response-actions"> |
| <button class="action-btn" id="isolate-threat">عزل التهديد</button> |
| <button class="action-btn" id="block-ip">حظر IP</button> |
| <button class="action-btn" id="quarantine-system">عزل النظام</button> |
| </div> |
| </div> |
| </div> |
| |
| <div class="tab-content" id="training-tab"> |
| <div class="control-group"> |
| <h4>التدريب التفاعلي</h4> |
| <button class="action-btn primary" id="start-training">بدء التدريب</button> |
| <button class="action-btn secondary" id="vr-training">تدريب VR</button> |
| </div> |
| |
| <div class="control-group"> |
| <h4>محاكاة الهجمات</h4> |
| <div class="simulation-scenarios"> |
| <button class="scenario-btn" data-scenario="phishing">تصيد احتيالي</button> |
| <button class="scenario-btn" data-scenario="ransomware">برامج فدية</button> |
| <button class="scenario-btn" data-scenario="ddos">هجمات DDoS</button> |
| </div> |
| </div> |
| </div> |
| </div> |
| `; |
| |
| return controlPanel; |
| } |
| |
| |
| |
| |
| createFooterBar() { |
| const footer = document.createElement('footer'); |
| footer.className = 'holographic-footer glass-panel'; |
| footer.innerHTML = ` |
| <div class="footer-content"> |
| <div class="system-stats"> |
| <div class="stat-item"> |
| <span class="stat-label">المعالج</span> |
| <span class="stat-value">23%</span> |
| <div class="stat-bar"> |
| <div class="stat-fill" style="width: 23%"></div> |
| </div> |
| </div> |
| <div class="stat-item"> |
| <span class="stat-label">الذاكرة</span> |
| <span class="stat-value">67%</span> |
| <div class="stat-bar"> |
| <div class="stat-fill" style="width: 67%"></div> |
| </div> |
| </div> |
| <div class="stat-item"> |
| <span class="stat-label">الشبكة</span> |
| <span class="stat-value">45%</span> |
| <div class="stat-bar"> |
| <div class="stat-fill" style="width: 45%"></div> |
| </div> |
| </div> |
| </div> |
| |
| <div class="time-display"> |
| <div class="current-time" id="current-time"></div> |
| <div class="system-uptime">تشغيل: 72:45:23</div> |
| </div> |
| |
| <div class="connection-status"> |
| <div class="connection-item"> |
| <span class="connection-label">مركز البيانات</span> |
| <span class="connection-status online">متصل</span> |
| </div> |
| <div class="connection-item"> |
| <span class="connection-label">السحابة</span> |
| <span class="connection-status online">متصل</span> |
| </div> |
| <div class="connection-item"> |
| <span class="connection-label">AI المحلل</span> |
| <span class="connection-status online">نشط</span> |
| </div> |
| </div> |
| </div> |
| `; |
| |
| return footer; |
| } |
| |
| |
| |
| |
| async initialize3DEngine() { |
| console.log('🎭 تهيئة محرك الرسم ثلاثي الأبعاد...'); |
| |
| try { |
| |
| await this.loadThreeJS(); |
| |
| |
| this.scene = new THREE.Scene(); |
| this.scene.background = new THREE.Color(0x000000); |
| this.scene.fog = new THREE.Fog(0x000000, 10, 100); |
| |
| |
| this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); |
| this.camera.position.set(0, 0, 10); |
| |
| |
| this.renderer = new THREE.WebGLRenderer({ |
| canvas: document.getElementById('holographic-canvas'), |
| antialias: true, |
| alpha: true |
| }); |
| this.renderer.setSize(window.innerWidth, window.innerHeight); |
| this.renderer.setPixelRatio(window.devicePixelRatio); |
| this.renderer.shadowMap.enabled = true; |
| this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; |
| this.renderer.toneMapping = THREE.ACESFilmicToneMapping; |
| this.renderer.toneMappingExposure = 1.2; |
| |
| |
| this.setupLighting(); |
| |
| |
| this.createBackgroundGrid(); |
| |
| |
| this.startAnimationLoop(); |
| |
| console.log('✅ تم تهيئة محرك الرسم ثلاثي الأبعاد'); |
| |
| } catch (error) { |
| console.error('❌ خطأ في تهيئة محرك الرسم:', error); |
| throw error; |
| } |
| } |
| |
| |
| |
| |
| async loadThreeJS() { |
| return new Promise((resolve, reject) => { |
| if (typeof THREE !== 'undefined') { |
| resolve(); |
| return; |
| } |
| |
| const script = document.createElement('script'); |
| script.src = 'https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js'; |
| script.onload = resolve; |
| script.onerror = reject; |
| document.head.appendChild(script); |
| }); |
| } |
| |
| |
| |
| |
| setupLighting() { |
| |
| const ambientLight = new THREE.AmbientLight(0x404040, 0.4); |
| this.scene.add(ambientLight); |
| |
| |
| const mainLight = new THREE.DirectionalLight(0xffffff, 0.8); |
| mainLight.position.set(10, 10, 5); |
| mainLight.castShadow = true; |
| mainLight.shadow.mapSize.width = 2048; |
| mainLight.shadow.mapSize.height = 2048; |
| this.scene.add(mainLight); |
| |
| |
| const cyanLight = new THREE.PointLight(0x22d3ee, 1, 50); |
| cyanLight.position.set(0, 0, 10); |
| this.scene.add(cyanLight); |
| |
| |
| const alertLight = new THREE.PointLight(0xf87171, 1, 30); |
| alertLight.position.set(-5, 5, 5); |
| this.scene.add(alertLight); |
| } |
| |
| |
| |
| |
| createBackgroundGrid() { |
| const gridSize = 50; |
| const gridDivisions = 50; |
| |
| |
| const gridHelper = new THREE.GridHelper(gridSize, gridDivisions, 0x2e2e33, 0x2e2e33); |
| gridHelper.material.opacity = 0.2; |
| gridHelper.material.transparent = true; |
| gridHelper.position.y = -5; |
| this.scene.add(gridHelper); |
| |
| |
| const verticalGrid = new THREE.GridHelper(gridSize, gridDivisions, 0x2e2e33, 0x2e2e33); |
| verticalGrid.rotation.z = Math.PI / 2; |
| verticalGrid.material.opacity = 0.1; |
| verticalGrid.material.transparent = true; |
| verticalGrid.position.x = -5; |
| this.scene.add(verticalGrid); |
| |
| |
| this.createParticles(); |
| } |
| |
| |
| |
| |
| createParticles() { |
| const particleCount = 1000; |
| const particles = new THREE.BufferGeometry(); |
| const positions = new Float32Array(particleCount * 3); |
| const colors = new Float32Array(particleCount * 3); |
| |
| for (let i = 0; i < particleCount * 3; i += 3) { |
| positions[i] = (Math.random() - 0.5) * 100; |
| positions[i + 1] = (Math.random() - 0.5) * 100; |
| positions[i + 2] = (Math.random() - 0.5) * 100; |
| |
| colors[i] = Math.random() * 0.5 + 0.25; |
| colors[i + 1] = Math.random() * 0.5 + 0.25; |
| colors[i + 2] = Math.random() * 0.5 + 0.25; |
| } |
| |
| particles.setAttribute('position', new THREE.BufferAttribute(positions, 3)); |
| particles.setAttribute('color', new THREE.BufferAttribute(colors, 3)); |
| |
| const particleMaterial = new THREE.PointsMaterial({ |
| size: 0.5, |
| vertexColors: true, |
| transparent: true, |
| opacity: 0.6, |
| blending: THREE.AdditiveBlending |
| }); |
| |
| this.particleSystem = new THREE.Points(particles, particleMaterial); |
| this.scene.add(this.particleSystem); |
| } |
| |
| |
| |
| |
| async initializeGestureControl() { |
| console.log('👋 تهيئة نظام التحكم بالإيماءات...'); |
| |
| try { |
| |
| if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { |
| throw new Error('الكاميرا غير مدعومة'); |
| } |
| |
| |
| const stream = await navigator.mediaDevices.getUserMedia({ |
| video: { |
| width: 640, |
| height: 480, |
| frameRate: 30 |
| } |
| }); |
| |
| |
| this.videoElement = document.createElement('video'); |
| this.videoElement.srcObject = stream; |
| this.videoElement.autoplay = true; |
| this.videoElement.style.display = 'none'; |
| document.body.appendChild(this.videoElement); |
| |
| |
| this.gestureController = new GestureController(this.videoElement); |
| await this.gestureController.initialize(); |
| |
| |
| this.bindGestureEvents(); |
| |
| console.log('✅ تم تهيئة نظام التحكم بالإيماءات'); |
| |
| } catch (error) { |
| console.warn('⚠️ تعذر تهيئة التحكم بالإيماءات:', error); |
| this.gestureController = null; |
| } |
| } |
| |
| |
| |
| |
| bindGestureEvents() { |
| if (!this.gestureController) return; |
| |
| this.gestureController.on('hand_detected', () => { |
| this.showNotification('تم اكتشاف اليد - تحكم بالإيماءات متاح', 'info'); |
| }); |
| |
| this.gestureController.on('swipe_left', () => { |
| this.switchTab('prev'); |
| }); |
| |
| this.gestureController.on('swipe_right', () => { |
| this.switchTab('next'); |
| }); |
| |
| this.gestureController.on('pinch', () => { |
| this.zoomIn(); |
| }); |
| |
| this.gestureController.on('pinch_out', () => { |
| this.zoomOut(); |
| }); |
| |
| this.gestureController.on('point', (x, y) => { |
| this.handlePointing(x, y); |
| }); |
| } |
| |
| |
| |
| |
| async initializeVR() { |
| console.log('🥽 تهيئة الواقع الافتراضي...'); |
| |
| try { |
| |
| if (!navigator.xr) { |
| throw new Error('WebXR غير مدعوم'); |
| } |
| |
| |
| const isVRSupported = await navigator.xr.isSessionSupported('immersive-vr'); |
| if (!isVRSupported) { |
| throw new Error('VR غير مدعوم'); |
| } |
| |
| |
| this.vrController = new VRController(this.scene, this.camera, this.renderer); |
| await this.vrController.initialize(); |
| |
| |
| this.bindVREvents(); |
| |
| console.log('✅ تم تهيئة الواقع الافتراضي'); |
| |
| } catch (error) { |
| console.warn('⚠️ تعذر تهيئة الواقع الافتراضي:', error); |
| this.vrController = null; |
| } |
| } |
| |
| |
| |
| |
| bindVREvents() { |
| if (!this.vrController) return; |
| |
| this.vrController.on('session_start', () => { |
| this.currentMode = 'vr'; |
| this.showNotification('تم الدخول إلى وضع الواقع الافتراضي', 'info'); |
| }); |
| |
| this.vrController.on('session_end', () => { |
| this.currentMode = 'dashboard'; |
| this.showNotification('تم الخروج من وضع الواقع الافتراضي', 'info'); |
| }); |
| |
| this.vrController.on('controller_select', (object) => { |
| this.handleVRSelection(object); |
| }); |
| |
| this.vrController.on('controller_squeeze', (object) => { |
| this.handleVRManipulation(object); |
| }); |
| } |
| |
| |
| |
| |
| async initializeAR() { |
| console.log('📱 تهيئة الواقع المعزز...'); |
| |
| try { |
| |
| if (!navigator.xr) { |
| throw new Error('WebXR غير مدعوم'); |
| } |
| |
| |
| const isARSupported = await navigator.xr.isSessionSupported('immersive-ar'); |
| if (!isARSupported) { |
| throw new Error('AR غير مدعوم'); |
| } |
| |
| |
| this.arController = new ARController(this.scene, this.camera, this.renderer); |
| await this.arController.initialize(); |
| |
| |
| this.bindAREvents(); |
| |
| console.log('✅ تم تهيئة الواقع المعزز'); |
| |
| } catch (error) { |
| console.warn('⚠️ تعذر تهيئة الواقع المعزز:', error); |
| this.arController = null; |
| } |
| } |
| |
| |
| |
| |
| bindAREvents() { |
| if (!this.arController) return; |
| |
| this.arController.on('plane_detected', (plane) => { |
| this.showNotification('تم اكتشاف سطح - يمكن وضع العناصر', 'info'); |
| }); |
| |
| this.arController.on('session_start', () => { |
| this.currentMode = 'ar'; |
| this.showNotification('تم الدخول إلى وضع الواقع المعزز', 'info'); |
| }); |
| |
| this.arController.on('session_end', () => { |
| this.currentMode = 'dashboard'; |
| this.showNotification('تم الخروج من وضع الواقع المعزز', 'info'); |
| }); |
| } |
| |
| |
| |
| |
| async initializeVoiceControl() { |
| console.log('🎤 تهيئة محرك الصوت...'); |
| |
| try { |
| |
| if (!('webkitSpeechRecognition' in window) && !('SpeechRecognition' in window)) { |
| throw new Error('Web Speech API غير مدعوم'); |
| } |
| |
| |
| const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; |
| this.voiceController = new SpeechRecognition(); |
| this.voiceController.continuous = true; |
| this.voiceController.interimResults = false; |
| this.voiceController.lang = 'ar-SA'; |
| |
| |
| this.bindVoiceEvents(); |
| |
| console.log('✅ تم تهيئة محرك الصوت'); |
| |
| } catch (error) { |
| console.warn('⚠️ تعذر تهيئة محرك الصوت:', error); |
| this.voiceController = null; |
| } |
| } |
| |
| |
| |
| |
| bindVoiceEvents() { |
| if (!this.voiceController) return; |
| |
| this.voiceController.onresult = (event) => { |
| const command = event.results[event.results.length - 1][0].transcript.trim(); |
| this.processVoiceCommand(command); |
| }; |
| |
| this.voiceController.onerror = (event) => { |
| console.warn('خطأ في التعرف على الصوت:', event.error); |
| }; |
| |
| this.voiceController.onend = () => { |
| |
| if (this.voiceController.active) { |
| this.voiceController.start(); |
| } |
| }; |
| } |
| |
| |
| |
| |
| processVoiceCommand(command) { |
| console.log('🎤 أمر صوتي:', command); |
| |
| |
| if (command.includes('تحليل') || command.includes('فحص')) { |
| this.runThreatAnalysis(); |
| } else if (command.includes('حظر') || command.includes('منع')) { |
| this.blockCurrentThreat(); |
| } else if (command.includes('عزل')) { |
| this.isolateSystem(); |
| } else if (command.includes('تقرير') || command.includes('تصدير')) { |
| this.generateReport(); |
| } else if (command.includes('وضع الواقع الافتراضي')) { |
| this.enterVRMode(); |
| } else if (command.includes('وضع الواقع المعزز')) { |
| this.enterARMode(); |
| } else if (command.includes('حالة النظام')) { |
| this.showSystemStatus(); |
| } |
| } |
| |
| |
| |
| |
| async initializeAIAnalyzer() { |
| console.log('🤖 تهيئة المحلل الذكي...'); |
| |
| try { |
| this.aiAnalyzer = new AIThreatAnalyzer(); |
| await this.aiAnalyzer.initialize(); |
| |
| console.log('✅ تم تهيئة المحلل الذكي'); |
| |
| } catch (error) { |
| console.warn('⚠️ تعذر تهيئة المحلل الذكي:', error); |
| this.aiAnalyzer = null; |
| } |
| } |
| |
| |
| |
| |
| async startThreatSimulation() { |
| console.log('⚠️ بدء محاكاة التهديدات...'); |
| |
| |
| for (let i = 0; i < 5; i++) { |
| await this.createRandomThreat(); |
| } |
| |
| |
| setInterval(async () => { |
| if (this.threats.size < 50) { |
| await this.createRandomThreat(); |
| } |
| }, 10000); |
| |
| console.log('✅ تم بدء محاكاة التهديدات'); |
| } |
| |
| |
| |
| |
| async createRandomThreat() { |
| const threatTypes = this.threatSimulation.types; |
| const severities = this.threatSimulation.severities; |
| const sources = this.threatSimulation.sources; |
| |
| const threat = { |
| id: `threat_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, |
| type: threatTypes[Math.floor(Math.random() * threatTypes.length)], |
| severity: severities[Math.floor(Math.random() * severities.length)], |
| source: sources[Math.floor(Math.random() * sources.length)], |
| timestamp: new Date(), |
| status: 'نشط', |
| description: this.generateThreatDescription(), |
| sourceIP: this.generateRandomIP(), |
| targetSystem: this.generateRandomSystem(), |
| risk: Math.floor(Math.random() * 100) + 1 |
| }; |
| |
| this.threats.set(threat.id, threat); |
| await this.displayThreat(threat); |
| this.updateThreatCounter(); |
| |
| return threat; |
| } |
| |
| |
| |
| |
| async displayThreat(threat) { |
| |
| const threatGeometry = this.createThreatGeometry(threat.type, threat.severity); |
| const threatMaterial = this.createThreatMaterial(threat.severity); |
| const threatMesh = new THREE.Mesh(threatGeometry, threatMaterial); |
| |
| |
| threatMesh.position.set( |
| (Math.random() - 0.5) * 20, |
| (Math.random() - 0.5) * 20, |
| (Math.random() - 0.5) * 20 |
| ); |
| |
| |
| threatMesh.userData = { threat: threat }; |
| |
| |
| this.scene.add(threatMesh); |
| threat.mesh = threatMesh; |
| |
| |
| this.animateThreat(threatMesh); |
| |
| console.log('⚠️ تم عرض تهديد:', threat.type); |
| } |
| |
| |
| |
| |
| createThreatGeometry(type, severity) { |
| let geometry; |
| |
| switch (type) { |
| case 'XSS': |
| geometry = new THREE.SphereGeometry(0.5, 16, 16); |
| break; |
| case 'SQL Injection': |
| geometry = new THREE.BoxGeometry(0.8, 0.8, 0.8); |
| break; |
| case 'Malware': |
| geometry = new THREE.TetrahedronGeometry(0.7); |
| break; |
| case 'DDoS': |
| geometry = new THREE.OctahedronGeometry(0.6); |
| break; |
| case 'Phishing': |
| geometry = new THREE.ConeGeometry(0.5, 1, 8); |
| break; |
| case 'Ransomware': |
| geometry = new THREE.TorusGeometry(0.5, 0.2, 8, 16); |
| break; |
| default: |
| geometry = new THREE.IcosahedronGeometry(0.5); |
| } |
| |
| return geometry; |
| } |
| |
| |
| |
| |
| createThreatMaterial(severity) { |
| let color; |
| let opacity; |
| |
| switch (severity) { |
| case 'منخفض': |
| color = 0x34d399; |
| opacity = 0.6; |
| break; |
| case 'متوسط': |
| color = 0xfbbf24; |
| opacity = 0.7; |
| break; |
| case 'عالي': |
| color = 0xf97316; |
| opacity = 0.8; |
| break; |
| case 'حرج': |
| color = 0xf87171; |
| opacity = 0.9; |
| break; |
| default: |
| color = 0x22d3ee; |
| opacity = 0.7; |
| } |
| |
| return new THREE.MeshBasicMaterial({ |
| color: color, |
| transparent: true, |
| opacity: opacity, |
| wireframe: false |
| }); |
| } |
| |
| |
| |
| |
| animateThreat(mesh) { |
| const animate = () => { |
| mesh.rotation.x += 0.01; |
| mesh.rotation.y += 0.02; |
| |
| |
| const pulse = 1 + Math.sin(Date.now() * 0.003) * 0.1; |
| mesh.scale.setScalar(pulse); |
| |
| requestAnimationFrame(animate); |
| }; |
| animate(); |
| } |
| |
| |
| |
| |
| async startNetworkSimulation() { |
| console.log('🌐 بدء محاكاة الشبكة...'); |
| |
| |
| const zones = this.networkTopology.zones; |
| for (let i = 0; i < zones.length; i++) { |
| await this.createNetworkNode(zones[i], i); |
| } |
| |
| |
| this.createNetworkConnections(); |
| |
| console.log('✅ تم بدء محاكاة الشبكة'); |
| } |
| |
| |
| |
| |
| async createNetworkNode(zone, index) { |
| const node = { |
| id: `node_${zone.toLowerCase().replace(' ', '_')}`, |
| zone: zone, |
| status: 'آمن', |
| connections: [], |
| position: { |
| x: Math.cos((index / zones.length) * Math.PI * 2) * 8, |
| y: Math.sin((index / zones.length) * Math.PI * 2) * 8, |
| z: (Math.random() - 0.5) * 4 |
| } |
| }; |
| |
| this.networkNodes.set(node.id, node); |
| |
| |
| const nodeGeometry = new THREE.SphereGeometry(0.3, 16, 16); |
| const nodeMaterial = new THREE.MeshBasicMaterial({ |
| color: 0x22d3ee, |
| transparent: true, |
| opacity: 0.8 |
| }); |
| const nodeMesh = new THREE.Mesh(nodeGeometry, nodeMaterial); |
| nodeMesh.position.set(node.position.x, node.position.y, node.position.z); |
| |
| node.mesh = nodeMesh; |
| this.scene.add(nodeMesh); |
| |
| return node; |
| } |
| |
| |
| |
| |
| createNetworkConnections() { |
| const nodes = Array.from(this.networkNodes.values()); |
| |
| for (let i = 0; i < nodes.length; i++) { |
| for (let j = i + 1; j < nodes.length; j++) { |
| |
| const start = new THREE.Vector3( |
| nodes[i].position.x, |
| nodes[i].position.y, |
| nodes[i].position.z |
| ); |
| const end = new THREE.Vector3( |
| nodes[j].position.x, |
| nodes[j].position.y, |
| nodes[j].position.z |
| ); |
| |
| const lineGeometry = new THREE.BufferGeometry().setFromPoints([start, end]); |
| const lineMaterial = new THREE.LineBasicMaterial({ |
| color: 0x404040, |
| transparent: true, |
| opacity: 0.4 |
| }); |
| |
| const line = new THREE.Line(lineGeometry, lineMaterial); |
| this.scene.add(line); |
| } |
| } |
| } |
| |
| |
| |
| |
| startAnimationLoop() { |
| const animate = () => { |
| requestAnimationFrame(animate); |
| |
| |
| if (this.particleSystem) { |
| this.particleSystem.rotation.y += 0.001; |
| } |
| |
| |
| if (this.currentMode === 'dashboard') { |
| this.camera.position.x = Math.cos(Date.now() * 0.0005) * 10; |
| this.camera.position.z = Math.sin(Date.now() * 0.0005) * 10; |
| this.camera.lookAt(0, 0, 0); |
| } |
| |
| |
| this.renderer.render(this.scene, this.camera); |
| }; |
| animate(); |
| } |
| |
| |
| |
| |
| applyStyles() { |
| const styles = ` |
| /* أنماط عامة للمركز الغامر */ |
| * { |
| margin: 0; |
| padding: 0; |
| box-sizing: border-box; |
| } |
| |
| body { |
| font-family: 'IBM Plex Sans Arabic', sans-serif; |
| background: #000000; |
| color: #f0f2f5; |
| overflow: hidden; |
| direction: rtl; |
| } |
| |
| .holographic-container { |
| position: fixed; |
| top: 0; |
| left: 0; |
| width: 100vw; |
| height: 100vh; |
| z-index: 1000; |
| } |
| |
| /* لوحة زجاجية */ |
| .glass-panel { |
| background: rgba(16, 16, 18, 0.65); |
| backdrop-filter: blur(20px); |
| border: 1px solid #2e2e33; |
| border-radius: 12px; |
| } |
| |
| /* شريط الرأس */ |
| .holographic-header { |
| position: absolute; |
| top: 0; |
| left: 0; |
| right: 0; |
| height: 80px; |
| padding: 0 24px; |
| z-index: 1001; |
| } |
| |
| .header-content { |
| display: flex; |
| justify-content: space-between; |
| align-items: center; |
| height: 100%; |
| } |
| |
| .logo-section { |
| display: flex; |
| align-items: center; |
| gap: 16px; |
| } |
| |
| .logo-icon { |
| position: relative; |
| width: 48px; |
| height: 48px; |
| } |
| |
| .hologram-orb { |
| width: 16px; |
| height: 16px; |
| background: #22d3ee; |
| border-radius: 50%; |
| position: absolute; |
| top: 50%; |
| left: 50%; |
| transform: translate(-50%, -50%); |
| box-shadow: 0 0 16px rgba(34, 211, 238, 0.6); |
| } |
| |
| .hologram-rings { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| } |
| |
| .ring { |
| position: absolute; |
| border: 2px solid #22d3ee; |
| border-radius: 50%; |
| opacity: 0.3; |
| animation: rotate 4s linear infinite; |
| } |
| |
| .ring-1 { |
| width: 100%; |
| height: 100%; |
| animation-duration: 4s; |
| } |
| |
| .ring-2 { |
| width: 80%; |
| height: 80%; |
| top: 10%; |
| left: 10%; |
| animation-duration: 3s; |
| } |
| |
| .ring-3 { |
| width: 60%; |
| height: 60%; |
| top: 20%; |
| left: 20%; |
| animation-duration: 2s; |
| } |
| |
| .logo-text { |
| font-size: 24px; |
| font-weight: 600; |
| color: #f0f2f5; |
| } |
| |
| .status-section { |
| display: flex; |
| gap: 24px; |
| } |
| |
| .status-indicator { |
| display: flex; |
| align-items: center; |
| gap: 8px; |
| } |
| |
| .status-dot { |
| width: 8px; |
| height: 8px; |
| border-radius: 50%; |
| } |
| |
| .status-dot.active { |
| background: #34d399; |
| box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); |
| } |
| |
| .status-dot.warning { |
| background: #fbbf24; |
| box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); |
| } |
| |
| .control-section { |
| display: flex; |
| gap: 12px; |
| } |
| |
| .control-btn { |
| display: flex; |
| align-items: center; |
| gap: 8px; |
| padding: 12px 16px; |
| background: rgba(34, 211, 238, 0.1); |
| border: 1px solid #22d3ee; |
| border-radius: 8px; |
| color: #22d3ee; |
| cursor: pointer; |
| transition: all 0.2s ease; |
| } |
| |
| .control-btn:hover { |
| background: rgba(34, 211, 238, 0.2); |
| box-shadow: 0 0 16px rgba(34, 211, 238, 0.4); |
| } |
| |
| .control-btn .icon { |
| width: 16px; |
| height: 16px; |
| fill: currentColor; |
| } |
| |
| /* المنطقة الرئيسية */ |
| .holographic-main-display { |
| position: absolute; |
| top: 80px; |
| bottom: 100px; |
| left: 320px; |
| right: 0; |
| overflow: hidden; |
| } |
| |
| .display-canvas-container { |
| position: relative; |
| width: 100%; |
| height: 100%; |
| } |
| |
| .holographic-canvas { |
| width: 100%; |
| height: 100%; |
| display: block; |
| } |
| |
| .canvas-overlay { |
| position: absolute; |
| top: 24px; |
| right: 24px; |
| display: flex; |
| flex-direction: column; |
| gap: 16px; |
| } |
| |
| .threat-counter { |
| background: rgba(248, 113, 113, 0.1); |
| border: 1px solid #f87171; |
| border-radius: 8px; |
| padding: 16px; |
| text-align: center; |
| } |
| |
| .counter-number { |
| font-size: 32px; |
| font-weight: 700; |
| color: #f87171; |
| } |
| |
| .counter-label { |
| font-size: 14px; |
| color: #a0a7b0; |
| } |
| |
| .network-health { |
| background: rgba(52, 211, 153, 0.1); |
| border: 1px solid #34d399; |
| border-radius: 8px; |
| padding: 12px; |
| } |
| |
| .health-bar { |
| width: 100px; |
| height: 4px; |
| background: rgba(52, 211, 153, 0.2); |
| border-radius: 2px; |
| overflow: hidden; |
| margin-bottom: 8px; |
| } |
| |
| .health-fill { |
| height: 100%; |
| background: #34d399; |
| transition: width 0.3s ease; |
| } |
| |
| .health-text { |
| font-size: 12px; |
| color: #34d399; |
| } |
| |
| /* الطبقات ثلاثية الأبعاد */ |
| .holographic-layers { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| pointer-events: none; |
| } |
| |
| .layer { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| pointer-events: none; |
| } |
| |
| .network-grid { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| background-image: |
| linear-gradient(rgba(34, 211, 238, 0.1) 1px, transparent 1px), |
| linear-gradient(90deg, rgba(34, 211, 238, 0.1) 1px, transparent 1px); |
| background-size: 50px 50px; |
| animation: gridMove 20s linear infinite; |
| } |
| |
| /* اللوحات العائمة */ |
| .floating-panels { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| pointer-events: none; |
| } |
| |
| .floating-panel { |
| position: absolute; |
| width: 320px; |
| background: rgba(16, 16, 18, 0.85); |
| backdrop-filter: blur(20px); |
| border: 1px solid #2e2e33; |
| border-radius: 12px; |
| pointer-events: auto; |
| transition: transform 0.3s ease; |
| } |
| |
| .threat-panel { |
| top: 120px; |
| right: 24px; |
| max-height: 400px; |
| } |
| |
| .network-panel { |
| top: 540px; |
| right: 24px; |
| max-height: 300px; |
| } |
| |
| .panel-header { |
| display: flex; |
| justify-content: space-between; |
| align-items: center; |
| padding: 16px 20px; |
| border-bottom: 1px solid #2e2e33; |
| } |
| |
| .panel-header h3 { |
| font-size: 16px; |
| font-weight: 600; |
| color: #f0f2f5; |
| } |
| |
| .panel-toggle { |
| background: none; |
| border: none; |
| color: #a0a7b0; |
| cursor: pointer; |
| font-size: 18px; |
| } |
| |
| .panel-content { |
| padding: 16px 20px; |
| max-height: 300px; |
| overflow-y: auto; |
| } |
| |
| /* لوحة التحكم */ |
| .holographic-control-panel { |
| position: absolute; |
| top: 80px; |
| bottom: 100px; |
| left: 0; |
| width: 320px; |
| padding: 0; |
| } |
| |
| .panel-tabs { |
| display: flex; |
| background: rgba(34, 211, 238, 0.05); |
| border-bottom: 1px solid #2e2e33; |
| } |
| |
| .tab-btn { |
| flex: 1; |
| padding: 12px 8px; |
| background: none; |
| border: none; |
| color: #a0a7b0; |
| cursor: pointer; |
| font-size: 12px; |
| font-weight: 500; |
| transition: all 0.2s ease; |
| } |
| |
| .tab-btn.active { |
| color: #22d3ee; |
| background: rgba(34, 211, 238, 0.1); |
| } |
| |
| .tab-btn:hover { |
| color: #22d3ee; |
| } |
| |
| .panel-content { |
| padding: 20px; |
| height: calc(100% - 48px); |
| overflow-y: auto; |
| } |
| |
| .tab-content { |
| display: none; |
| } |
| |
| .tab-content.active { |
| display: block; |
| } |
| |
| .control-group { |
| margin-bottom: 24px; |
| } |
| |
| .control-group h4 { |
| font-size: 14px; |
| font-weight: 600; |
| color: #f0f2f5; |
| margin-bottom: 12px; |
| } |
| |
| .control-item { |
| margin-bottom: 8px; |
| } |
| |
| .control-label { |
| display: flex; |
| align-items: center; |
| gap: 8px; |
| cursor: pointer; |
| color: #a0a7b0; |
| font-size: 14px; |
| } |
| |
| .control-label input[type="checkbox"] { |
| width: 16px; |
| height: 16px; |
| accent-color: #22d3ee; |
| } |
| |
| .action-btn { |
| display: block; |
| width: 100%; |
| padding: 12px 16px; |
| margin-bottom: 8px; |
| background: rgba(34, 211, 238, 0.1); |
| border: 1px solid #22d3ee; |
| border-radius: 8px; |
| color: #22d3ee; |
| cursor: pointer; |
| font-size: 14px; |
| font-weight: 500; |
| transition: all 0.2s ease; |
| } |
| |
| .action-btn:hover { |
| background: rgba(34, 211, 238, 0.2); |
| box-shadow: 0 0 16px rgba(34, 211, 238, 0.4); |
| } |
| |
| .action-btn.primary { |
| background: #22d3ee; |
| color: #000000; |
| } |
| |
| .action-btn.primary:hover { |
| background: #0891b2; |
| } |
| |
| .action-btn.secondary { |
| border-color: #a0a7b0; |
| color: #a0a7b0; |
| } |
| |
| .action-btn.danger { |
| border-color: #f87171; |
| color: #f87171; |
| } |
| |
| .alert-level { |
| display: flex; |
| align-items: center; |
| gap: 12px; |
| } |
| |
| .alert-slider { |
| flex: 1; |
| accent-color: #22d3ee; |
| } |
| |
| .alert-value { |
| font-size: 14px; |
| font-weight: 600; |
| color: #22d3ee; |
| min-width: 24px; |
| } |
| |
| /* شريط التذييل */ |
| .holographic-footer { |
| position: absolute; |
| bottom: 0; |
| left: 0; |
| right: 0; |
| height: 100px; |
| padding: 0 24px; |
| } |
| |
| .footer-content { |
| display: flex; |
| justify-content: space-between; |
| align-items: center; |
| height: 100%; |
| } |
| |
| .system-stats { |
| display: flex; |
| gap: 24px; |
| } |
| |
| .stat-item { |
| display: flex; |
| flex-direction: column; |
| gap: 4px; |
| } |
| |
| .stat-label { |
| font-size: 12px; |
| color: #a0a7b0; |
| } |
| |
| .stat-value { |
| font-size: 14px; |
| font-weight: 600; |
| color: #22d3ee; |
| } |
| |
| .stat-bar { |
| width: 60px; |
| height: 4px; |
| background: rgba(34, 211, 238, 0.2); |
| border-radius: 2px; |
| overflow: hidden; |
| } |
| |
| .stat-fill { |
| height: 100%; |
| background: #22d3ee; |
| transition: width 0.3s ease; |
| } |
| |
| .time-display { |
| text-align: center; |
| } |
| |
| .current-time { |
| font-size: 18px; |
| font-weight: 600; |
| color: #f0f2f5; |
| } |
| |
| .system-uptime { |
| font-size: 12px; |
| color: #a0a7b0; |
| } |
| |
| .connection-status { |
| display: flex; |
| gap: 16px; |
| } |
| |
| .connection-item { |
| display: flex; |
| flex-direction: column; |
| gap: 2px; |
| text-align: center; |
| } |
| |
| .connection-label { |
| font-size: 11px; |
| color: #a0a7b0; |
| } |
| |
| .connection-status { |
| font-size: 12px; |
| font-weight: 600; |
| } |
| |
| .connection-status.online { |
| color: #34d399; |
| } |
| |
| /* الأنيميشن */ |
| @keyframes rotate { |
| from { transform: rotate(0deg); } |
| to { transform: rotate(360deg); } |
| } |
| |
| @keyframes gridMove { |
| 0% { transform: translate(0, 0); } |
| 100% { transform: translate(50px, 50px); } |
| } |
| |
| @keyframes pulse { |
| 0%, 100% { opacity: 0.6; } |
| 50% { opacity: 1; } |
| } |
| |
| /* تنسيق RTL */ |
| .rtl-enabled { |
| direction: rtl; |
| } |
| |
| .rtl-enabled * { |
| text-align: right; |
| } |
| |
| /* إشعارات */ |
| .notification { |
| position: fixed; |
| top: 100px; |
| left: 50%; |
| transform: translateX(-50%); |
| background: rgba(16, 16, 18, 0.95); |
| backdrop-filter: blur(20px); |
| border: 1px solid #2e2e33; |
| border-radius: 8px; |
| padding: 16px 24px; |
| color: #f0f2f5; |
| z-index: 10000; |
| animation: slideDown 0.3s ease; |
| } |
| |
| .notification.success { |
| border-color: #34d399; |
| color: #34d399; |
| } |
| |
| .notification.error { |
| border-color: #f87171; |
| color: #f87171; |
| } |
| |
| .notification.warning { |
| border-color: #fbbf24; |
| color: #fbbf24; |
| } |
| |
| .notification.info { |
| border-color: #22d3ee; |
| color: #22d3ee; |
| } |
| |
| @keyframes slideDown { |
| from { |
| opacity: 0; |
| transform: translateX(-50%) translateY(-20px); |
| } |
| to { |
| opacity: 1; |
| transform: translateX(-50%) translateY(0); |
| } |
| } |
| |
| /* تجاوب */ |
| @media (max-width: 1200px) { |
| .holographic-control-panel { |
| width: 280px; |
| } |
| |
| .holographic-main-display { |
| left: 280px; |
| } |
| } |
| |
| @media (max-width: 768px) { |
| .holographic-control-panel { |
| transform: translateX(-100%); |
| transition: transform 0.3s ease; |
| } |
| |
| .holographic-control-panel.open { |
| transform: translateX(0); |
| } |
| |
| .holographic-main-display { |
| left: 0; |
| } |
| } |
| `; |
| |
| const styleSheet = document.createElement('style'); |
| styleSheet.textContent = styles; |
| document.head.appendChild(styleSheet); |
| } |
| |
| |
| |
| |
| bindEvents() { |
| |
| this.bindControlPanelEvents(); |
| |
| |
| const canvas = document.getElementById('holographic-canvas'); |
| if (canvas) { |
| canvas.addEventListener('click', (event) => { |
| this.handleCanvasClick(event); |
| }); |
| } |
| |
| |
| window.addEventListener('resize', () => { |
| this.handleResize(); |
| }); |
| |
| |
| document.addEventListener('keydown', (event) => { |
| this.handleKeyPress(event); |
| }); |
| |
| |
| this.updateTime(); |
| setInterval(() => this.updateTime(), 1000); |
| |
| |
| this.updateSystemStats(); |
| setInterval(() => this.updateSystemStats(), 5000); |
| } |
| |
| |
| |
| |
| bindControlPanelEvents() { |
| |
| document.querySelectorAll('.tab-btn').forEach(btn => { |
| btn.addEventListener('click', () => { |
| const tab = btn.dataset.tab; |
| this.switchTab(tab); |
| }); |
| }); |
| |
| |
| document.getElementById('voice-toggle')?.addEventListener('click', () => { |
| this.toggleVoiceControl(); |
| }); |
| |
| document.getElementById('vr-mode-toggle')?.addEventListener('click', () => { |
| this.toggleVRMode(); |
| }); |
| |
| document.getElementById('settings-toggle')?.addEventListener('click', () => { |
| this.showSettings(); |
| }); |
| |
| |
| const alertSlider = document.getElementById('alert-level'); |
| const alertValue = document.getElementById('alert-value'); |
| if (alertSlider && alertValue) { |
| alertSlider.addEventListener('input', (e) => { |
| alertValue.textContent = e.target.value; |
| }); |
| } |
| |
| |
| document.getElementById('run-analysis')?.addEventListener('click', () => { |
| this.runThreatAnalysis(); |
| }); |
| |
| document.getElementById('export-report')?.addEventListener('click', () => { |
| this.generateReport(); |
| }); |
| |
| |
| document.getElementById('auto-respond')?.addEventListener('click', () => { |
| this.toggleAutoResponse(); |
| }); |
| |
| document.getElementById('emergency-stop')?.addEventListener('click', () => { |
| this.emergencyStop(); |
| }); |
| |
| |
| document.getElementById('start-training')?.addEventListener('click', () => { |
| this.startTraining(); |
| }); |
| |
| document.getElementById('vr-training')?.addEventListener('click', () => { |
| this.startVRTraining(); |
| }); |
| |
| |
| document.querySelectorAll('.scenario-btn').forEach(btn => { |
| btn.addEventListener('click', () => { |
| const scenario = btn.dataset.scenario; |
| this.runScenario(scenario); |
| }); |
| }); |
| } |
| |
| |
| |
| |
| switchTab(tabName) { |
| |
| document.querySelectorAll('.tab-btn').forEach(btn => { |
| btn.classList.toggle('active', btn.dataset.tab === tabName); |
| }); |
| |
| |
| document.querySelectorAll('.tab-content').forEach(content => { |
| content.classList.toggle('active', content.id === `${tabName}-tab`); |
| }); |
| |
| console.log('🔄 تم تبديل التبويب إلى:', tabName); |
| } |
| |
| |
| |
| |
| handleCanvasClick(event) { |
| const rect = event.target.getBoundingClientRect(); |
| const x = ((event.clientX - rect.left) / rect.width) * 2 - 1; |
| const y = -((event.clientY - rect.top) / rect.height) * 2 + 1; |
| |
| console.log('🖱️ نقر على Canvas:', x, y); |
| |
| |
| this.raycaster = new THREE.Raycaster(); |
| this.raycaster.setFromCamera({ x, y }, this.camera); |
| |
| const intersects = this.raycaster.intersectObjects(this.scene.children); |
| |
| if (intersects.length > 0) { |
| const object = intersects[0].object; |
| if (object.userData.threat) { |
| this.handleThreatClick(object.userData.threat); |
| } |
| } |
| } |
| |
| |
| |
| |
| handleThreatClick(threat) { |
| console.log('⚠️ تم النقر على تهديد:', threat.type); |
| |
| |
| this.showThreatDetails(threat); |
| |
| |
| this.addClickEffect(threat.mesh); |
| } |
| |
| |
| |
| |
| addClickEffect(mesh) { |
| const originalScale = mesh.scale.clone(); |
| mesh.scale.multiplyScalar(1.5); |
| |
| setTimeout(() => { |
| mesh.scale.copy(originalScale); |
| }, 200); |
| } |
| |
| |
| |
| |
| showThreatDetails(threat) { |
| const detailsPanel = document.createElement('div'); |
| detailsPanel.className = 'threat-details-modal glass-panel'; |
| detailsPanel.innerHTML = ` |
| <div class="modal-header"> |
| <h3>تفاصيل التهديد</h3> |
| <button class="modal-close">×</button> |
| </div> |
| <div class="modal-content"> |
| <div class="detail-item"> |
| <span class="detail-label">النوع:</span> |
| <span class="detail-value">${threat.type}</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">مستوى الخطورة:</span> |
| <span class="detail-value severity-${threat.severity}">${threat.severity}</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">المصدر:</span> |
| <span class="detail-value">${threat.source}</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">عنوان IP:</span> |
| <span class="detail-value">${threat.sourceIP}</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">النظام المستهدف:</span> |
| <span class="detail-value">${threat.targetSystem}</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">مستوى المخاطر:</span> |
| <span class="detail-value">${threat.risk}%</span> |
| </div> |
| <div class="detail-item"> |
| <span class="detail-label">الوصف:</span> |
| <span class="detail-value">${threat.description}</span> |
| </div> |
| </div> |
| <div class="modal-actions"> |
| <button class="action-btn primary" onclick="window.holographicCommand.isolateThreat('${threat.id}')"> |
| عزل التهديد |
| </button> |
| <button class="action-btn" onclick="window.holographicCommand.analyzeThreat('${threat.id}')"> |
| تحليل مفصل |
| </button> |
| <button class="action-btn" onclick="window.holographicCommand.ignoreThreat('${threat.id}')"> |
| تجاهل |
| </button> |
| </div> |
| `; |
| |
| document.body.appendChild(detailsPanel); |
| |
| |
| detailsPanel.querySelector('.modal-close').addEventListener('click', () => { |
| document.body.removeChild(detailsPanel); |
| }); |
| |
| |
| detailsPanel.addEventListener('click', (e) => { |
| if (e.target === detailsPanel) { |
| document.body.removeChild(detailsPanel); |
| } |
| }); |
| } |
| |
| |
| |
| |
| isolateThreat(threatId) { |
| const threat = this.threats.get(threatId); |
| if (!threat) return; |
| |
| console.log('🚫 عزل التهديد:', threat.type); |
| |
| |
| if (threat.mesh) { |
| this.scene.remove(threat.mesh); |
| } |
| |
| |
| this.threats.delete(threatId); |
| |
| |
| this.updateThreatCounter(); |
| this.updateThreatList(); |
| |
| this.showNotification(`تم عزل التهديد: ${threat.type}`, 'success'); |
| } |
| |
| |
| |
| |
| analyzeThreat(threatId) { |
| const threat = this.threats.get(threatId); |
| if (!threat) return; |
| |
| console.log('🔍 تحليل التهديد:', threat.type); |
| |
| this.showNotification(`بدء تحليل مفصل للتهديد: ${threat.type}`, 'info'); |
| |
| |
| setTimeout(() => { |
| this.showNotification(`تم اكتمال التحليل - التهديد: ${threat.type}`, 'success'); |
| }, 3000); |
| } |
| |
| |
| |
| |
| ignoreThreat(threatId) { |
| const threat = this.threats.get(threatId); |
| if (!threat) return; |
| |
| console.log('👁️ تجاهل التهديد:', threat.type); |
| |
| |
| if (threat.mesh) { |
| threat.mesh.visible = false; |
| } |
| |
| |
| threat.status = 'محجوب'; |
| |
| this.showNotification(`تم تجاهل التهديد: ${threat.type}`, 'warning'); |
| } |
| |
| |
| |
| |
| toggleVoiceControl() { |
| if (!this.voiceController) { |
| this.showNotification('التحكم الصوتي غير متاح', 'error'); |
| return; |
| } |
| |
| if (this.voiceController.active) { |
| this.voiceController.stop(); |
| this.voiceController.active = false; |
| this.showNotification('تم إيقاف التحكم الصوتي', 'info'); |
| } else { |
| this.voiceController.start(); |
| this.voiceController.active = true; |
| this.showNotification('تم تفعيل التحكم الصوتي', 'info'); |
| } |
| } |
| |
| |
| |
| |
| toggleVRMode() { |
| if (!this.vrController) { |
| this.showNotification('الواقع الافتراضي غير مدعوم', 'error'); |
| return; |
| } |
| |
| if (this.currentMode === 'vr') { |
| this.exitVRMode(); |
| } else { |
| this.enterVRMode(); |
| } |
| } |
| |
| |
| |
| |
| async enterVRMode() { |
| try { |
| await this.vrController.startSession(); |
| this.currentMode = 'vr'; |
| this.showNotification('تم الدخول إلى وضع الواقع الافتراضي', 'info'); |
| } catch (error) { |
| this.showNotification('فشل في الدخول إلى VR', 'error'); |
| } |
| } |
| |
| |
| |
| |
| async exitVRMode() { |
| try { |
| await this.vrController.endSession(); |
| this.currentMode = 'dashboard'; |
| this.showNotification('تم الخروج من وضع الواقع الافتراضي', 'info'); |
| } catch (error) { |
| this.showNotification('خطأ في الخروج من VR', 'error'); |
| } |
| } |
| |
| |
| |
| |
| runThreatAnalysis() { |
| console.log('🔍 بدء تحليل التهديدات...'); |
| |
| this.showNotification('بدء تحليل شامل للتهديدات', 'info'); |
| |
| |
| const threats = Array.from(this.threats.values()); |
| let analyzed = 0; |
| |
| const analyzeNext = () => { |
| if (analyzed >= threats.length) { |
| this.showNotification(`تم تحليل ${threats.length} تهديد بنجاح`, 'success'); |
| return; |
| } |
| |
| const threat = threats[analyzed]; |
| this.showNotification(`تحليل: ${threat.type}`, 'info'); |
| analyzed++; |
| |
| setTimeout(analyzeNext, 500); |
| }; |
| |
| analyzeNext(); |
| } |
| |
| |
| |
| |
| generateReport() { |
| console.log('📊 إنشاء تقرير الأمان...'); |
| |
| const reportData = { |
| timestamp: new Date(), |
| totalThreats: this.threats.size, |
| activeThreats: Array.from(this.threats.values()).filter(t => t.status === 'نشط').length, |
| networkHealth: 87, |
| systemUptime: '72:45:23', |
| recommendations: [ |
| 'تحديث جدار الحماية', |
| 'فحص نقاط الضعف', |
| 'تدريب الفريق', |
| 'مراجعة سياسات الأمان' |
| ] |
| }; |
| |
| this.showNotification('جاري إنشاء التقرير...', 'info'); |
| |
| setTimeout(() => { |
| this.downloadReport(reportData); |
| this.showNotification('تم إنشاء التقرير بنجاح', 'success'); |
| }, 2000); |
| } |
| |
| |
| |
| |
| downloadReport(data) { |
| const report = { |
| 'مركز القيادة السيبراني الغامر': { |
| 'تاريخ التقرير': data.timestamp.toLocaleString('ar-SA'), |
| 'إجمالي التهديدات': data.totalThreats, |
| 'التهديدات النشطة': data.activeThreats, |
| 'صحة الشبكة': `${data.networkHealth}%`, |
| 'وقت التشغيل': data.systemUptime, |
| 'التوصيات': data.recommendations |
| } |
| }; |
| |
| const blob = new Blob([JSON.stringify(report, null, 2)], { type: 'application/json' }); |
| const url = URL.createObjectURL(blob); |
| const a = document.createElement('a'); |
| a.href = url; |
| a.download = `security-report-${Date.now()}.json`; |
| a.click(); |
| URL.revokeObjectURL(url); |
| } |
| |
| |
| |
| |
| emergencyStop() { |
| console.log('🛑 إيقاف طوارئ'); |
| |
| this.showNotification('تم تفعيل الإيقاف الطارئ', 'error'); |
| |
| |
| this.threats.forEach(threat => { |
| if (threat.mesh) { |
| threat.mesh.visible = false; |
| } |
| }); |
| |
| |
| setTimeout(() => { |
| this.threats.forEach(threat => { |
| if (threat.mesh) { |
| threat.mesh.visible = true; |
| } |
| }); |
| this.showNotification('تم إلغاء الإيقاف الطارئ', 'success'); |
| }, 30000); |
| } |
| |
| |
| |
| |
| startTraining() { |
| console.log('🎓 بدء التدريب الأمني...'); |
| |
| this.showNotification('بدء التدريب التفاعلي', 'info'); |
| |
| |
| this.showTrainingScenario('تصيد احتيالي'); |
| } |
| |
| |
| |
| |
| startVRTraining() { |
| if (!this.vrController) { |
| this.showNotification('VR غير متاح للتدريب', 'error'); |
| return; |
| } |
| |
| console.log('🥽 بدء تدريب VR...'); |
| |
| this.showNotification('بدء تدريب الواقع الافتراضي', 'info'); |
| |
| this.enterVRMode(); |
| setTimeout(() => { |
| this.showTrainingScenario('تدريب VR'); |
| }, 2000); |
| } |
| |
| |
| |
| |
| showTrainingScenario(scenario) { |
| const scenarios = { |
| 'تصيد احتيالي': { |
| title: 'محاكاة هجمات التصيد', |
| description: 'تعلم كيفية التعرف على رسائل التصيد الاحتيالي المشبوهة', |
| steps: [ |
| 'تحقق من عنوان المرسل', |
| 'افحص روابط URLs', |
| 'تحقق من التوقيع الرقمي', |
| 'استخدم التحقق الثنائي' |
| ] |
| }, |
| 'برامج فدية': { |
| title: 'التعامل مع برامج الفدية', |
| description: 'تدرب على إجراءات الاستجابة لهجمات الفدية', |
| steps: [ |
| 'عزل الأنظمة المصابة', |
| 'نسخ احتياطية آمنة', |
| 'عدم دفع الفدية', |
| 'تتبع المسار القانوني' |
| ] |
| }, |
| 'هجمات DDoS': { |
| title: 'صد هجمات DDoS', |
| description: 'تعلم استراتيجيات حماية الشبكة من هجمات DDoS', |
| steps: [ |
| 'مراقبة حركة المرور', |
| 'تطبيق معدلات الحد', |
| 'استخدام CDN', |
| 'تفعيل الحماية المتقدمة' |
| ] |
| } |
| }; |
| |
| const scenarioData = scenarios[scenario] || scenarios['تصيد احتيالي']; |
| |
| const modal = document.createElement('div'); |
| modal.className = 'training-modal glass-panel'; |
| modal.innerHTML = ` |
| <div class="modal-header"> |
| <h3>${scenarioData.title}</h3> |
| <button class="modal-close">×</button> |
| </div> |
| <div class="modal-content"> |
| <p>${scenarioData.description}</p> |
| <div class="training-steps"> |
| <h4>خطوات التدريب:</h4> |
| <ol> |
| ${scenarioData.steps.map(step => `<li>${step}</li>`).join('')} |
| </ol> |
| </div> |
| </div> |
| <div class="modal-actions"> |
| <button class="action-btn primary" onclick="window.holographicCommand.startScenario('${scenario}')"> |
| بدء السيناريو |
| </button> |
| <button class="action-btn" onclick="window.holographicCommand.closeModal()"> |
| إلغاء |
| </button> |
| </div> |
| `; |
| |
| document.body.appendChild(modal); |
| |
| |
| modal.querySelector('.modal-close').addEventListener('click', () => { |
| this.closeModal(); |
| }); |
| } |
| |
| |
| |
| |
| startScenario(scenario) { |
| console.log('🎯 بدء سيناريو:', scenario); |
| |
| this.showNotification(`بدء سيناريو ${scenario}`, 'info'); |
| |
| |
| this.createTrainingThreats(scenario); |
| |
| setTimeout(() => { |
| this.showNotification(`تم اكتمال سيناريو ${scenario}`, 'success'); |
| }, 10000); |
| } |
| |
| |
| |
| |
| createTrainingThreats(scenario) { |
| for (let i = 0; i < 3; i++) { |
| const trainingThreat = { |
| id: `training_${scenario}_${i}`, |
| type: scenario, |
| severity: 'متوسط', |
| source: 'تدريبي', |
| timestamp: new Date(), |
| status: 'نشط', |
| description: `تهديد تدريبي ${scenario}`, |
| isTraining: true |
| }; |
| |
| this.threats.set(trainingThreat.id, trainingThreat); |
| this.displayThreat(trainingThreat); |
| } |
| |
| this.updateThreatCounter(); |
| } |
| |
| |
| |
| |
| showSettings() { |
| console.log('⚙️ عرض الإعدادات'); |
| |
| const settingsModal = document.createElement('div'); |
| settingsModal.className = 'settings-modal glass-panel'; |
| settingsModal.innerHTML = ` |
| <div class="modal-header"> |
| <h3>إعدادات النظام</h3> |
| <button class="modal-close">×</button> |
| </div> |
| <div class="modal-content"> |
| <div class="setting-group"> |
| <h4>الأداء</h4> |
| <label class="setting-item"> |
| <input type="checkbox" ${this.config.performance.enableWASM ? 'checked' : ''} onchange="window.holographicCommand.updateSetting('performance', 'enableWASM', this.checked)"> |
| تفعيل WebAssembly |
| </label> |
| <label class="setting-item"> |
| <input type="checkbox" ${this.config.performance.enableWorkers ? 'checked' : ''} onchange="window.holographicCommand.updateSetting('performance', 'enableWorkers', this.checked)"> |
| تفعيل Web Workers |
| </label> |
| </div> |
| |
| <div class="setting-group"> |
| <h4>الأمان</h4> |
| <label class="setting-item"> |
| <input type="checkbox" ${this.config.security.realTimeMonitoring ? 'checked' : ''} onchange="window.holographicCommand.updateSetting('security', 'realTimeMonitoring', this.checked)"> |
| مراقبة فورية |
| </label> |
| <label class="setting-item"> |
| <input type="checkbox" ${this.config.security.threatDetection ? 'checked' : ''} onchange="window.holographicCommand.updateSetting('security', 'threatDetection', this.checked)"> |
| كشف التهديدات |
| </label> |
| </div> |
| |
| <div class="setting-group"> |
| <h4>الواجهة</h4> |
| <label class="setting-item"> |
| <select onchange="window.holographicCommand.updateSetting('interface', 'theme', this.value)"> |
| <option value="dark" ${this.config.interface.theme === 'dark' ? 'selected' : ''}>داكن</option> |
| <option value="light" ${this.config.interface.theme === 'light' ? 'selected' : ''}>فاتح</option> |
| <option value="holographic" ${this.config.interface.theme === 'holographic' ? 'selected' : ''}>غامر</option> |
| </select> |
| نمط الواجهة |
| </label> |
| </div> |
| </div> |
| <div class="modal-actions"> |
| <button class="action-btn primary" onclick="window.holographicCommand.saveSettings()"> |
| حفظ الإعدادات |
| </button> |
| <button class="action-btn" onclick="window.holographicCommand.closeModal()"> |
| إلغاء |
| </button> |
| </div> |
| `; |
| |
| document.body.appendChild(settingsModal); |
| |
| |
| settingsModal.querySelector('.modal-close').addEventListener('click', () => { |
| this.closeModal(); |
| }); |
| } |
| |
| |
| |
| |
| updateSetting(category, key, value) { |
| this.config[category][key] = value; |
| console.log(`🔧 تم تحديث ${category}.${key} إلى ${value}`); |
| } |
| |
| |
| |
| |
| saveSettings() { |
| localStorage.setItem('holographicSecurityConfig', JSON.stringify(this.config)); |
| this.showNotification('تم حفظ الإعدادات بنجاح', 'success'); |
| this.closeModal(); |
| } |
| |
| |
| |
| |
| closeModal() { |
| const modal = document.querySelector('.training-modal, .settings-modal, .threat-details-modal'); |
| if (modal) { |
| modal.remove(); |
| } |
| } |
| |
| |
| |
| |
| updateThreatCounter() { |
| const counter = document.getElementById('threat-count'); |
| if (counter) { |
| const activeThreats = Array.from(this.threats.values()).filter(t => t.status === 'نشط').length; |
| counter.textContent = activeThreats; |
| |
| |
| const threatPanel = counter.closest('.threat-counter'); |
| if (activeThreats === 0) { |
| threatPanel.style.background = 'rgba(52, 211, 153, 0.1)'; |
| threatPanel.style.borderColor = '#34d399'; |
| } else if (activeThreats < 10) { |
| threatPanel.style.background = 'rgba(251, 191, 36, 0.1)'; |
| threatPanel.style.borderColor = '#fbbf24'; |
| } else { |
| threatPanel.style.background = 'rgba(248, 113, 113, 0.1)'; |
| threatPanel.style.borderColor = '#f87171'; |
| } |
| } |
| } |
| |
| |
| |
| |
| updateThreatList() { |
| const threatList = document.getElementById('active-threats-list'); |
| if (!threatList) return; |
| |
| const activeThreats = Array.from(this.threats.values()).filter(t => t.status === 'نشط'); |
| |
| threatList.innerHTML = activeThreats.map(threat => ` |
| <div class="threat-item" data-threat-id="${threat.id}"> |
| <div class="threat-info"> |
| <span class="threat-type">${threat.type}</span> |
| <span class="threat-severity severity-${threat.severity}">${threat.severity}</span> |
| </div> |
| <div class="threat-meta"> |
| <span class="threat-time">${this.formatTime(threat.timestamp)}</span> |
| <span class="threat-risk">${threat.risk}%</span> |
| </div> |
| </div> |
| `).join(''); |
| |
| |
| threatList.querySelectorAll('.threat-item').forEach(item => { |
| item.addEventListener('click', () => { |
| const threatId = item.dataset.threatId; |
| const threat = this.threats.get(threatId); |
| if (threat) { |
| this.handleThreatClick(threat); |
| } |
| }); |
| }); |
| } |
| |
| |
| |
| |
| formatTime(date) { |
| return date.toLocaleTimeString('ar-SA', { |
| hour: '2-digit', |
| minute: '2-digit' |
| }); |
| } |
| |
| |
| |
| |
| updateTime() { |
| const timeElement = document.getElementById('current-time'); |
| if (timeElement) { |
| const now = new Date(); |
| timeElement.textContent = now.toLocaleString('ar-SA', { |
| weekday: 'long', |
| year: 'numeric', |
| month: 'long', |
| day: 'numeric', |
| hour: '2-digit', |
| minute: '2-digit', |
| second: '2-digit' |
| }); |
| } |
| } |
| |
| |
| |
| |
| updateSystemStats() { |
| |
| const stats = { |
| cpu: Math.floor(Math.random() * 100), |
| memory: Math.floor(Math.random() * 100), |
| network: Math.floor(Math.random() * 100) |
| }; |
| |
| |
| const cpuValue = document.querySelector('.stat-item:nth-child(1) .stat-value'); |
| const cpuBar = document.querySelector('.stat-item:nth-child(1) .stat-fill'); |
| if (cpuValue && cpuBar) { |
| cpuValue.textContent = `${stats.cpu}%`; |
| cpuBar.style.width = `${stats.cpu}%`; |
| } |
| |
| |
| const memoryValue = document.querySelector('.stat-item:nth-child(2) .stat-value'); |
| const memoryBar = document.querySelector('.stat-item:nth-child(2) .stat-fill'); |
| if (memoryValue && memoryBar) { |
| memoryValue.textContent = `${stats.memory}%`; |
| memoryBar.style.width = `${stats.memory}%`; |
| } |
| |
| |
| const networkValue = document.querySelector('.stat-item:nth-child(3) .stat-value'); |
| const networkBar = document.querySelector('.stat-item:nth-child(3) .stat-fill'); |
| if (networkValue && networkBar) { |
| networkValue.textContent = `${stats.network}%`; |
| networkBar.style.width = `${stats.network}%`; |
| } |
| } |
| |
| |
| |
| |
| handleResize() { |
| if (this.camera && this.renderer) { |
| this.camera.aspect = window.innerWidth / window.innerHeight; |
| this.camera.updateProjectionMatrix(); |
| this.renderer.setSize(window.innerWidth, window.innerHeight); |
| } |
| } |
| |
| |
| |
| |
| handleKeyPress(event) { |
| switch (event.key) { |
| case 'Escape': |
| this.closeModal(); |
| break; |
| case 'v': |
| case 'V': |
| if (event.ctrlKey) { |
| this.toggleVoiceControl(); |
| } |
| break; |
| case 'r': |
| case 'R': |
| if (event.ctrlKey) { |
| this.toggleVRMode(); |
| } |
| break; |
| case '1': |
| this.switchTab('monitoring'); |
| break; |
| case '2': |
| this.switchTab('analysis'); |
| break; |
| case '3': |
| this.switchTab('response'); |
| break; |
| case '4': |
| this.switchTab('training'); |
| break; |
| } |
| } |
| |
| |
| |
| |
| showNotification(message, type = 'info') { |
| const notification = document.createElement('div'); |
| notification.className = `notification ${type}`; |
| notification.textContent = message; |
| |
| document.body.appendChild(notification); |
| |
| |
| setTimeout(() => { |
| if (notification.parentNode) { |
| notification.remove(); |
| } |
| }, 4000); |
| } |
| |
| |
| |
| |
| generateThreatDescription() { |
| const descriptions = [ |
| 'محاولة وصول غير مصرح بها إلى النظام', |
| 'نشاط مشبوه في حركة الشبكة', |
| 'اكتشاف برمجيات خبيثة', |
| 'محاولة استغلال ثغرة أمنية', |
| 'نشاط غير طبيعي في قاعدة البيانات', |
| 'محاولة اختراق جدار الحماية', |
| 'توزيع محتوى ضار عبر الشبكة', |
| 'نشاط برمجي مشبوه' |
| ]; |
| |
| return descriptions[Math.floor(Math.random() * descriptions.length)]; |
| } |
| |
| |
| |
| |
| generateRandomIP() { |
| return `${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}.${Math.floor(Math.random() * 255)}`; |
| } |
| |
| |
| |
| |
| generateRandomSystem() { |
| const systems = [ |
| 'خادم الويب الرئيسي', |
| 'قاعدة البيانات', |
| 'خادم البريد الإلكتروني', |
| 'نظام الملفات', |
| 'خادم التطبيق', |
| 'جدار الحماية', |
| 'نقطة النهاية', |
| 'خدمة المصادقة' |
| ]; |
| |
| return systems[Math.floor(Math.random() * systems.length)]; |
| } |
| |
| |
| |
| |
| removeThreat(threatId) { |
| const threat = this.threats.get(threatId); |
| if (threat && threat.mesh) { |
| this.scene.remove(threat.mesh); |
| } |
| this.threats.delete(threatId); |
| this.updateThreatCounter(); |
| this.updateThreatList(); |
| } |
| |
| |
| |
| |
| getSystemStats() { |
| return { |
| totalThreats: this.threats.size, |
| activeThreats: Array.from(this.threats.values()).filter(t => t.status === 'نشط').length, |
| networkNodes: this.networkNodes.size, |
| isInitialized: this.isInitialized, |
| currentMode: this.currentMode, |
| uptime: Date.now() - this.startTime |
| }; |
| } |
| |
| |
| |
| |
| destroy() { |
| console.log('🗑️ تدمير مركز القيادة الغامر...'); |
| |
| |
| if (this.animationId) { |
| cancelAnimationFrame(this.animationId); |
| } |
| |
| |
| this.scene.clear(); |
| this.renderer.dispose(); |
| |
| |
| const container = document.getElementById('holographic-command-center'); |
| if (container) { |
| container.remove(); |
| } |
| |
| console.log('✅ تم تدمير النظام بنجاح'); |
| } |
| } |
|
|
| |
| let holographicCommand; |
|
|
| |
| document.addEventListener('DOMContentLoaded', () => { |
| console.log('🚀 بدء تهيئة مركز القيادة السيبراني الغامر...'); |
| holographicCommand = new HolographicSecurityCommand(); |
| window.holographicCommand = holographicCommand; |
| }); |
|
|
| |
| if (typeof module !== 'undefined' && module.exports) { |
| module.exports = HolographicSecurityCommand; |
| } |