Bỏ chức năng tìm hostname ở ip
This commit is contained in:
@@ -10,10 +10,8 @@ Flash (tách thành 2 module riêng):
|
||||
"""
|
||||
|
||||
from PyQt6.QtCore import QThread, pyqtSignal
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
|
||||
from core.scanner import scan_network
|
||||
from utils.network import _resolve_hostname
|
||||
|
||||
|
||||
class ScanThread(QThread):
|
||||
@@ -40,20 +38,6 @@ class ScanThread(QThread):
|
||||
progress_cb=on_ping_progress,
|
||||
stage_cb=on_stage)
|
||||
|
||||
# Resolve hostname song song
|
||||
self.stage.emit("hostname")
|
||||
with ThreadPoolExecutor(max_workers=50) as executor:
|
||||
future_to_dev = {
|
||||
executor.submit(_resolve_hostname, d["ip"]): d
|
||||
for d in results
|
||||
}
|
||||
for future in as_completed(future_to_dev):
|
||||
dev = future_to_dev[future]
|
||||
try:
|
||||
dev["name"] = future.result(timeout=3)
|
||||
except Exception:
|
||||
dev["name"] = ""
|
||||
|
||||
self.finished.emit(results)
|
||||
except Exception as e:
|
||||
self.error.emit(str(e))
|
||||
|
||||
5
main.py
5
main.py
@@ -533,10 +533,7 @@ class App(QWidget):
|
||||
self.scan_progress_bar.setRange(0, 0)
|
||||
self.scan_progress_bar.setFormat(" ARP broadcast scan...")
|
||||
self.scan_status.setText("⏳ Running ARP broadcast scan...")
|
||||
elif stage == "hostname":
|
||||
self.scan_progress_bar.setRange(0, 0)
|
||||
self.scan_progress_bar.setFormat(" Resolving hostnames...")
|
||||
self.scan_status.setText("⏳ Resolving hostnames...")
|
||||
|
||||
|
||||
def _on_scan_progress(self, done, total):
|
||||
self.scan_progress_bar.setRange(0, total)
|
||||
|
||||
Reference in New Issue
Block a user