From e37400a0f3542530485132e5d5d6ac535786f861 Mon Sep 17 00:00:00 2001 From: 87owo <85057800+87owo@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:58:54 +0800 Subject: [PATCH] Add files via upload --- Interface/static/js/i18n.js | 252 ++++++++++++++++++++++++++++++++++-- Interface/static/js/main.js | 20 ++- PYAS.py | 6 +- 3 files changed, 260 insertions(+), 18 deletions(-) diff --git a/Interface/static/js/i18n.js b/Interface/static/js/i18n.js index c1ef2ad..0861f8a 100644 --- a/Interface/static/js/i18n.js +++ b/Interface/static/js/i18n.js @@ -157,7 +157,28 @@ window.AppI18n = { "col_conn_count": "連接數", "btn_extract_item": "提取項目", "msg_extract_success": "成功提取選取項目", - "msg_key_activated": "產品金鑰已啟用" + "msg_key_activated": "產品金鑰已啟用", + "INFO": "資訊", + "WARN": "警告", + "BLOCK": "攔截", + "SCAN": "掃描", + "System": "系統", + "Config Update": "設定更新", + "File Extract": "檔案提取", + "Load Engine": "載入引擎", + "Scan Completed": "掃描完成", + "Scan Engine": "掃描引擎", + "Virus Detected": "發現病毒", + "Virus Delete": "刪除病毒", + "Cloud API": "雲端 API", + "MBR Repaired": "MBR 修復", + "System Repair": "系統修復", + "Process Block": "進程攔截", + "File Block": "檔案攔截", + "Network Block": "網路攔截", + "Driver Block": "驅動攔截", + "System Restart": "系統重啟", + "Clean Junk": "清理垃圾" }, "simplified_switch": { "app_name": "PYAS Security", @@ -316,7 +337,28 @@ window.AppI18n = { "col_conn_count": "连接数", "btn_extract_item": "提取项目", "msg_extract_success": "成功提取选取项目", - "msg_key_activated": "产品密钥已启用" + "msg_key_activated": "产品密钥已启用", + "INFO": "信息", + "WARN": "警告", + "BLOCK": "拦截", + "SCAN": "扫描", + "System": "系统", + "Config Update": "设置更新", + "File Extract": "文件提取", + "Load Engine": "加载引擎", + "Scan Completed": "扫描完成", + "Scan Engine": "扫描引擎", + "Virus Detected": "发现病毒", + "Virus Delete": "删除病毒", + "Cloud API": "云端 API", + "MBR Repaired": "MBR 修复", + "System Repair": "系统修复", + "Process Block": "进程拦截", + "File Block": "文件拦截", + "Network Block": "网络拦截", + "Driver Block": "驱动拦截", + "System Restart": "系统重启", + "Clean Junk": "清理垃圾" }, "english_switch": { "app_name": "PYAS Security", @@ -475,7 +517,28 @@ window.AppI18n = { "col_conn_count": "Connections", "btn_extract_item": "Extract Item", "msg_extract_success": "Successfully extracted selected items", - "msg_key_activated": "Product key activated" + "msg_key_activated": "Product key activated", + "INFO": "INFO", + "WARN": "WARN", + "BLOCK": "BLOCK", + "SCAN": "SCAN", + "System": "System", + "Config Update": "Config Update", + "File Extract": "File Extract", + "Load Engine": "Load Engine", + "Scan Completed": "Scan Completed", + "Scan Engine": "Scan Engine", + "Virus Detected": "Virus Detected", + "Virus Delete": "Virus Delete", + "Cloud API": "Cloud API", + "MBR Repaired": "MBR Repaired", + "System Repair": "System Repair", + "Process Block": "Process Block", + "File Block": "File Block", + "Network Block": "Network Block", + "Driver Block": "Driver Block", + "System Restart": "System Restart", + "Clean Junk": "Clean Junk" }, "japanese_switch": { "app_name": "PYAS Security", @@ -634,7 +697,28 @@ window.AppI18n = { "col_conn_count": "接続数", "btn_extract_item": "アイテムを抽出", "msg_extract_success": "選択したアイテムを正常に抽出しました", - "msg_key_activated": "プロダクトキーが有効化されました" + "msg_key_activated": "プロダクトキーが有効化されました", + "INFO": "情報", + "WARN": "警告", + "BLOCK": "ブロック", + "SCAN": "スキャン", + "System": "システム", + "Config Update": "設定の更新", + "File Extract": "ファイルの抽出", + "Load Engine": "エンジンのロード", + "Scan Completed": "スキャン完了", + "Scan Engine": "スキャンエンジン", + "Virus Detected": "ウイルス検出", + "Virus Delete": "ウイルス削除", + "Cloud API": "クラウド API", + "MBR Repaired": "MBR 修復", + "System Repair": "システム修復", + "Process Block": "プロセスブロック", + "File Block": "ファイルブロック", + "Network Block": "ネットワークブロック", + "Driver Block": "ドライバーブロック", + "System Restart": "システムの再起動", + "Clean Junk": "ジャンククリーンアップ" }, "korean_switch": { "app_name": "PYAS Security", @@ -793,7 +877,27 @@ window.AppI18n = { "col_conn_count": "연결 수", "btn_extract_item": "항목 추출", "msg_extract_success": "선택한 항목을 성공적으로 추출했습니다", - "msg_key_activated": "제품 키가 활성화되었습니다" + "msg_key_activated": "제품 키가 활성화되었습니다", + "INFO": "정보", + "WARN": "경고", + "BLOCK": "차단", + "SCAN": "스캔", + "System": "시스템", + "Config Update": "설정 업데이트", + "File Extract": "파일 추출", + "Load Engine": "엔진 로드", + "Scan Completed": "스캔 완료", + "Scan Engine": "스캔 엔진", + "Virus Detected": "바이러스 발견", + "Virus Delete": "바이러스 삭제", + "Cloud API": "클라우드 API", + "MBR Repaired": "MBR 복구", + "System Repair": "시스템 복구", + "Process Block": "프로세스 차단", "File Block": "파일 차단", + "Network Block": "네트워크 차단", + "Driver Block": "드라이버 차단", + "System Restart": "시스템 재시작", + "Clean Junk": "정크 정리" }, "french_switch": { "app_name": "PYAS Security", @@ -952,7 +1056,28 @@ window.AppI18n = { "col_conn_count": "Connexions", "btn_extract_item": "Extraire l'élément", "msg_extract_success": "Éléments sélectionnés extraits avec succès", - "msg_key_activated": "Clé de produit activée" + "msg_key_activated": "Clé de produit activée", + "INFO": "INFO", + "WARN": "AVERT", + "BLOCK": "BLOCAGE", + "SCAN": "ANALYSE", + "System": "Système", + "Config Update": "Mise à jour config", + "File Extract": "Extraction de fichier", + "Load Engine": "Chargement moteur", + "Scan Completed": "Analyse terminée", + "Scan Engine": "Moteur d'analyse", + "Virus Detected": "Virus détecté", + "Virus Delete": "Suppression de virus", + "Cloud API": "API Cloud", + "MBR Repaired": "MBR réparé", + "System Repair": "Réparation système", + "Process Block": "Processus bloqué", + "File Block": "Fichier bloqué", + "Network Block": "Réseau bloqué", + "Driver Block": "Pilote bloqué", + "System Restart": "Redémarrage système", + "Clean Junk": "Nettoyage" }, "spanish_switch": { "app_name": "PYAS Security", @@ -1111,7 +1236,28 @@ window.AppI18n = { "col_conn_count": "Conexiones", "btn_extract_item": "Extraer elemento", "msg_extract_success": "Elementos seleccionados extraídos con éxito", - "msg_key_activated": "Clave de producto activada" + "msg_key_activated": "Clave de producto activada", + "INFO": "INFO", + "WARN": "ADVERT", + "BLOCK": "BLOQUEO", + "SCAN": "ESCANEO", + "System": "Sistema", + "Config Update": "Actualización config", + "File Extract": "Extracción de archivo", + "Load Engine": "Cargar motor", + "Scan Completed": "Escaneo completado", + "Scan Engine": "Motor de escaneo", + "Virus Detected": "Virus detectado", + "Virus Delete": "Eliminación de virus", + "Cloud API": "API en la nube", + "MBR Repaired": "MBR reparado", + "System Repair": "Reparación del sistema", + "Process Block": "Proceso bloqueado", + "File Block": "Archivo bloqueado", + "Network Block": "Red bloqueada", + "Driver Block": "Controlador bloqueado", + "System Restart": "Reinicio del sistema", + "Clean Junk": "Limpieza de basura" }, "hindi_switch": { "app_name": "PYAS Security", @@ -1270,7 +1416,28 @@ window.AppI18n = { "col_conn_count": "कनेक्शन", "btn_extract_item": "आइटम निकालें", "msg_extract_success": "चयनित आइटम सफलतापूर्वक निकाले गए", - "msg_key_activated": "उत्पाद कुंजी सक्रिय हो गई" + "msg_key_activated": "उत्पाद कुंजी सक्रिय हो गई", + "INFO": "जानकारी", + "WARN": "चेतावनी", + "BLOCK": "अवरोध", + "SCAN": "स्कैन", + "System": "सिस्टम", + "Config Update": "कॉन्फ़िगरेशन अपडेट", + "File Extract": "फ़ाइल निकालें", + "Load Engine": "इंजन लोड", + "Scan Completed": "स्कैन पूरा हुआ", + "Scan Engine": "स्कैन इंजन", + "Virus Detected": "वायरस का पता चला", + "Virus Delete": "वायरस हटाएँ", + "Cloud API": "क्लाउड API", + "MBR Repaired": "MBR मरम्मत", + "System Repair": "सिस्टम मरम्मत", + "Process Block": "प्रक्रिया अवरुद्ध", + "File Block": "फ़ाइल अवरुद्ध", + "Network Block": "नेटवर्क अवरुद्ध", + "Driver Block": "ड्राइवर अवरुद्ध", + "System Restart": "सिस्टम पुनरारंभ", + "Clean Junk": "कचरा साफ़ करें" }, "arabic_switch": { "app_name": "PYAS Security", @@ -1429,7 +1596,28 @@ window.AppI18n = { "col_conn_count": "الاتصالات", "btn_extract_item": "استخراج العنصر", "msg_extract_success": "تم استخراج العناصر المحددة بنجاح", - "msg_key_activated": "تم تنشيط مفتاح المنتج" + "msg_key_activated": "تم تنشيط مفتاح المنتج", + "INFO": "معلومات", + "WARN": "تحذير", + "BLOCK": "حظر", + "SCAN": "فحص", + "System": "النظام", + "Config Update": "تحديث التكوين", + "File Extract": "استخراج ملف", + "Load Engine": "تحميل المحرك", + "Scan Completed": "اكتمل الفحص", + "Scan Engine": "محرك الفحص", + "Virus Detected": "تم اكتشاف فيروس", + "Virus Delete": "حذف فيروس", + "Cloud API": "واجهة السحابة", + "MBR Repaired": "تم إصلاح MBR", + "System Repair": "إصلاح النظام", + "Process Block": "حظر عملية", + "File Block": "حظر ملف", + "Network Block": "حظر شبكة", + "Driver Block": "حظر محرك", + "System Restart": "إعادة تشغيل النظام", + "Clean Junk": "تنظيف المخلفات" }, "russian_switch": { "app_name": "PYAS Security", @@ -1588,7 +1776,28 @@ window.AppI18n = { "col_conn_count": "Соединения", "btn_extract_item": "Извлечь элемент", "msg_extract_success": "Выбранные элементы успешно извлечены", - "msg_key_activated": "Ключ продукта активирован" + "msg_key_activated": "Ключ продукта активирован", + "INFO": "ИНФО", + "WARN": "ПРЕДУПРЕЖДЕНИЕ", + "BLOCK": "БЛОКИРОВКА", + "SCAN": "СКАНИРОВАНИЕ", + "System": "Система", + "Config Update": "Обновление конфигурации", + "File Extract": "Извлечение файла", + "Load Engine": "Загрузка движка", + "Scan Completed": "Сканирование завершено", + "Scan Engine": "Движок сканирования", + "Virus Detected": "Обнаружен вирус", + "Virus Delete": "Удаление вируса", + "Cloud API": "Облачный API", + "MBR Repaired": "MBR восстановлен", + "System Repair": "Восстановление системы", + "Process Block": "Блокировка процесса", + "File Block": "Блокировка файла", + "Network Block": "Блокировка сети", + "Driver Block": "Блокировка драйвера", + "System Restart": "Перезапуск системы", + "Clean Junk": "Очистка мусора" }, "slovenian_switch": { "app_name": "PYAS Security", @@ -1747,7 +1956,28 @@ window.AppI18n = { "col_conn_count": "Povezave", "btn_extract_item": "Izvleči element", "msg_extract_success": "Izbrani elementi so bili uspešno izvlečeni", - "msg_key_activated": "Ključ izdelka je aktiviran" + "msg_key_activated": "Ključ izdelka je aktiviran", + "INFO": "INFO", + "WARN": "OPOZORILO", + "BLOCK": "BLOKADA", + "SCAN": "SKENIRANJE", + "System": "Sistem", + "Config Update": "Posodobitev konfiguracije", + "File Extract": "Izvleček datoteke", + "Load Engine": "Nalaganje mehanizma", + "Scan Completed": "Skeniranje končano", + "Scan Engine": "Mehanizem skeniranja", + "Virus Detected": "Zaznan virus", + "Virus Delete": "Izbris virusa", + "Cloud API": "Oblačni API", + "MBR Repaired": "MBR popravljen", + "System Repair": "Popravilo sistema", + "Process Block": "Proces blokiran", + "File Block": "Datoteka blokirana", + "Network Block": "Omrežje blokirano", + "Driver Block": "Gonilnik blokiran", + "System Restart": "Ponovni zagon sistema", + "Clean Junk": "Čiščenje nesnage" } }, langMap: { diff --git a/Interface/static/js/main.js b/Interface/static/js/main.js index dc98125..4a9acf9 100644 --- a/Interface/static/js/main.js +++ b/Interface/static/js/main.js @@ -80,7 +80,7 @@ document.addEventListener('DOMContentLoaded', () => { }; const cols = { - log: [{key: 'time_str', label: 'col_date', flex: 1.5}, {key: 'level', label: 'col_type', flex: 0.8}, {key: 'action', label: 'col_func', flex: 1.2, isI18n: true}, {key: 'source', label: 'col_path', flex: 3}], + log: [{key: 'time_str', label: 'col_date', flex: 1.5}, {key: 'level', label: 'col_type', flex: 0.8, isI18n: true}, {key: 'action', label: 'col_func', flex: 1.2, isI18n: true}, {key: 'source', label: 'col_path', flex: 3}], process: [{key: 'name', label: 'col_name', flex: 1.5}, {key: 'pid', label: 'col_pid', flex: 0.5}, {key: 'path', label: 'col_path', flex: 3}], startup: [{key: 'type', label: 'col_type', flex: 0.5, isI18n: true}, {key: 'name', label: 'col_name', flex: 1.5}, {key: 'status', label: 'col_status', flex: 0.5, isI18n: true}, {key: 'path', label: 'col_path', flex: 3}], virus: [{key: 'label', label: 'col_type', flex: 1, isI18n: true}, {key: 'path', label: 'col_path', flex: 3}], @@ -341,7 +341,15 @@ document.addEventListener('DOMContentLoaded', () => { if (selectAllCb) selectAllCb.disabled = dataList.length === 0; const ft = filterText.toLowerCase(); - let displayData = dataList.filter(item => !filterText || columns.some(col => String(item[col.key] || '').toLowerCase().includes(ft))); + let displayData = dataList.filter(item => !filterText || columns.some(col => { + const rawVal = String(item[col.key] || ''); + if (rawVal.toLowerCase().includes(ft)) return true; + if (col.isI18n) { + const transVal = getMsg(rawVal); + if (transVal && transVal.toLowerCase().includes(ft)) return true; + } + return false; + })); displayData.sort((a, b) => { const valA = a[state.sortKey] ?? '', valB = b[state.sortKey] ?? ''; @@ -684,13 +692,17 @@ document.addEventListener('DOMContentLoaded', () => { window.updateLogs = (entry) => { const logWidget = document.querySelector('.log-text'); if (logWidget) { - let parts = [`[${entry.time_str}]`, entry.level, getMsg(entry.action || '')]; + let parts = [`[${entry.time_str}]`, getMsg(entry.level || ''), getMsg(entry.action || '')]; if (entry.source) parts.push(`Src: ${entry.source}`); if (entry.target) parts.push(`Tgt: ${entry.target}`); if (entry.code) parts.push(`Code: ${entry.code}`); if (entry.pid) parts.push(`PID: ${entry.pid}`); if (entry.hash) parts.push(`Hash: ${entry.hash}`); - if (entry.detail) parts.push(`Detail: ${entry.detail}`); + + if (entry.detail) { + const transDetail = getMsg(entry.detail); + parts.push(`Detail: ${transDetail !== entry.detail ? transDetail : entry.detail}`); + } if (entry.operate !== null) parts.push(`Op: ${entry.operate}`); parts.push(`Success: ${entry.success}`); let val = logWidget.value + parts.join(' | ') + '\n'; diff --git a/PYAS.py b/PYAS.py index 5f6a8ad..5f67946 100644 --- a/PYAS.py +++ b/PYAS.py @@ -1903,7 +1903,7 @@ class WindowAPI: except Exception: continue def check_system_mbr(self): - for drive, mbr_value in self.mbr_backup.items(): + for drive, mbr_value in list(self.mbr_backup.items()): try: with open(rf"\\.\PhysicalDrive{drive}", "rb") as f: if f.read(512) != mbr_value: return True @@ -1959,7 +1959,7 @@ class WindowAPI: def scan_system_repair(self): items = [] - for drive, mbr_value in self.mbr_backup.items(): + for drive, mbr_value in list(self.mbr_backup.items()): drive_path = rf"\\.\PhysicalDrive{drive}" try: with open(drive_path, "rb") as f: @@ -2011,7 +2011,7 @@ class WindowAPI: return items def repair_system_mbr(self): - for drive, mbr_value in self.mbr_backup.items(): + for drive, mbr_value in list(self.mbr_backup.items()): drive_path = rf"\\.\PhysicalDrive{drive}" try: with open(drive_path, "rb+") as f: